agentleFS
dlazy-aidlazy-ai/ecommerce-skills/skills/one-shot/skill.md

one-shot

Skill71 starsChanged 3 months agoMITView on GitHub

已有模特图换模特、换背景。一张模特图 → 多人群多场景版本,商品本身不变。当用户说「换模特」「换背景」「换人种」「一图多版」「同一件衣服换个人」时使用。

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
skill.md

one-shot — 同一商品替换模特和背景

拿一张已经拍好的模特图或人台图,在商品完全不动的前提下换掉人、换掉背景,或两者都换。

和 flat-lay 的区别:flat-lay 从平铺图造一张模特图;本技能是把已有的模特图裂变成多个人群 / 场景版本——一次拍摄,覆盖国内海外、不同年龄段、不同肤色的投放需求。


生成效果示例

输入:原模特图
<img src="../../docs/one-shot/source-model.jpg" width="280">
source-model.jpg — 男青年身穿灰色落肩短袖,浅灰棚拍背景,768×1024

实际执行的命令(换模特换背景):

dlazy gpt-image-2 \
  --prompt 'Replace the model and the background of this e-commerce photo while keeping the garment untouched. Keep the grey oversized short-sleeve T-shirt exactly as it is: same slate-grey colour, same drop-shoulder cut, same white chest logo, same folds and hem. Replace the person with a different male model of similar build and age, and replace the plain studio wall with a sunlit outdoor city street with soft bokeh. Keep the same pose, camera angle, crop and framing. Photorealistic catalog shot, natural light, no text, no watermark.' \
  --images docs/one-shot/source-model.jpg \
  --size 1024x1536 --quality medium --imageFormat jpeg \
  --save docs/one-shot/example-output.jpg

输出

<img src="../../docs/one-shot/example-output.jpg" width="320">

example-output.jpg — 1024×1536。灰色落肩短袖的颜色、版型、胸前 logo 与下摆弧线保持不变;模特换成另一位男青年,棚拍灰墙换成树影斑驳的街景,姿势与景别沿用原图。


1、能力边界

模式说明
换模特换背景人和场景全换,只留商品
只换背景保留原模特(脸、身材、姿势),换掉环境
只换模特保留原场景与构图,换掉人
附加能力说明
指定模特性别 / 年龄 / 肤色 / 身材,锁定同一张脸做多 SKU
参考图决定新的姿势与场景,支持套图
参考图相似度50% 相似(借风格,保留原构图)/ 100% 相似(严格照抄参考图)
智能匹配模特位置自动对齐新模特与原商品的身体位置,避免衣服错位
自动修手生成后自动修正手部结构
人台图转真人输入人形模特(假人)图,输出真人上身图

不做:不改商品的款式、颜色、图案与版型;不做换脸到特定真人;不用于伪造他人肖像代言。


2、输入素材规则

生成前先自检这几条硬性约束:

  • 大小:20KB ~ 15MB
  • 分辨率:大于 400×400
  • 格式:jpg / jpeg / png / webp

输入类型:模特图 或 人台图(衣服已经穿在真人 / 假人身上的图)。

输入建议

做法说明
✅ 商品完整无遮挡手臂、包袋压住衣服的地方换人后容易崩
✅ 商品在画面中占比够大太小的商品换人时细节会被重绘丢失
✅ 光线均匀强逆光、大面积阴影会让新模特的光影对不上
❌ 多人同框模型分不清该换哪个人
❌ 商品被裁切出画的部分只能靠猜,容易长出错误结构

3、三种模式怎么选

你的目标选模式prompt 要写死的不变量
同款衣服卖给欧美市场换模特换背景商品(款式/颜色/图案/版型/褶皱)
同一套图换季节氛围只换背景商品 + 模特(脸/发型/身材/姿势)
人台图转真人图只换模特商品 + 场景 + 构图 + 光线
一张图裂变成多年龄段版本只换模特商品 + 场景 + 姿势 + 景别

「参考图相似度」的等价写法

档位写进 prompt
50% 相似Borrow the mood, colour grading and lighting style from image 2, but keep the original pose, camera angle and crop from image 1.
100% 相似Reproduce image 2 exactly for pose, camera angle, crop, background and lighting.

「自动修手」的等价写法:Hands must be anatomically correct — five distinct fingers per hand, natural knuckles, no fused or extra digits.

「智能匹配模特位置」的等价写法:Align the new body to the original garment: shoulder line, chest width, waist and hem must land on the same pixels as in image 1, so the garment does not shift or stretch.


4、工具调用

本技能使用 dLazy 的 gpt-image-2(图像编辑模型;本技能的本质是「保商品、换其余」的定向替换,需要强区域保持与指令跟随)。

调用方式

两种等价写法,选一种。统一入口会自动选后端、失败重试、建目录落盘、估算成本:

# A. 统一入口(推荐):可切任意后端,加 --dry-run 不计费空跑
node scripts/gen.mjs --task one-shot \
  --prompt '<见下方 Prompt 模板>' \
  --images <按下表顺序> \
  --save output/one-shot-<sku>.jpg

# B. 直接用 dLazy CLI(不想引入 Node 依赖时,效果等价)
dlazy gpt-image-2 --prompt '...' --images ... --save output/one-shot.jpg

参数约定(本技能固定用法)

参数取值理由
--images[原模特图];带参考图时 [原模特图, 参考图];固定模特时再追加 模特脸图顺序即 prompt 中的 image 1 / 2 / 3
--size与原图比例一致(竖版 1024x1536,方图 1024x1024)换人不该改变构图比例
--qualitymedium 常规;high 保面料纹理只换人时纹理容易被抹平
--imageFormatjpeg电商上架通用格式
--batch3 ~ 4换人随机性大,尤其手部
--savedocs/one-shot/output-<市场>-<sku>.jpg按投放市场归档

Command Examples

# basic call: 换模特换背景
dlazy gpt-image-2 \
  --prompt 'Replace the model and the background while keeping the garment untouched. Keep the garment exactly as it is: same colour, cut, logo, folds and hem. Replace the person with a different model of similar build, and replace the background with a sunlit outdoor city street with soft bokeh. Keep the same pose, camera angle, crop and framing.' \
  --images docs/one-shot/source-model.jpg \
  --size 1024x1536 --quality medium

# complex call: 只换模特 + 严格照抄参考姿势 + 固定模特脸 + 修手 + 出 4 张
dlazy gpt-image-2 \
  --prompt 'Replace only the model. Image 1 is the source photo, image 2 is the pose/scene reference, image 3 is the target model face. Keep the garment 100% identical to image 1 — same colour, knit texture, print placement, silhouette and hem. Reproduce image 2 exactly for pose, camera angle, crop, background and lighting. Use the face and body type from image 3. Align the new body to the original garment: shoulder line, chest width, waist and hem must land on the same pixels as in image 1. Hands must be anatomically correct — five distinct fingers per hand, no fused or extra digits. Photorealistic, no text, no watermark.' \
  --images docs/one-shot/source-model.jpg docs/one-shot/pose-ref.jpg docs/one-shot/model-face.jpg \
  --size 1024x1536 --quality high --imageFormat jpeg \
  --batch 4 --save docs/one-shot/output-eu-sku001.jpg

# 先估价不真跑
dlazy gpt-image-2 --dry-run --prompt '...' --images a.jpg --size 1024x1536

延伸阅读

要查什么去哪
认证、多后端配置、输出结构、错误码references/provider-cli.md
gpt-image-2 的全部可用参数references/model-flags.md
统一入口的全部选项node scripts/gen.mjs --help

5、Prompt 模板

Replace [the model / the background / the model and the background] of this e-commerce photo
while keeping the garment untouched.

Keep the [商品描述] exactly as it is: same [颜色], same [版型/剪裁], same [印花/logo 位置],
same folds and hem.

Replace the person with [新模特描述:性别 / 年龄 / 肤色 / 身材].
Replace the background with [新场景描述].

Keep the same pose, camera angle, crop and framing.
Align the new body to the original garment: shoulder line, chest width, waist and hem
must land on the same pixels as in image 1.
Hands must be anatomically correct — five distinct fingers per hand, no fused or extra digits.

Photorealistic catalog shot, natural light, no text, no watermark.

按模式裁剪模板

模式删掉哪句 / 加哪句
只换背景删掉 Replace the person with …,加 Keep the model identical — same face, hair, body and pose.
只换模特删掉 Replace the background with …,加 Keep the background, props, framing and lighting pixel-identical to image 1.
人台图转真人加 The source shows the garment on a headless mannequin. Replace the mannequin with a real human model of [描述], adding a natural head, neck, arms and hands. Keep the garment fit exactly as the mannequin shows it.

6、执行流程

  1. 确认模式:查第三节表格,明确哪些是不变量。
  2. 校验输入:商品是否完整无遮挡、是否单人、光线是否均匀。
  3. 写不变量:先把「保什么」写全(商品的颜色/版型/图案/褶皱),再写「换什么」。
  4. 加位置对齐句 + 修手句——这两条几乎每次都要,能显著降低返工率。
  5. 有参考图时选相似度:借氛围用 50% 档写法,严格复刻用 100% 档写法。
  6. --dry-run 估价 → 真跑 → --batch 3~4 挑图,落盘到 docs/one-shot/。
  7. 质检:商品是否被改(重点看图案位置和版型)、衣服是否错位、手部、光影是否统一。

7、常见问题

现象原因处理
衣服跟着人一起变了不变量写得不够具体逐项写死颜色 / 版型 / 图案位置 / 下摆弧线
换人后衣服错位、被拉伸新身体与原商品没对齐加位置对齐句(第三节)
手指崩坏换人时手部重绘加修手句 + --batch 4 挑图
只换背景却把人也换了模式句不完整补 Keep the model identical — same face, hair, body and pose.
新背景光线和人对不上未约束光向追加 Match the new background lighting to the light direction on the model in image 1.
面料纹理被抹平--quality medium改 --quality high,或换图后接 material-enhancement
人台图转真人后脖子/手很怪缺少补全指令用第五节人台图专用句,明确要求补出头颈与手臂

Tips

Visit https://dlazy.com for more information.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.