Turn aflat-lay garment imageinto acommercial photo of a model wearing it, without booking a model, renting a venue, or using a photo studio.
This skill is implemented with dLazy's gpt-image-2 : it uses dual-image reference of "garment image + reference image" for image editing and compositing, keeping the garment faithful and copying the pose and scene from the reference image.
Generation example
| Input: flat-lay garment image | Input: reference image |
|---|---|
garment-flatlay.jpg — army-green cable-knit crewneck sweater, 800×800 |
pose-reference.jpg — young man standing front-facing, light gray wall studio shot, 768×1024 |
Actual command executed:
dlazy gpt-image-2 \
--prompt 'E-commerce on-model product photography. Image 1 is the garment flat-lay: an olive-green cable-knit crewneck sweater. Image 2 is the pose/scene reference. Dress the model from image 2 in the garment from image 1, replacing the grey T-shirt. Keep the garment 100% faithful: identical olive-green color, cable-knit and diamond texture, oversized drop-shoulder fit, ribbed collar and cuffs, and the small woven label on the right cuff. Reproduce the reference exactly for pose, camera angle, crop, body proportions, lighting and the plain light-grey studio wall background. Photorealistic full-frame catalog shot, sharp fabric detail, natural soft light, no text or watermark.' \
--images docs/flat-lay/garment-flatlay.jpg docs/flat-lay/pose-reference.jpg \
--size 1024x1536 --quality high --imageFormat jpeg \
--save docs/flat-lay/example-output.jpg
Output
example-output.jpg — 1024×1536, 60 credits, about 60s.
The cable knit, diamond jacquard, dropped-shoulder fit, ribbed cuffs, and woven label on the right sleeve are all preserved; the pose, framing, lighting, and light gray background are copied from the reference image.
1. Capability boundaries
| Capability | Description |
|---|---|
| Single-item try-on | Upload 1 flat-lay image or real-person worn image of a single garment (top / dress / one-piece) |
| Multi-item try-on | Upload a "top image" + "bottom image" separately, and composite them into a complete Look on the same model |
| Reference image | Determines the model's pose, shooting angle, framing, scene, and lighting; can use the asset library or your own commercial photos |
| Specified model | Optional. Locks the same face to ensure visual consistency across multiple SKUs in the same store; if not specified, it is determined by the model image in the reference image |
| Generation strategy | General / color saturation optimization / material enhancement / artifact issue optimization / precise selection |
Not done: no changing style, no changing color, no changing prints, no modifying tag text; not used for commercial endorsement by forging another person's likeness.
2. Input asset rules
Before generating, self-check these hard constraints:
- Size:20KB ~ 15MB
- Resolution:greater than 400×400
- Format:jpg / jpeg / png / webp
Recommended input types (✅)
| Type | Description |
|---|---|
| Flat-lay top image | Solid-color background, laid flat and spread out, fully visible |
| Flat-lay one-piece / dress image | Single item as a whole |
| Real-person worn image | An existing real-person commercial photo, used to change pose and scene |
Inputs that will noticeably degrade results (❌)
| Issue | Description |
|---|---|
| Product is occluded | Model's arm, bag, or prop presses on the main body of the garment |
| Set product | Top + bottom + shoes in one image; single-item try-on cannot recognize it → please switch to "multi-item try-on" and split it into two images |
| Product is unclear | Blurry, overexposed, low resolution, strong color cast |
3. Selection dimensions for reference images and models
Reference image(Determines pose and scene; it is the dominant variable for the output style)
- Dimension:
单图 / 套图 - Category:
女装 / 男装 / 童装(multiple choice) - Region:
国内 / 海外(multiple choice) - Type:
电商 / 种草(multiple choice) - Filter: Gender
男 / 女; Age婴儿 / 小童 / 大童 / 青少年 / 青年人 / 中年人 / 老年人; Skin tone欧美人 / 非洲人 / 亚洲人 / 其他肤色 - You can also directly use your own reference images (batch supported), or search for similar poses by image
Model(optional, locks the face)
- Dimensions: gender / age / skin tone / body type, or specify randomly
- Specifying a model adds about 1 minute to generation time
Selection suggestions:
- Forstyle fidelity first → choose a front-facing standing pose, solid color background, and shot size consistent with the product for the reference image (half-body for tops, full-body for dresses).
- Foratmosphere and种草 first → choose street shots / indoor lifestyle scenes with a setting for the reference image, and accept slight fit deviations.
- Multi-SKU batch → fix the same reference image + the same model, and change only the clothing image.
IV. Tool invocation
This skill uses dLazy's gpt-image-2(a multi-image reference image editing and compositing model, up to 5 reference images, supports 1024×1536 vertical commercial photography ratio).
Invocation method
Two equivalent ways to write it; choose one. The unified entry point automatically selects the backend, retries on failure, creates directories and writes to disk, and estimates cost:
# A. 统一入口(推荐):可切任意后端,加 --dry-run 不计费空跑
node scripts/gen.mjs --task flat-lay \
--prompt '<见下方 Prompt 模板>' \
--images <按下表顺序> \
--save output/flat-lay-<sku>.jpg
# B. 直接用 dLazy CLI(不想引入 Node 依赖时,效果等价)
dlazy gpt-image-2 --prompt '...' --images ... --save output/flat-lay.jpg
Parameter conventions (fixed usage for this skill)
| Parameter | Value | Reason |
|---|---|---|
--images |
[服装图, 参考图](when multiple garments are worn, [上装图, 下装图, 参考图]) |
the order is image 1 / 2 / 3 in the prompt |
--size |
1024x1536(vertical 3:4, main image for commercial photography); for flat-lay detail images use 1024x1024 |
E-commerce main images default to vertical |
--quality |
high |
Fabric texture and knit structure require a high-quality tier |
--imageFormat |
jpeg |
Common format for e-commerce listings |
--batch |
2 ~ 4 |
Generate several at once to select from |
--save |
docs/flat-lay/output-<sku>.jpg |
Write directly to disk, saving a download step |
Command Examples
# basic call: 单件上身(服装图 + 参考图)
dlazy gpt-image-2 \
--prompt 'On-model e-commerce photo. Image 1 is the garment flat-lay, image 2 is the pose/scene reference. Dress the model from image 2 in the garment from image 1. Keep the garment identical in color, texture, print and fit. Copy the reference pose, camera angle, crop, lighting and background.' \
--images docs/flat-lay/garment-flatlay.jpg docs/flat-lay/pose-reference.jpg \
--size 1024x1536 --quality high
# complex call: 多件上身 + 指定模特 + 一次出 4 张挑图 + 直接落盘
dlazy gpt-image-2 \
--prompt 'Full-look on-model e-commerce photo. Image 1 is the top flat-lay, image 2 is the bottom flat-lay, image 3 is the pose/scene reference, image 4 is the fixed model face. Dress the model in the top from image 1 and the bottom from image 2. Preserve both garments exactly: color, knit/weave texture, print placement, hem and cuff details. Reproduce image 3 for pose, camera angle, crop, lighting and background. Keep the face and body type from image 4 unchanged. Photorealistic catalog shot, no text, no watermark.' \
--images docs/flat-lay/top.jpg docs/flat-lay/bottom.jpg docs/flat-lay/pose-reference.jpg docs/flat-lay/model-face.jpg \
--size 1024x1536 --quality high --imageFormat jpeg \
--batch 4 --save docs/flat-lay/output-sku001.jpg
# 先估价不真跑
dlazy gpt-image-2 --dry-run --prompt '...' --images a.jpg b.jpg --size 1024x1536
Further reading
| What to look up | Where to go |
|---|---|
| Authentication, multi-backend configuration, output structure, error codes | references/provider-cli.md |
gpt-image-2 all available parameters |
references/model-flags.md |
| All options of the unified entry point | node scripts/gen.mjs --help |
V. Prompt template
Replace the content in square brackets and fill it into --prompt。English prompts are more stable for clothing fidelity。
E-commerce on-model product photography.
Image 1 is the garment flat-lay: [品类 + 颜色 + 面料,例:an olive-green cable-knit crewneck sweater].
Image 2 is the pose/scene reference.
Dress the model from image 2 in the garment from image 1, replacing the garment they are currently wearing.
Keep the garment 100% faithful: identical [颜色], [面料/织法纹理], [版型,例:oversized drop-shoulder fit],
[领口/袖口/下摆细节], and [印花/logo/吊牌位置].
Reproduce the reference exactly for pose, camera angle, crop, body proportions, lighting and background.
Photorealistic full-frame catalog shot, sharp fabric detail, natural soft light, no text or watermark.
Sentences appended by generation strategy
| Strategy | Append to the end of the prompt |
|---|---|
| General (default) | Do not add |
| Color saturation optimization | Match the garment color to image 1 exactly — same hue, saturation and brightness; do not boost or wash out the color. |
| Material enhancement | Emphasize fabric micro-texture: visible knit loops / weave grain / pile direction, realistic fiber sheen and soft shadow in the folds. |
| Collapse issue optimization | Anatomy must be correct: five fingers per hand, symmetric shoulders, no extra limbs, no melted collar or warped sleeve seams. |
| Precise selection | Change only the garment region. Keep the face, hair, hands, lower body, accessories and background pixel-identical to image 2. |
VI. Execution process
- Validate input: size / resolution / format; exclude occluded, set, and blurry images (see Section II).
- Determine mode: single item → 1 clothing image; full outfit → upload the top image + bottom image separately.
- Prepare reference image: choose a commercial photography image, align dimensions with the target audience (gender/age/skin tone/category/domestic or overseas/e-commerce种草).
- Optional fixed model: For batch scenarios, be sure to keep it fixed to ensure multiple SKUs share the same face.
- Write prompt: Use the template in Section 5, and specify the clothing's color, weave, fit, and details concretely—the more specific you write, the higher the fidelity。
--dry-runEstimate, and after confirming credits, remove this parameter and run it for real.--batch 2~4Generate multiple images and select, and save them todocs/flat-lay/。- Quality check: whether the color is off, whether the texture is blurry, whether the print position has shifted, and whether the fingers and neckline are distorted. If not qualified → add the corresponding strategy sentence from the table in Section 5 and rerun.
7. Common Issues
| Symptom | Cause | Solution |
|---|---|---|
| Color is off | Flat-lay image has color cast / model adjusts colors on its own | Add the "color saturation optimization" sentence; hard-code the specific color name in the prompt |
| Texture is blurred into one patch | --quality medium, or the flat-lay image resolution is low |
Change --quality high; replace with a clearer flat-lay image |
| Print / logo position shifts | The prompt does not describe the position | Clearly write logo centered on left chest, 8cm wide and the like |
| Fingers and neckline are distorted | Generation randomness | Add the "distortion issue optimization" sentence + --batch 4 and select images |
| Background / face is altered | The model redrew the entire image | Add the "precise selection" sentence |
| Only uploading a set outfit image, cannot recognize individual pieces | Invalid input | Split into a top image + bottom image, and use multi-piece try-on |
| The fit is obviously wrong (loose becomes tight) | The reference image shot size does not match the category | For tops, choose half-body reference images; for dresses, choose full-body reference images |
Tips
Visit https://dlazy.com for more information.