to-3d — Generate 3D Garment Images from Flat-Lay Photos
Transform a garment photo laid flat on a table into a dimensional 3D image — as if worn by an invisible person (known in the industry as a ghost mannequin / invisible model).
Use case: Flat-lay photos are cheap but look cheap. Real model photos are expensive and unsuitable for all categories. 3D garment images are the middle ground — offering texture, showcasing fit, without model costs or portrait rights issues.
Example Output
| Input: Flat-Lay Photo |
|---|
garment-flatlay.jpg — Olive green cable-knit crewneck sweater flat-lay, 800×800 |
Actual command executed:
dlazy gpt-image-2 \
--prompt 'Turn this flat-lay garment photo into a dimensional 3D ghost-mannequin product shot. The olive-green cable-knit crewneck sweater must gain realistic volume: filled shoulders and chest, sleeves with natural bend, visible interior of the collar, soft self-shadow under the hem, as if worn by an invisible mannequin. Keep the garment 100% faithful: same olive-green colour, same cable-knit and diamond stitch pattern, same ribbed collar and cuffs, same woven cuff label. Clean seamless light-grey studio background, soft top light, sharp fibre detail. No mannequin, no person, no text.' \
--images docs/to-3d/garment-flatlay.jpg \
--size 1024x1024 --quality medium --imageFormat jpeg \
--save docs/to-3d/example-output.jpg
Output
example-output.jpg — 1024×1024. Shoulders and chest are filled, sleeves naturally bent, collar opening reveals inner ribbing and back lining, hem has a self-weight shadow; cable-knit and diamond stitch pattern, olive-green colour, ribbed structure and right sleeve woven label remain unchanged, no mannequin or body visible in the frame.
1. Capability Boundaries
| Capability | Description |
|---|---|
| Dimensional Filling | Shoulder and chest filling, sleeve bending, collar interior visibility, hem self-weight shadow |
| Garment Types | Tops / Bottoms / Dresses / Outerwear / Underwear / Kids' Wear / Homewear |
| Shape Control | Reference image (copy a specific 3D shape) or custom prompt |
| Texture Enhancement | On/Off switch; when enabled, surface details of knits, fleece, leather become clearer |
| Generation Aspect Ratio | 1:1 (square main image) / 3:4 (vertical detail image) |
Does NOT do: Change colour, weave, print, or ribbing structure; generate human bodies or faces; alter the actual garment fit proportions.
2. Input Material Requirements
Check these hard constraints before generating:
- Size: 20KB ~ 15MB
- Resolution: Greater than 400×400
- Format: jpg / jpeg / png / webp
Recommended Inputs (✅): Single flat-lay garment on a plain background, completely flat, no wrinkles or folds, full front view, with clear collar and hem boundaries.
Inputs That Clearly Degrade Results (❌)
| Issue | Description |
|---|---|
| Folded Placement | Sleeves folded on the body; the model cannot calculate sleeve length |
| Heavy Wrinkles | Wrinkles will be interpreted as structure and deform the shape |
| Already on a Body | Use one-shot for images already on a person |
| Set Items in Same Frame | Separate into single items and process individually |
3. Three Control Points for the 3D Shape
| Control Point | Write in Prompt | What Happens If Not Written |
|---|---|---|
| Fill Level | filled shoulders and chest with realistic volume, natural fabric drape | Fills up like a balloon, proportions distorted |
| Sleeve Pose | sleeves with a natural bend, hanging slightly forward and away from the body | Sleeves stick straight to the sides |
| Collar Interior | visible interior of the collar showing the inner facing | Collar is a flat hole, the most obvious giveaway |
Add two environmental constraints:
soft self-shadow under the hem and inside the sleeves
No mannequin, no person, no visible support — the garment must appear worn by an invisible body.
The phrase No mannequin, no person must be included, otherwise the model often generates a mannequin torso or half a body.
4. Tool Invocation
This skill uses dLazy's gpt-image-2 (image editing model; inferring volume from 2D requires strong geometric understanding while strictly preserving weave and colour).
Invocation Methods
Two equivalent methods, choose one. The unified entry point automatically selects the backend, retries on failure, creates directories, saves to disk, and estimates cost:
# A. Unified entry point (recommended): switchable backend, add --dry-run for cost-free test-run
node scripts/gen.mjs --task to-3d \
--prompt '<See Prompt Template below>' \
--images <in order from table below> \
--save output/to-3d-<sku>.jpg
# B. Directly use dLazy CLI (when you don't want Node dependencies, equivalent effect)
dlazy gpt-image-2 --prompt '...' --images ... --save output/to-3d.jpg
Parameter Conventions (fixed usage for this skill)
| Parameter | Value | Reason |
|---|---|---|
--images | [flat-layer image]; with shape reference [flat-layer, shape-reference] | Order corresponds to image 1 / 2 in prompt |
--size | 1024x1024 (square main image) / 1024x1536 (vertical longs, dresses) | Corresponds to platform's 1:1 / 3:4 ratios |
--quality | high (equivalent to "texture enhancement on") / medium (off) | Knits, fleece must use high |
--imageFormat | jpeg | Universal e-commerce listing format |
--batch | 2 ~ 3 | Volume inference has randomness |
--save | docs/to-3d/output-<sku>.jpg | Directly saves to disk |
Command Examples
# basic call
dlazy gpt-image-2 \
--prompt 'Turn this flat-lay garment photo into a dimensional 3D ghost-mannequin product shot. Filled shoulders and chest with realistic volume, sleeves with a natural bend, visible interior of the collar, soft self-shadow under the hem. Keep the garment 100% faithful: same colour, same stitch pattern, same ribbing, same label. Clean seamless light-grey studio background. No mannequin, no person, no text.' \
--images docs/to-3d/garment-flatlay.jpg \
--size 1024x1024 --quality high
# complex call: copy a specific 3D shape + vertical + generate 3 images for selection
dlazy gpt-image-2 \
--prompt 'Turn image 1 (a flat-lay garment) into a dimensional 3D ghost-mannequin product shot, copying the volume, posture and camera angle of image 2. Filled shoulders and chest with realistic volume and natural fabric drape, sleeves with a natural bend hanging slightly forward, visible interior of the collar showing the inner facing, soft self-shadow under the hem and inside the sleeves. Keep the garment 100% faithful to image 1: same colour, same knit structure, same print placement, same ribbing and label. Clean seamless light-grey studio background, soft top light, sharp fibre detail. No mannequin, no person, no visible support, no text.' \
--images docs/to-3d/garment-flatlay.jpg docs/to-3d/volume-ref.jpg \
--size 1024x1536 --quality high --imageFormat jpeg \
--batch 3 --save docs/to-3d/output-sku001.jpg
# estimate cost without actually running
dlazy gpt-image-2 --dry-run --prompt '...' --images a.jpg --size 1024x1024 --quality high
Further Reading
| What to Look Up | Where |
|---|---|
| Authentication, multi-backend configuration, output structure, error codes | references/provider-cli.md |
All available parameters for gpt-image-2 | references/model-flags.md |
| All options for the unified entry point | node scripts/gen.mjs --help |
5. Prompt Template
Turn this flat-lay garment photo into a dimensional 3D ghost-mannequin product shot.
The [Category + Color + Fabric] must gain realistic volume:
filled shoulders and chest, sleeves with a natural bend,
visible interior of the collar showing the inner facing,
soft self-shadow under the hem and inside the sleeves,
as if worn by an invisible body.
Keep the garment 100% faithful: same [Color], same [Weave/Texture], same [Print/Pattern Placement],
same [Ribbing/Collar/Cuff/Hem Structure], same [Tag/Label].
Clean seamless [Background Color] studio background, soft top light, sharp fibre detail.
No mannequin, no person, no visible support, no text.
Correction Sentences for Specific Issues
| Issue | Append to End of Prompt |
|---|---|
| Mannequin or half-body appears | Absolutely no mannequin, torso, neck, arms or hands anywhere in the frame — only the garment. |
| Overfilled, proportion widened | Keep the original garment proportions: body width, sleeve length and hem width must match image 1 exactly. Add volume, not size. |
| Collar is a flat hole | The collar opening must show the inner facing and the inside back of the garment, with correct depth and shadow. |
| Weave smoothed out | Change --quality high, append resolve individual knit loops and yarn twist |
| Shadow direction inconsistent | Single soft top-left light source; one consistent contact shadow beneath the garment. |
6. Execution Flow
- Validate Input: Completely flat, no folds, no heavy wrinkles, single item, clear boundaries.
- Write Three Control Points (Fill / Sleeve Pose / Collar Interior) + Two Environmental Constraints (Self-Weight Shadow / No Mannequin).
- Write Fidelity Items: Colour, weave, print placement, ribbing structure, tag.
- Select Aspect Ratio and Quality: Knits, fleece always use
--quality high. --dry-runEstimate → Run →--batch 2~3Select Image, Save todocs/to-3d/.- Quality Check: Check for human body generation, proportion widening, correct collar interior, preservation of weave.
7. Frequently Asked Questions
| Observation | Cause | Solution |
|---|---|---|
| Mannequin/half-body appears | Missing prohibition sentence | Append strengthened prohibition sentence (Section 5) |
| Proportion widened | Only mentioned adding volume, not preserving proportions | Append proportion preservation sentence: Add volume, not size. |
| Collar is a flat black hole | Interior not described | Append collar interior sentence |
| Sleeves stick straight to sides | Sleeve pose not described | Append hanging slightly forward and away from the body |
| Weave blurry | --quality medium | Switch to high; or chain with material-enhancement |
| Poor result with folded image | Input violation | Retake as a completely flat flat-lay photo |
Tips
Visit https://dlazy.com for more information.

