SuperAPI AI Directory

fabric-on-body

General & other

View repository

Updated 10-16 08:49

About this skill

fabric-on-body — one-click replacement of clothing fabric

The pattern stays unchanged, the fabric is swapped out. Give a clothing pattern image + a fabric swatch, and output a sample garment render of this pattern made with the new fabric.

The value is before sampling: trying 8 fabrics on one pattern traditionally means making 8 sample garments (each taking days and costing hundreds); here it is 8 generations.


Generation example

Input: clothing pattern image Input: fabric image
style-sheet.jpg — drop-shoulder loose crew-neck sweater pattern, 800×800 fabric-swatch.jpg — ivory white silk satin swatch, 640×640

Command actually executed:

dlazy gpt-image-2 \
  --prompt 'Fabric replacement for a garment style sheet. Image 1 is the garment pattern/style reference: an oversized drop-shoulder crewneck sweater with ribbed collar, cuffs and hem. Image 2 is the target fabric: ivory silk satin with a soft lustrous sheen and fine weave. Re-render the exact same garment silhouette from image 1 in the fabric from image 2. Keep the pattern identical: same oversized drop-shoulder cut, same body length, same sleeve length, same collar/cuff/hem construction, same flat-lay layout and camera angle. Replace only the material — the sweater must now read as ivory silk satin with specular highlights on the folds and soft drape instead of chunky knit. Clean white background, even studio light, no text.' \
  --images docs/fabric-on-body/style-sheet.jpg docs/fabric-on-body/fabric-swatch.jpg \
  --size 1024x1024 --quality medium --imageFormat jpeg \
  --save docs/fabric-on-body/example-output.jpg

Output

example-output.jpg — 1024×1024. The drop-shoulder cut, body length, sleeve length, and the structure and flat-lay angle of the ribbed neckline, cuffs, and hem are all consistent with the pattern image; the material changes from coarse knit to ivory white silk satin, highlights appear on the folds, the drape becomes smooth and soft, and the ribbed areas are still retained with a satin texture.


1. Capability boundaries

Input Description
Clothing pattern image Determines the pattern, cut, structure, and shooting angle
Fabric image Determines the material, texture, sheen, and drape (a close-up fabric swatch is best)
Clothing type Helps the model understand the structure (tops / bottoms / dresses / outerwear / underwear)
Stays unchanged Will change
Pattern and cut, body length, sleeve length, neckline/cuff/hem structure, seam positions, shooting angle and composition Material and weave, surface sheen, drape and fold morphology, perceived thickness

Does not do: does not change pattern proportions; does not change the garment's structural design; does not promise the hand feel and weight of a real sample — the output is a visual preview, not a production sample garment.


2. Input material rules

Before generating, self-check these hard constraints:

  • Size:20KB ~ 15MB
  • Resolution:greater than 400×400
  • Format:jpg / jpeg / png / webp

Pattern image (✅): solid-color background, clear structure, complete front-facing flat-lay or mannequin image.

Fabric image (✅): close-up of a fabric swatch, with visible weave and sheen; folds and turns are even better (they convey drape).

Inputs that will noticeably reduce the effect (❌)

Problem Description
Fabric image shot too far away The weave cannot be seen clearly, and it will only be treated as a solid color
Fabric image has strong ambient color White cloth photographed under yellow light will be changed to beige
Pattern image has complex prints The original print will clash with the new fabric; first use item-repair or switch to a plain image
Fabric does not match the category Stiff denim cannot produce the drape of a slip dress, and the model will force it

3. The key to fabric replacement: clearly describe "the physical changes brought by the material"

Just saying "change to silk" is not enough — the model does not know how to change the lighting. Translate the material intodrawable physical characteristics:

Fabric Physical characteristics to write
Silk / satin lustrous specular highlights along the folds, fluid drape, soft continuous gradients
Chunky knit chunky knit loops with visible yarn twist, matte fibre halo, structured heavy drape
Denim twill diagonal weave, slight slub texture, stiff drape with sharp fold creases
Corduroy vertical wale ridges catching light, matte pile, medium-stiff drape
Chiffon semi-sheer, very light drape with many fine ripples, soft diffused light through the fabric
Leather low-frequency specular sheen, grain texture, stiff drape with broad soft creases
Fleece dense short pile, fuzzy silhouette edge, no specular highlight

Add one more sentence: "the silhouette must not change"—This is where this skill most easily fails:

Keep the pattern identical: same cut, same body length, same sleeve length,
same collar/cuff/hem construction, same flat-lay layout and camera angle.
Replace only the material.

4. Tool invocation

This skill uses dLazy's gpt-image-2(image editing model; fabric replacement requires "geometry completely unchanged, material completely changed", a typical targeted attribute replacement task).

How to invoke

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 fabric-on-body \
  --prompt '<见下方 Prompt 模板>' \
  --images <按下表顺序> \
  --save output/fabric-on-body-<sku>.jpg

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

Parameter conventions (fixed usage for this skill)

Parameter Value Reason
--images [版式图, 面料图] Order is image 1 / 2 in the prompt
--size Consistent with the layout image's aspect ratio (1024x1024 flat lay / 1024x1536 mannequin vertical) Changing material should not change composition
--quality high Material is the only output of this skill, must be high
--imageFormat jpeg General format
--batch 2 ~ 3 Drape form has randomness
--save docs/fabric-on-body/output-<版型>-<面料>.jpg Silhouette × fabric matrix naming

Command Examples

# basic call: 一个版型换一种面料
dlazy gpt-image-2 \
  --prompt 'Fabric replacement. Image 1 is the garment pattern reference, image 2 is the target fabric. Re-render the exact same garment silhouette from image 1 in the fabric from image 2. Keep the pattern identical: same cut, body length, sleeve length, collar/cuff/hem construction, layout and camera angle. Replace only the material. Clean white background, even studio light, no text.' \
  --images docs/fabric-on-body/style-sheet.jpg docs/fabric-on-body/fabric-swatch.jpg \
  --size 1024x1024 --quality high

# complex call: 一个版型 × 多种面料,跑成一个选型矩阵
STYLE=docs/fabric-on-body/style-sheet.jpg
KEEP='Keep the pattern identical: same oversized drop-shoulder cut, same body length, same sleeve length, same collar/cuff/hem construction, same flat-lay layout and camera angle. Replace only the material.'
for F in satin corduroy denim fleece; do
  case $F in
    satin)    PHYS='lustrous specular highlights along the folds, fluid drape, soft continuous gradients' ;;
    corduroy) PHYS='vertical wale ridges catching light, matte pile, medium-stiff drape' ;;
    denim)    PHYS='twill diagonal weave, slight slub texture, stiff drape with sharp fold creases' ;;
    fleece)   PHYS='dense short pile, fuzzy silhouette edge, no specular highlight' ;;
  esac
  dlazy gpt-image-2 \
    --prompt "Fabric replacement for a garment style sheet. Image 1 is the garment pattern/style reference. Image 2 is the target fabric. Re-render the exact same garment silhouette from image 1 in the fabric from image 2. $KEEP The garment must now read as $F: $PHYS. Clean white background, even studio light, no text." \
    --images "$STYLE" "docs/fabric-on-body/swatch-$F.jpg" \
    --size 1024x1024 --quality high --imageFormat jpeg \
    --save "docs/fabric-on-body/output-drop-shoulder-$F.jpg"
done

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

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

5. Prompt template

Fabric replacement for a garment style sheet.
Image 1 is the garment pattern/style reference: [品类 + 版型描述].
Image 2 is the target fabric: [面料名 + 颜色 + 光泽描述].

Re-render the exact same garment silhouette from image 1 in the fabric from image 2.

Keep the pattern identical: same [剪裁], same body length, same sleeve length,
same [领口/袖口/下摆结构], same [缝线位置], same layout and camera angle.

Replace only the material — the garment must now read as [面料名]:
[第三节表格里对应的物理特征].

Clean [背景色] background, even studio light, no text.

Correction sentence appended by issue

Issue Append to the end of the prompt
The silhouette changed too The silhouette outline must be pixel-aligned with image 1. Only surface material may differ.
Fabric color is off Sample the fabric colour from image 2 under neutral light; do not shift hue or add colour cast.
After replacement it still has the original texture Write the physical characteristics more extreme, and append The original [原面料] texture must be completely gone.
The drape is wrong Drape stiffness: [very fluid / medium / stiff]. Fold count and fold radius must match a [面料] of about [克重] gsm.
Stitching/ribbing disappeared Preserve construction details: [罗纹/明线/拉链] must remain visible in the new material.

6. Execution flow

  1. Prepare materials: layout image (clear structure, as few prints as possible) + fabric swatch close-up (weave texture must be visible).
  2. Translate material: check the table in section 3, replace the fabric name with a physical characteristic description.
  3. Write the silhouette lock sentence: cut / body length / sleeve length / neckline cuffs hem / stitching / angle, lock down each item.
  4. --quality high start, aspect ratio follows the layout image.
  5. To make a selection matrix: use the loop in section 4, one silhouette × N fabrics.
  6. Quality check: whether the silhouette contour aligns with the original image, whether the fabric color is accurate, whether the texture has actually been replaced, whether the stitching and ribbing are still there.
  7. When delivering, note that this is a visual preview, and does not represent real feel and weight.

7. Common issues

Symptom Cause Handling
The silhouette changed Contour not locked Append silhouette outline must be pixel-aligned with image 1
Fabric color is wrong Fabric image has ambient color Reshoot the fabric swatch (neutral light), or append a color extraction constraint sentence
Texture not replaced Physical characteristics written too weakly extreme description from the table in section 3 + original texture must be completely gone
drapes like cardboard drape stiffness not specified add a drape stiffness sentence and give a weight reference
ribbing/topstitching disappears swallowed by the new material add a sentence preserving structural details
the fabric and the category are physically incompatible using stiff fabric for a draped style switch to a matching fabric, or change the pattern

Tips

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