SuperAPI AI Directory

material-enhancement

General & other

View repository

Updated 10-15 22:19

About this skill

material-enhancement — optimize clothing material and detail texture

Take acommercial photo with blurry fabricand retouch it intoclear and realistic fabric, with the composition and the person completely unchanged.

This is apost-processing skill: the part of AI-generated clothing images that most easily falls apart is the fabric—it looks fine from a distance, but zoom in and the knit turns into a blurry mess. Give it a real high-definition product image as a reference, and rebuild the surface.


Generation effect examples

Input: original image (to be enhanced) Input: high-definition product image (real fabric)
source-image.jpg — worn shot of an army-green cable-knit sweater, 1024×1536 hires-product.jpg — high-definition flat-lay image of the same sweater, 800×800

Command actually executed:

dlazy gpt-image-2 \
  --prompt 'Texture enhancement pass. Image 1 is the on-model photo to improve. Image 2 is the high-resolution product photo that defines the true fabric. Rebuild the sweater surface in image 1 using the real texture from image 2: crisp cable-braid relief, visible knit loops and yarn twist, natural wool loft, correct fold shadows and a matte fibre sheen. Do not change anything else — the model face, hair, hands, pose, brown trousers, background, framing and colour grading must stay identical to image 1. The garment silhouette and colour must not shift; only the material fidelity and micro-detail improve. Photorealistic, sharp, no text, no watermark.' \
  --images docs/material-enhancement/source-image.jpg docs/material-enhancement/hires-product.jpg \
  --size 1024x1536 --quality high --imageFormat jpeg \
  --save docs/material-enhancement/example-output.jpg

Output

example-output.jpg — 1024×1536, 60 credits. The three-dimensional relief of the cable braids, the embossing of the diamond jacquard, the fuzziness of the wool, and the shadow depth in the folds are reconstructed; the model's facial features, hairstyle, hands, pose, brown trousers, gray wall background, and overall color tone remain unchanged, and the sweater's silhouette and army-green color do not shift.


1. Capability boundaries

Input Effect
Original image The commercial photo to be improved; determines composition, model, pose, background, and color tone
High-definition product image Provides real fabric information (weave, texture, fuzziness, sheen)
Clothing type Helps determine which surface features should be strengthened
Only change Do not change
Fabric surface texture, microscopic details, fold shadow depth, fiber sheen Composition, model (face/hair/hands/pose), other clothing, background, color tone, clothing silhouette and color

Do not do: do not change the clothing silhouette or color; do not change the model or background; do not replace one fabric with another (to change fabric, use fabric-on-body)。


2. Input material rules

Before generating, self-check these hard constraints:

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

Original image (✅): an image where the composition and person are both satisfactory and only the fabric is not.

High-definition product image (✅): a high-resolution flat-lay or close-up of the same product, where the weave can be seen clearly.

Notes

Situation Description
⚠️ The two images must be of the same product Two images with different fabrics will cause the material to be mismatched
⚠️ If the original image's color is already off This skill only handles texture; color deviation must be resolved at the generation stage
❌ The original image is severely broken (wrong fit, chaotic structure) Material enhancement cannot save structural problems; rerun generation
❌ The original image resolution is extremely low There is not enough information to locate where the texture should go

3. The two iron rules of material enhancement

Iron rule one: only change the surface; do not move a single pixel of anything else.

Do not change anything else — the model face, hair, hands, pose, other garments,
background, framing and colour grading must stay identical to image 1.
The garment silhouette and colour must not shift; only material fidelity
and micro-detail improve.

Iron rule two: translate "good texture" into specific surface features, otherwise the model will just apply global sharpening.

Fabric Specific features to reconstruct
Chunky knit crisp cable-braid relief, visible knit loops and yarn twist, natural wool loft, matte fibre sheen
Worsted wool fine even weave, subtle fibre halo, soft directional sheen
Satin smooth continuous specular gradients along the folds, no texture noise
Corduroy parallel wale ridges with correct pitch, matte pile catching light on the ridge tops
Denim diagonal twill lines, slub irregularity, whiskering at stress folds
Leather grain pores, broad soft creases, low-frequency specular sheen
Fleece/fuzz dense short pile, fuzzy silhouette edge, light scattering rather than specular

Add one moreFold layers:correct fold shadows with proper ambient occlusion in the creases—this is the source of "looking thick."


4. Tool invocation

This skill uses dLazy's gpt-image-2(image editing model + --quality high; material enhancement requires "zero change in geometry and color, reconstruction of high-frequency surface information," which is a typical two-image reference targeted repair).

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

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

Parameter conventions (fixed usage for this skill)

Parameter Value Reason
--images [原图, 高清商品图] The order is image 1 / 2 in the prompt
--size Same aspect ratio as the original image Enhancement should not change the composition
--quality high(Required) The output of this skill is high-frequency detail
--imageFormat jpeg General format
--batch 2 Texture reconstruction has randomness
--save docs/material-enhancement/output-<sku>-enhanced.jpg Archived separately from the original image for easy comparison

Command Examples

# basic call
dlazy gpt-image-2 \
  --prompt 'Texture enhancement pass. Image 1 is the on-model photo to improve. Image 2 is the high-resolution product photo defining the true fabric. Rebuild the garment surface in image 1 using the real texture from image 2: crisp knit relief, visible loops and yarn twist, natural loft, correct fold shadows. Do not change anything else — model, pose, background, framing and colour grading stay identical to image 1. Only material fidelity improves.' \
  --images docs/material-enhancement/source-image.jpg docs/material-enhancement/hires-product.jpg \
  --size 1024x1536 --quality high

# complex call: 批量给一组生成图做材质后处理
HIRES=docs/material-enhancement/hires-product.jpg
LOCK='Do not change anything else — the model face, hair, hands, pose, other garments, background, framing and colour grading must stay identical to image 1. The garment silhouette and colour must not shift; only material fidelity and micro-detail improve. Photorealistic, sharp, no text, no watermark.'
FEAT='crisp cable-braid relief, visible knit loops and yarn twist, natural wool loft, matte fibre sheen, correct fold shadows with proper ambient occlusion in the creases'
for f in docs/material-enhancement/raw/*.jpg; do
  dlazy gpt-image-2 \
    --prompt "Texture enhancement pass. Image 1 is the on-model photo to improve. Image 2 is the high-resolution product photo that defines the true fabric. Rebuild the garment surface in image 1 using the real texture from image 2: $FEAT. $LOCK" \
    --images "$f" "$HIRES" \
    --size 1024x1536 --quality high --imageFormat jpeg \
    --save "docs/material-enhancement/enhanced/$(basename $f)"
done

# 先估价不真跑
dlazy gpt-image-2 --dry-run --prompt '...' --images a.jpg b.jpg --size 1024x1536 --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

Texture enhancement pass.
Image 1 is the on-model photo to improve.
Image 2 is the high-resolution product photo that defines the true fabric.

Rebuild the [服装部位] surface in image 1 using the real texture from image 2:
[第三节表格里对应面料的具体特征],
correct fold shadows with proper ambient occlusion in the creases.

Do not change anything else — the model face, hair, hands, pose, other garments,
background, framing and colour grading must stay identical to image 1.
The garment silhouette and colour must not shift; only material fidelity
and micro-detail improve.

Photorealistic, sharp, no text, no watermark.

Correction sentences appended by problem

Problem Append to the end of the prompt
It just became sharper overall This is not sharpening: reconstruct the actual [织法单位] structure, loop by loop, matching image 2.
The face/background also changed Only pixels inside the garment region may change. Everything outside it must be identical to image 1.
The color was changed Preserve the exact garment colour from image 1; do not shift hue, saturation or brightness.
The texture density is wrong Match the texture scale to the garment size in image 1: about [N] knit loops per [尺寸].
Folds became flat Deepen the crease shadows with ambient occlusion; the garment must read as [厚度描述] fabric.

6. Execution workflow

  1. Confirm that the two images are the same product—this is the easiest mistake to make.
  2. Judge whether the original image is worth saving: rerun generation for structurally broken ones; use this skill only when the fabric alone is blurry.
  3. Write the fabric features: check the table in section 3, and replace "better texture" with specific features.
  4. Write the two iron rules: only change the surface + nothing else may be touched.
  5. --quality high(Required) → --batch 2 Select images, write to disk at docs/material-enhancement/。
  6. Compare the original image and the output side by side: whether the fabric was truly reconstructed (not just sharpened), whether the face and background were untouched, and whether the color is unbiased.

7. Common problems

Symptom Cause Handling
It just became sharper Structure reconstruction was not requested Append the "this is not sharpening" sentence and require stitch-by-stitch reconstruction
The face/background were also changed The region was not locked Append a sentence allowing only the clothing region to change
The color drifted The model adjusted the color along the way Append a color-preservation sentence
Texture density is wrong (coils too large/too small) No scale reference given Add a texture scale sentence
Wrinkles flattened, no thickness Missing AO description Add a sentence to deepen the dark areas of the wrinkles
Structural collapse was not fixed Beyond capability This skill only handles the surface; structural issues go back to the generation stage and are rerun

Tips

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