{"id":"ff893263-9451-49ef-a106-7a9b4d8cda31","entityType":"agent","slug":"clawhub-dlazyai-item-repair","name":"商品图精修 Item Repair","canonicalUrl":"https://www.xpersona.co/agent/clawhub-dlazyai-item-repair","canonicalPath":"/agent/clawhub-dlazyai-item-repair","generatedAt":"2026-10-10T21:55:54.324Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-10T19:27:19.107Z","emptyReason":null},"description":"商品精修、去褶皱。随手拍的商品图 → 可直接上架的精修图。当用户说「精修」「去褶皱」「修图」「拍得不好看」「整理一下」时使用。 Skill: 商品图精修 Item Repair Owner: dlazyai Summary: 商品精修、去褶皱。随手拍的商品图 → 可直接上架的精修图。当用户说「精修」「去褶皱」「修图」「拍得不好看」「整理一下」时使用。 Tags: latest:1.0.19 Version history: v1.0.19 | 2026-10-10T01:52:09.773Z | user 例行版本更新 2026-10-10 v1.0.18 | 2026-10-08T01:44:34.406Z | user 例行版本更新 2026-10-08 v1.0.17 | 2026-10-04T01:44:34.062Z | user 例行版本更新 2026-10-04 v1.0.16 | 2026-10-02T05:17:03.280Z | user 例行版本更新 2026-10-02 v1.0.15 | 2026-09-30T01:48:37.","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.3K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s170j1ymymrxasgd00dsk7tckx84cf45:item-repair","sourceUrl":"https://clawhub.ai/dlazyai/item-repair","homepage":"https://clawhub.ai/dlazyai/skills/item-repair","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/dlazyai/item-repair","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/dlazyai/skills/item-repair","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":62,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"商品精修、去褶皱。随手拍的商品图 → 可直接上架的精修图。当用户说「精修」「去褶皱」「修图」「拍得不好看」「整理一下」时使用。 Skill: 商品图精修 Item Repair Owner: dlazyai Summary: 商品精修、去褶皱。随手拍的商品图 → 可直接上架的精修图。当用户说「精修」「去褶皱」「修图」「"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T19:27:19.107Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T19:27:19.107Z","emptyReason":null},"stars":null,"forks":null,"downloads":1280,"packageName":null,"latestVersion":"1.0.19","tractionLabel":"1.3K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T19:27:19.107Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T19:27:19.107Z","lastCrawledAt":"2026-10-10T19:27:19.107Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T19:27:19.107Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.19","createdAt":"2026-10-10T01:52:09.773Z","changelog":"例行版本更新 2026-10-10","fileCount":11,"zipByteSize":25222},{"version":"1.0.18","createdAt":"2026-10-08T01:44:34.406Z","changelog":"例行版本更新 2026-10-08","fileCount":11,"zipByteSize":25109},{"version":"1.0.17","createdAt":"2026-10-04T01:44:34.062Z","changelog":"例行版本更新 2026-10-04","fileCount":11,"zipByteSize":25165},{"version":"1.0.16","createdAt":"2026-10-02T05:17:03.280Z","changelog":"例行版本更新 2026-10-02","fileCount":11,"zipByteSize":25088},{"version":"1.0.15","createdAt":"2026-09-30T01:48:37.618Z","changelog":"例行版本更新 2026-09-30","fileCount":11,"zipByteSize":25061},{"version":"1.0.14","createdAt":"2026-09-28T02:37:34.144Z","changelog":"例行版本更新 2026-09-28","fileCount":11,"zipByteSize":25082},{"version":"1.0.13","createdAt":"2026-09-24T02:39:05.546Z","changelog":"例行版本更新 2026-09-24","fileCount":11,"zipByteSize":25295},{"version":"1.0.12","createdAt":"2026-09-22T01:42:13.115Z","changelog":"例行版本更新 2026-09-22","fileCount":11,"zipByteSize":25464}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s170j1ymymrxasgd00dsk7tckx84cf45:item-repair","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-item-repair/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-item-repair/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-item-repair/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-item-repair/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-item-repair/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-item-repair/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T21:55:54.321Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-item-repair/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-item-repair/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-item-repair/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-item-repair/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-10T19:27:19.107Z","emptyReason":null},"readme":"Skill: 商品图精修 Item Repair\n\nOwner: dlazyai\n\nSummary: 商品精修、去褶皱。随手拍的商品图 → 可直接上架的精修图。当用户说「精修」「去褶皱」「修图」「拍得不好看」「整理一下」时使用。\n\nTags: latest:1.0.19\n\nVersion history:\n\nv1.0.19 | 2026-10-10T01:52:09.773Z | user\n\n例行版本更新 2026-10-10\n\nv1.0.18 | 2026-10-08T01:44:34.406Z | user\n\n例行版本更新 2026-10-08\n\nv1.0.17 | 2026-10-04T01:44:34.062Z | user\n\n例行版本更新 2026-10-04\n\nv1.0.16 | 2026-10-02T05:17:03.280Z | user\n\n例行版本更新 2026-10-02\n\nv1.0.15 | 2026-09-30T01:48:37.618Z | user\n\n例行版本更新 2026-09-30\n\nv1.0.14 | 2026-09-28T02:37:34.144Z | user\n\n例行版本更新 2026-09-28\n\nv1.0.13 | 2026-09-24T02:39:05.546Z | user\n\n例行版本更新 2026-09-24\n\nv1.0.12 | 2026-09-22T01:42:13.115Z | user\n\n例行版本更新 2026-09-22\n\nv1.0.11 | 2026-09-20T01:51:33.772Z | user\n\n例行版本更新 2026-09-20\n\nv1.0.10 | 2026-09-18T02:12:25.942Z | user\n\n例行版本更新 2026-09-18\n\nv1.0.9 | 2026-09-14T01:42:46.239Z | user\n\n例行版本更新 2026-09-14\n\nv1.0.8 | 2026-09-10T01:36:05.171Z | user\n\n例行版本更新 2026-09-10\n\nv1.0.7 | 2026-09-08T01:43:03.745Z | user\n\n例行版本更新 2026-09-08\n\nv1.0.6 | 2026-09-07T01:50:39.778Z | user\n\n例行版本更新 2026-09-07\n\nv1.0.5 | 2026-09-04T01:43:41.945Z | user\n\n例行版本更新 2026-09-04\n\nv1.0.4 | 2026-09-02T01:39:29.523Z | user\n\n例行版本更新 2026-09-02\n\nv1.0.3 | 2026-08-31T07:06:12.118Z | user\n\n源码仓库迁移至 github.com/dlazy-ai/ecommerce-skills\n\nv1.0.2 | 2026-08-31T05:27:10.640Z | user\n\n源码仓库迁移至 github.com/dlazy-ai/ecommerce-skills\n\nv1.0.1 | 2026-08-29T04:08:00.718Z | user\n\nSync from GitHub\n\nv1.0.0 | 2026-08-18T04:42:37.190Z | user\n\nSync from GitHub\n\nArchive index:\n\nArchive v1.0.19: 11 files, 25222 bytes\n\nFiles: examples/brand.yaml (1655b), references/model-flags.md (2144b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2233b), SKILL.md (11359b), _meta.json (131b)\n\nFile v1.0.19:SKILL.md\n\n---\nname: item-repair\nversion: 1.0.19\ndescription: 商品精修、去褶皱。随手拍的商品图 → 可直接上架的精修图。当用户说「精修」「去褶皱」「修图」「拍得不好看」「整理一下」时使用。\n---\n\n# item-repair — 一键提升商品图质感\n\n把**随手拍的商品图**修成**可上架的精修图**：压平褶皱、摆正对称、匀光、提纯背景。\n\n和 [material-enhancement](https://github.com/dlazy-ai/ecommerce-skills/blob/main/skills/material-enhancement/skill.md) 的分工：material-enhancement 修**面料纹理**（在模特图上），本技能修**摆放与光照**（在商品图上）。两者可以串起来用。\n\n---\n\n## 生成效果示例\n\n| 输入：原商品图 |\n| --- |\n| <img src=\"https://raw.githubusercontent.com/dlazy-ai/ecommerce-skills/main/docs/item-repair/source-flatlay.jpg\" width=\"280\"> |\n| `source-flatlay.jpg` — 军绿麻花针织毛衣平铺图（袖身有随机褶皱、左右不完全对称），800×800 |\n\n实际执行的命令（平铺图精修 + 材质增强）：\n\n```bash\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a flat-lay garment photo. Clean up this olive-green cable-knit sweater to catalog standard: press out the random wrinkles and creases in the body and sleeves, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting so there is no hot spot or colour cast. Keep the cable-knit and diamond stitch pattern, the exact olive-green colour, the ribbed collar/cuffs/hem and the woven cuff label unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text, no watermark.' \\\n  --images docs/item-repair/source-flatlay.jpg \\\n  --size 1024x1024 --quality high --imageFormat jpeg \\\n  --save docs/item-repair/example-output.jpg\n```\n\n**输出**\n\n<img src=\"https://raw.githubusercontent.com/dlazy-ai/ecommerce-skills/main/docs/item-repair/example-output.jpg\" width=\"320\">\n\n`example-output.jpg` — 1024×1024，60 credits。随机褶皱被压平、肩线方正、两只袖子长度与角度对齐、下摆罗纹平整、光照均匀无高光斑；麻花与菱形织法、军绿色、罗纹结构与右袖织标保留且比原图更清晰，背景提纯为白底带柔和接地投影。\n\n---\n\n## 1、能力边界\n\n| 模板 | 做什么 |\n| --- | --- |\n| 平铺图精修 | 摊平、左右对称、方正肩线、袖长对齐、去褶皱、匀光、纯净背景 |\n| 服装去皱 | 只压平随机褶皱与折痕，保留结构性褶（褶裥、抽绳、垂坠） |\n| 通用精修 | 去画面杂物、匀光、提纯背景、提升清晰度（非服装类目也适用） |\n| 自定义 | 自己描述要修什么 |\n\n| 附加 | 说明 |\n| --- | --- |\n| 多图输入 | 同一商品 1-4 张，模型综合多角度信息理解结构 |\n| 材质增强 | 开关；开启后表面纹理更清晰（等价于 `--quality high`） |\n\n**不做**：不改款式、颜色、图案、五金与结构；不压平结构性褶皱（褶裥、抽绳、荷叶边）；不用于把次品图修成正品图。\n\n---\n\n## 2、输入素材规则\n\n生成前先自检这几条硬性约束：\n\n- 大小：**20KB ~ 15MB**\n- 分辨率：**大于 400×400**\n- 格式：**jpg / jpeg / png / webp**\n\n**输入建议**\n\n| 做法 | 说明 |\n| --- | --- |\n| ✅ 同一商品多角度 | 1-4 张，正面 + 背面 + 细节，模型能更准地推断结构 |\n| ✅ 商品完整入画 | 出画部分只能靠编 |\n| ✅ 光线不要太杂 | 混合色温的光很难匀 |\n| ❌ 商品有明显破损/污渍 | 修图不该掩盖商品缺陷 |\n| ❌ 多个不同商品同框 | 一次只修一个商品 |\n\n---\n\n## 3、四个模板的 prompt 写法\n\n| 模板 | prompt 主体 |\n| --- | --- |\n| 平铺图精修 | `Press out the random wrinkles and creases, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting so there is no hot spot or colour cast.` |\n| 服装去皱 | `Remove only the random wrinkles and packing creases. Preserve every structural fold — pleats, gathers, drawstring ruching and intentional drape must stay exactly as they are.` |\n| 通用精修 | `Remove stray objects, dust and reflections from the frame, even out the lighting, purify the background to a clean seamless [颜色], and raise overall clarity.` |\n| 自定义 | 自己写；建议保留下面的保真句 |\n\n**保真句（四个模板都要带）**：\n\n```text\nKeep the [款式/图案/五金/结构] and the exact [颜色] unchanged and sharper than before.\n```\n\n**背景句**：`Pure white seamless background with a subtle soft contact shadow.`\n\n**去皱的关键区分**：一定要写清「结构性褶皱不许动」，否则百褶裙会被压成一片平板。\n\n---\n\n## 4、工具调用\n\n本技能使用 dLazy 的 **`gpt-image-2`**（图像编辑模型 + `--quality high`；精修要求「结构与颜色零变化、摆放与光照重整」，且支持一次传 1-4 张同商品多视角）。\n\n### 调用方式\n\n两种等价写法，选一种。统一入口会自动选后端、失败重试、建目录落盘、估算成本：\n\n```bash\n# A. 统一入口（推荐）：可切任意后端，加 --dry-run 不计费空跑\nnode scripts/gen.mjs --task item-repair \\\n  --prompt '<见下方 Prompt 模板>' \\\n  --images <按下表顺序> \\\n  --save output/item-repair-<sku>.jpg\n\n# B. 直接用 dLazy CLI（不想引入 Node 依赖时，效果等价）\ndlazy gpt-image-2 --prompt '...' --images ... --save output/item-repair.jpg\n```\n\n**参数约定（本技能固定用法）**\n\n| 参数 | 取值 | 理由 |\n| --- | --- | --- |\n| `--images` | `[图1]` ~ `[图1, 图2, 图3, 图4]`（同一商品多视角） | 对应原站「同一商品 1-4 张」 |\n| `--size` | `1024x1024`（平铺方图）/ `1024x1536`（长款竖版） | 平铺主图通常方图 |\n| `--quality` | `high`（等价「材质增强」开启） | 精修的价值在细节 |\n| `--imageFormat` | `jpeg` | 通用格式 |\n| `--batch` | `2` | 对称化结果有随机性 |\n| `--save` | `docs/item-repair/output-<sku>-retouched.jpg` | 与原图分开归档 |\n\n### Command Examples\n\n```bash\n# basic call: 平铺图精修\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a flat-lay garment photo. Press out the random wrinkles and creases, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting. Keep the pattern, colour, ribbing and label unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. No text.' \\\n  --images docs/item-repair/source-flatlay.jpg \\\n  --size 1024x1024 --quality high\n\n# complex call: 同一商品 4 个视角一起传 + 服装去皱（保留结构褶）\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a garment photo. Images 1-4 are the same product from different angles; use them together to understand the construction. Remove only the random wrinkles and packing creases from the main view. Preserve every structural fold — pleats, gathers, drawstring ruching and intentional drape must stay exactly as they are. Keep the style, colour, print placement, hardware and stitching unchanged and sharper than before. Even out the lighting with no hot spot or colour cast. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text, no watermark.' \\\n  --images docs/item-repair/v1.jpg docs/item-repair/v2.jpg docs/item-repair/v3.jpg docs/item-repair/v4.jpg \\\n  --size 1024x1024 --quality high --imageFormat jpeg \\\n  --batch 2 --save docs/item-repair/output-sku001-retouched.jpg\n\n# 批量精修仓库拍摄的平铺图\nfor f in docs/item-repair/raw/*.jpg; do\n  dlazy gpt-image-2 \\\n    --prompt 'Studio retouch of a flat-lay garment photo. Press out random wrinkles, symmetrise the silhouette, square the shoulders, align both sleeves, tidy collar and hem, even out the lighting. Keep the pattern, colour, hardware and structure unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text.' \\\n    --images \"$f\" --size 1024x1024 --quality high --imageFormat jpeg \\\n    --save \"docs/item-repair/retouched/$(basename $f)\"\ndone\n\n# 先估价不真跑\ndlazy gpt-image-2 --dry-run --prompt '...' --images a.jpg --size 1024x1024 --quality high\n```\n\n### 延伸阅读\n\n| 要查什么 | 去哪 |\n| --- | --- |\n| 认证、多后端配置、输出结构、错误码 | [`references/provider-cli.md`](references/provider-cli.md) |\n| `gpt-image-2` 的全部可用参数 | [`references/model-flags.md`](references/model-flags.md) |\n| 统一入口的全部选项 | `node scripts/gen.mjs --help` |\n\n## 5、Prompt 模板\n\n```text\nStudio retouch of a [品类] product photo.\n[多图时：Images 1-N are the same product from different angles; use them together\nto understand the construction.]\n\n[从第三节选一个模板的 prompt 主体]\n\nKeep the [款式/图案/五金/结构] and the exact [颜色] unchanged and sharper than before.\n\nPure white seamless background with a subtle soft contact shadow.\nPhotorealistic, print-ready, no text, no watermark.\n```\n\n**按问题追加的修正句**\n\n| 问题 | 追加到 prompt 末尾 |\n| --- | --- |\n| 结构褶皱被压平了 | `Do not flatten structural folds: [褶裥/抽绳/荷叶边] must remain fully three-dimensional.` |\n| 修成了另一款 | `The silhouette, seam lines and hardware positions must match the source exactly.` |\n| 背景没提纯 | `The background must be a single flat [颜色] with no gradient, texture or vignette.` |\n| 商品被磨皮 | `Preserve fabric micro-texture; do not smooth the surface into plastic.` |\n| 对称化过头、变形 | `Symmetrise only the layout, not the garment proportions.` |\n| 缺陷被抹掉了 | `Do not remove holes, stains or damage — only fix wrinkles, layout and lighting.` |\n\n---\n\n## 6、执行流程\n\n1. **选模板**（第三节）：平铺精修 / 只去皱 / 通用精修 / 自定义。\n2. **多视角就一起传**：同一商品最多 4 张，模型能更准地理解结构。\n3. **写保真句 + 背景句**；如果商品有结构性褶皱，务必加「不许压平」句。\n4. **`--quality high`** → `--batch 2` 挑图，落盘到 `docs/item-repair/`。\n5. **并排对比原图**：结构褶是否还在、五金位置是否没动、有没有被磨皮、商品缺陷有没有被不当抹除。\n6. **需要面料纹理进一步提升**时，接 [material-enhancement](https://github.com/dlazy-ai/ecommerce-skills/blob/main/skills/material-enhancement/skill.md)。\n\n---\n\n## 7、常见问题\n\n| 现象 | 原因 | 处理 |\n| --- | --- | --- |\n| 百褶/抽绳被压平 | 未区分结构褶 | 追加禁止压平结构褶句 |\n| 修成了另一个款式 | 未锁定结构 | 追加轮廓/缝线/五金位置对齐句 |\n| 表面被磨皮成塑料 | 过度平滑 | 追加保留微观纹理句；`--quality high` |\n| 背景还是有渐变 | 未要求纯色 | 追加单色背景句 |\n| 对称化把版型改窄了 | 过度对称 | 追加「只对称布局不改比例」句 |\n| 商品的破损被抹掉 | 不当修图 | 追加禁止抹除缺陷句——这条是合规红线 |\n\n---\n\n## Tips\n\nVisit https://dlazy.com for more information.\n\nFile v1.0.19:_meta.json\n\n{\n  \"ownerId\": \"kn7c5wgeajfcfvdfb5ceemvdb984cjpd\",\n  \"slug\": \"item-repair\",\n  \"version\": \"1.0.19\",\n  \"publishedAt\": 1791597129773\n}\n\nFile v1.0.19:references/model-flags.md\n\n# `gpt-image-2` 参数清单\r\n\r\n本技能默认用的模型的完整参数。日常只需要「参数约定」里那几个，\r\n这份清单在需要用到非常规参数时再看。\r\n\r\n**CRITICAL INSTRUCTION FOR AGENT**:\r\nRun the `dlazy gpt-image-2` command to get results.\r\n\r\n```bash\r\ndlazy gpt-image-2 -h\r\n\r\nOptions:\r\n  --prompt <prompt>            Prompt\r\n  --images [images...]         Images [image: url or local path] (max 5)\r\n  --size <size>                Size [default: auto] (choices: \"1024x1024\",\r\n                               \"1536x1024\", \"1024x1536\", \"2048x2048\",\r\n                               \"2048x1152\", \"3840x2160\", \"2160x3840\", \"auto\")\r\n  --imageFormat <imageFormat>  Image Format [default: jpeg] (choices: \"jpeg\",\r\n                               \"png\", \"webp\")\r\n  --quality <quality>          Quality [default: medium] (choices: \"low\",\r\n                               \"medium\", \"high\")\r\n  --dry-run                    Print payload without executing the tool\r\n  --no-wait                    Return generateId immediately for async tasks\r\n  --timeout <seconds>          Max seconds to wait for async completion\r\n                               (default: \"1800\")\r\n  --input <jsonOrFile>         Inline JSON or @path/to/file.json — merged under\r\n                               flag values (flags win)\r\n  --save <path>                Download the result asset to this local path\r\n                               (mkdir + retry handled for you). A destination\r\n                               path — NOT a response format; for stdout shape\r\n                               use --format\r\n  --batch <n>                  Fan-out N parallel runs (cloud tools only)\r\n                               (default: \"1\")\r\n  -h, --help                   display help for command\r\n```\r\n\r\n> Any flag also accepts pipe references — `-` (auto-pick from upstream stdin), `@N` (n-th output), `@N.path` (jsonpath into output), `@*` (all primary values), `@stdin` / `@stdin:path` (whole envelope). See `dlazy --help` for details.\r\n\r\n---\r\n\r\n换其他后端时参数由 `scripts/gen.mjs` 统一翻译，见 [`provider-cli.md`](provider-cli.md)。\n\nFile v1.0.19:references/provider-cli.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/provider-cli.md 同步生成，不要直接改这里。 -->\n# 后端调用参考\n\n技能正文只写「要生成什么」。认证、计费、错误码、输出结构这些每个技能都一样的东西放在这里，\n**用到时再读**，不占技能的常驻上下文。\n\n---\n\n## 一、认证\n\n### 默认后端 dLazy\n\n```bash\ndlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入\n```\n\nkey 存在用户配置目录（macOS/Linux `~/.dlazy/config.json`，Windows `%USERPROFILE%\\.dlazy\\config.json`），\n权限限本机用户。也可以每次调用用环境变量 `DLAZY_API_KEY` 传入。\n\n手动获取：登录 [dlazy.com](https://dlazy.com) → [API Key 页面](https://dlazy.com/dashboard/organization/api-key)。\nkey 按组织隔离，可随时轮换或吊销。\n\n### 其他后端\n\n本技能库不锁定单一厂商。配好任意一家的 key 即可跑：\n\n| 后端 | 环境变量 | 说明 |\n| --- | --- | --- |\n| `dlazy` | `dlazy login` 或 `DLAZY_API_KEY` | 默认，最省事 |\n| `openai` | `OPENAI_API_KEY` | 走 `/v1/images/edits` 与 `/v1/images/generations` |\n| `gemini` | `GEMINI_API_KEY` | Nano Banana 系列 |\n| `fal` | `FAL_KEY` | |\n| `replicate` | `REPLICATE_API_TOKEN` | |\n| `ark` | `ARK_API_KEY` + `ARK_MODEL` | 火山方舟，模型 ID 需按开通情况填 |\n\n选路优先级：`--provider` 参数 > `PROVIDER` 环境变量 > 第一个配了 key 的 > `dlazy`。\n\n```bash\nnode scripts/gen.mjs --doctor     # 看当前哪个后端可用\n```\n\n各后端的模型 ID 可用 `GEN_MODEL_OPENAI` / `GEN_MODEL_GEMINI` / `GEN_MODEL_FAL` /\n`GEN_MODEL_REPLICATE` / `GEN_MODEL_ARK` 覆盖。**厂商目录会变，以各家最新文档为准。**\n\n---\n\n## 二、两种调用方式\n\n### 方式 A：统一入口（推荐）\n\n```bash\nnode scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg\n```\n\n它负责：后端选路、默认尺寸档位、失败重试（429/5xx 指数退避）、落盘建目录、成本估算。\n\n```bash\nnode scripts/gen.mjs --task flat-lay --prompt '...' --dry-run   # 不调用不计费，只看要发什么\nnode scripts/gen.mjs --help\n```\n\n### 方式 B：直接用 dLazy CLI\n\n不想引入 Node 依赖时，技能正文里的 `dlazy ...` 命令可以原样执行，效果等价。\n\n```bash\nnpx @dlazy/cli@1.2.3 <command>     # 不装全局二进制\n```\n\n- CLI 源码：[github.com/dlazy-ai/cli](https://github.com/dlazy-ai/cli) · npm 包 `@dlazy/cli`\n\n---\n\n## 三、数据流向\n\n调用 dLazy 时：提示词与参数发往 `api.dlazy.com`；传入的本地图片会上传到 `files.dlazy.com`\n供模型读取；产出 URL 同样托管在 `files.dlazy.com`。这是云端生成 API 的通用形态。\n换成其他后端时，数据流向对应厂商，不经过 dLazy。\n\n---\n\n## 四、输出结构\n\n`gen.mjs`（加 `--json`）：\n\n```json\n{\n  \"ok\": true,\n  \"task\": \"flat-lay\",\n  \"provider\": \"dlazy\",\n  \"model\": \"gpt-image-2\",\n  \"files\": [\"docs/flat-lay/output-sku001.jpg\"],\n  \"texts\": [],\n  \"estimatedCredits\": 60,\n  \"elapsedMs\": 58213\n}\n```\n\ndLazy CLI 原生：\n\n```json\n{\n  \"ok\": true,\n  \"result\": {\n    \"tool\": \"gpt-image-2\",\n    \"data\": { \"urls\": [\"https://files.dlazy.com/data/ai/....jpg\"] },\n    \"savedPath\": \"docs/flat-lay/example-output.jpg\"\n  }\n}\n```\n\n加 `--no-wait` 的异步任务不返回 `data`，返回 `task: { generateId, status }`，\n用 `dlazy status <generateId> --wait` 轮询。\n\n文本类模型（如质检）产出在 `result.data.texts[0]`：\n\n```bash\ndlazy claude-sonnet-5 --prompt '...' --images x.jpg \\\n  | python3 -c 'import sys,json;print(json.load(sys.stdin)[\"result\"][\"data\"][\"texts\"][0])'\n```\n\n---\n\n## 五、错误处理\n\n| Code | 类型 | 示例 |\n| --- | --- | --- |\n| 401 | 未授权 / 无 key | `ok: false, code: \"unauthorized\"` |\n| 501 | 缺必填参数 | `error: required option '--prompt <prompt>' not specified` |\n| 502 | 本地文件读不到 | `Error: Image file not found: ...` |\n| 503 | 余额不足 | `ok: false, code: \"insufficient_balance\"` |\n| 503 | 服务端错误 | `HTTP status code error (500)` |\n| 504 | 异步任务失败 | `=== Generation Failed ===` / `Prompt violates safety policy` |\n\n**给 Agent 的硬性要求**\n\n1. 命中 `insufficient_balance` → 明确告诉用户算力不足，并给出充值入口\n   <https://dlazy.com/dashboard/organization/settings?tab=credits>\n2. 命中 `unauthorized` / 缺 key → 告诉用户去 <https://dlazy.com/dashboard/organization/api-key>\n   取 key，用 `dlazy auth set <key>` 存好再继续。\n3. 用 `gen.mjs` 时，429 与 5xx 已自动重试；仍失败才向用户报错。\n4. **不要**为了「跑通」而偷偷降级参数（尺寸、档位、批量），先问用户。\n\nFile v1.0.19:scripts/lib/tasks.json\n\n{\r\n  \"_note\": \"技能 → 默认模型与参数。dlazy 列为默认后端的模型名；其他后端走 providers.mjs 的通用映射，可用 GEN_MODEL_<PROVIDER> 覆盖。\",\r\n  \"_credits\": { \"gpt-image-2\": 60, \"seedream-5.0\": 30, \"seedream-5.0-pro\": 45, \"banana-pro\": 25, \"claude-sonnet-5\": 3 },\r\n  \"tasks\": {\r\n    \"flat-lay\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"wear-everything\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"image-fusion\":            { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"one-shot\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"fission-pattern\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-detail\":             { \"model\": \"seedream-5.0-pro\", \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"creative-scene\":          { \"model\": \"banana-pro\",       \"size\": \"1024x1536\", \"format\": \"jpeg\" },\r\n    \"batch-image\":             { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"to-3d\":                   { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-extraction\":     { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"fabric-on-body\":          { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-detail\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-grass-planting\": { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-selling-point\":      { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"item-change-background\":  { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"remove-watermark\":        { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"material-enhancement\":    { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"item-repair\":             { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"detect-task\":             { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"listing-optimizer\":       { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"cross-border-localize\":   { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"brand-kit\":               { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"platform-compliance\":     { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"main-image-video\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"product-video-ad\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"ugc-testimonial\":         { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true }\r\n  }\r\n}\n\nFile v1.0.19:skill-card.md\n\n## Description:\n\nHelps turn casual product photos into catalog-ready images by removing incidental wrinkles, improving alignment and lighting, and cleaning up backgrounds while preserving product details.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[dlazyai](https://clawhub.ai/user/dlazyai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nE-commerce sellers and catalog teams use this skill to retouch photos of a single product for listings, including garment flat lays, while preserving design details and visible defects.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The bundled runner has broader cloud-generation and remote-image fetching capabilities than product retouching requires; private photos and prompts may leave the user's environment.\n\nMitigation: Review before installing, use only an approved cloud provider with the necessary credentials, prefer local image files over arbitrary URLs, and preview requests with dry-run before submitting sensitive assets.\n\nRisk: Retouching may alter product construction or conceal visible flaws, misleading shoppers.\n\nMitigation: Compare results with source photos; preserve structural folds, color, hardware, and visible damage, and reject edits that hide defects.\n\n## Reference(s):\n\n- [Item Repair release on ClawHub](https://clawhub.ai/dlazyai/skills/item-repair)\n- [Image model options](references/model-flags.md)\n- [Provider and output reference](references/provider-cli.md)\n\n## Skill Output:\n\n**Output Type(s):** [Guidance, Shell commands, Image files]\n\n**Output Format:** [Markdown guidance and command examples; generated JPEG, PNG, or WebP images when executed]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Accepts one to four views of the same product; supports a dry-run preview and comparison against original images.]\n\n## Skill Version(s):\n\n1.0.19 (source: skill frontmatter and ClawHub release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.19:examples/brand.yaml\n\n# ⚠️ 由 scripts/build-skills.mjs 从 shared/examples/brand.yaml 同步生成，不要直接改这里。\r\n# 店铺品牌视觉规范 —— 所有生图技能读这一份，保证几百个 SKU 看起来像同一家店。\r\n#   node scripts/brand.mjs --brand brand.yaml --for flat-lay\r\n#   node scripts/gen.mjs --task flat-lay --brand brand.yaml --prompt '...'\r\n\r\nbrand:\r\n  name: 示例品牌\r\n  # 一句话概括调性，会原样进 prompt\r\n  tone: quiet minimalist, warm and lived-in, never glossy or commercial\r\n\r\nmodel:\r\n  # 锁模特：给一张脸的参考图，所有技能都会把它作为最后一张参考图传入\r\n  reference: assets/model/face-a.jpg\r\n  description: East Asian woman, late twenties, natural makeup, shoulder-length black hair\r\n  body: slim, height around 168cm\r\n\r\nphotography:\r\n  background: seamless off-white studio backdrop, RGB 248 248 246\r\n  lighting: soft large softbox from camera left, gentle fill, no hard shadows\r\n  camera: 85mm equivalent, eye level, shallow depth of field\r\n  grade: neutral white balance around 5200K, low contrast, slightly lifted blacks\r\n  crop: full body with headroom, product centered\r\n\r\nlayout:\r\n  # 给带排版的技能（主图 / 详情页）用\r\n  margin: at least 8% empty margin on all sides\r\n  typeface: clean sans-serif, no decorative fonts\r\n  text_color: near-black on light background\r\n\r\nforbid:\r\n  - no visible brand logos other than the product's own\r\n  - no text or watermark\r\n  - no exaggerated poses or dramatic wind effects\r\n  - no oversaturated colors\r\n\r\n# 可选：把这些直接写进合规目标，生成时就按平台要求出图\r\ncompliance:\r\n  platform: amazon\n\nArchive v1.0.18: 11 files, 25109 bytes\n\nFiles: examples/brand.yaml (1655b), references/model-flags.md (2144b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2057b), SKILL.md (11359b), _meta.json (131b)\n\nFile v1.0.18:SKILL.md\n\n---\nname: item-repair\nversion: 1.0.18\ndescription: 商品精修、去褶皱。随手拍的商品图 → 可直接上架的精修图。当用户说「精修」「去褶皱」「修图」「拍得不好看」「整理一下」时使用。\n---\n\n# item-repair — 一键提升商品图质感\n\n把**随手拍的商品图**修成**可上架的精修图**：压平褶皱、摆正对称、匀光、提纯背景。\n\n和 [material-enhancement](https://github.com/dlazy-ai/ecommerce-skills/blob/main/skills/material-enhancement/skill.md) 的分工：material-enhancement 修**面料纹理**（在模特图上），本技能修**摆放与光照**（在商品图上）。两者可以串起来用。\n\n---\n\n## 生成效果示例\n\n| 输入：原商品图 |\n| --- |\n| <img src=\"https://raw.githubusercontent.com/dlazy-ai/ecommerce-skills/main/docs/item-repair/source-flatlay.jpg\" width=\"280\"> |\n| `source-flatlay.jpg` — 军绿麻花针织毛衣平铺图（袖身有随机褶皱、左右不完全对称），800×800 |\n\n实际执行的命令（平铺图精修 + 材质增强）：\n\n```bash\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a flat-lay garment photo. Clean up this olive-green cable-knit sweater to catalog standard: press out the random wrinkles and creases in the body and sleeves, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting so there is no hot spot or colour cast. Keep the cable-knit and diamond stitch pattern, the exact olive-green colour, the ribbed collar/cuffs/hem and the woven cuff label unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text, no watermark.' \\\n  --images docs/item-repair/source-flatlay.jpg \\\n  --size 1024x1024 --quality high --imageFormat jpeg \\\n  --save docs/item-repair/example-output.jpg\n```\n\n**输出**\n\n<img src=\"https://raw.githubusercontent.com/dlazy-ai/ecommerce-skills/main/docs/item-repair/example-output.jpg\" width=\"320\">\n\n`example-output.jpg` — 1024×1024，60 credits。随机褶皱被压平、肩线方正、两只袖子长度与角度对齐、下摆罗纹平整、光照均匀无高光斑；麻花与菱形织法、军绿色、罗纹结构与右袖织标保留且比原图更清晰，背景提纯为白底带柔和接地投影。\n\n---\n\n## 1、能力边界\n\n| 模板 | 做什么 |\n| --- | --- |\n| 平铺图精修 | 摊平、左右对称、方正肩线、袖长对齐、去褶皱、匀光、纯净背景 |\n| 服装去皱 | 只压平随机褶皱与折痕，保留结构性褶（褶裥、抽绳、垂坠） |\n| 通用精修 | 去画面杂物、匀光、提纯背景、提升清晰度（非服装类目也适用） |\n| 自定义 | 自己描述要修什么 |\n\n| 附加 | 说明 |\n| --- | --- |\n| 多图输入 | 同一商品 1-4 张，模型综合多角度信息理解结构 |\n| 材质增强 | 开关；开启后表面纹理更清晰（等价于 `--quality high`） |\n\n**不做**：不改款式、颜色、图案、五金与结构；不压平结构性褶皱（褶裥、抽绳、荷叶边）；不用于把次品图修成正品图。\n\n---\n\n## 2、输入素材规则\n\n生成前先自检这几条硬性约束：\n\n- 大小：**20KB ~ 15MB**\n- 分辨率：**大于 400×400**\n- 格式：**jpg / jpeg / png / webp**\n\n**输入建议**\n\n| 做法 | 说明 |\n| --- | --- |\n| ✅ 同一商品多角度 | 1-4 张，正面 + 背面 + 细节，模型能更准地推断结构 |\n| ✅ 商品完整入画 | 出画部分只能靠编 |\n| ✅ 光线不要太杂 | 混合色温的光很难匀 |\n| ❌ 商品有明显破损/污渍 | 修图不该掩盖商品缺陷 |\n| ❌ 多个不同商品同框 | 一次只修一个商品 |\n\n---\n\n## 3、四个模板的 prompt 写法\n\n| 模板 | prompt 主体 |\n| --- | --- |\n| 平铺图精修 | `Press out the random wrinkles and creases, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting so there is no hot spot or colour cast.` |\n| 服装去皱 | `Remove only the random wrinkles and packing creases. Preserve every structural fold — pleats, gathers, drawstring ruching and intentional drape must stay exactly as they are.` |\n| 通用精修 | `Remove stray objects, dust and reflections from the frame, even out the lighting, purify the background to a clean seamless [颜色], and raise overall clarity.` |\n| 自定义 | 自己写；建议保留下面的保真句 |\n\n**保真句（四个模板都要带）**：\n\n```text\nKeep the [款式/图案/五金/结构] and the exact [颜色] unchanged and sharper than before.\n```\n\n**背景句**：`Pure white seamless background with a subtle soft contact shadow.`\n\n**去皱的关键区分**：一定要写清「结构性褶皱不许动」，否则百褶裙会被压成一片平板。\n\n---\n\n## 4、工具调用\n\n本技能使用 dLazy 的 **`gpt-image-2`**（图像编辑模型 + `--quality high`；精修要求「结构与颜色零变化、摆放与光照重整」，且支持一次传 1-4 张同商品多视角）。\n\n### 调用方式\n\n两种等价写法，选一种。统一入口会自动选后端、失败重试、建目录落盘、估算成本：\n\n```bash\n# A. 统一入口（推荐）：可切任意后端，加 --dry-run 不计费空跑\nnode scripts/gen.mjs --task item-repair \\\n  --prompt '<见下方 Prompt 模板>' \\\n  --images <按下表顺序> \\\n  --save output/item-repair-<sku>.jpg\n\n# B. 直接用 dLazy CLI（不想引入 Node 依赖时，效果等价）\ndlazy gpt-image-2 --prompt '...' --images ... --save output/item-repair.jpg\n```\n\n**参数约定（本技能固定用法）**\n\n| 参数 | 取值 | 理由 |\n| --- | --- | --- |\n| `--images` | `[图1]` ~ `[图1, 图2, 图3, 图4]`（同一商品多视角） | 对应原站「同一商品 1-4 张」 |\n| `--size` | `1024x1024`（平铺方图）/ `1024x1536`（长款竖版） | 平铺主图通常方图 |\n| `--quality` | `high`（等价「材质增强」开启） | 精修的价值在细节 |\n| `--imageFormat` | `jpeg` | 通用格式 |\n| `--batch` | `2` | 对称化结果有随机性 |\n| `--save` | `docs/item-repair/output-<sku>-retouched.jpg` | 与原图分开归档 |\n\n### Command Examples\n\n```bash\n# basic call: 平铺图精修\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a flat-lay garment photo. Press out the random wrinkles and creases, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting. Keep the pattern, colour, ribbing and label unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. No text.' \\\n  --images docs/item-repair/source-flatlay.jpg \\\n  --size 1024x1024 --quality high\n\n# complex call: 同一商品 4 个视角一起传 + 服装去皱（保留结构褶）\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a garment photo. Images 1-4 are the same product from different angles; use them together to understand the construction. Remove only the random wrinkles and packing creases from the main view. Preserve every structural fold — pleats, gathers, drawstring ruching and intentional drape must stay exactly as they are. Keep the style, colour, print placement, hardware and stitching unchanged and sharper than before. Even out the lighting with no hot spot or colour cast. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text, no watermark.' \\\n  --images docs/item-repair/v1.jpg docs/item-repair/v2.jpg docs/item-repair/v3.jpg docs/item-repair/v4.jpg \\\n  --size 1024x1024 --quality high --imageFormat jpeg \\\n  --batch 2 --save docs/item-repair/output-sku001-retouched.jpg\n\n# 批量精修仓库拍摄的平铺图\nfor f in docs/item-repair/raw/*.jpg; do\n  dlazy gpt-image-2 \\\n    --prompt 'Studio retouch of a flat-lay garment photo. Press out random wrinkles, symmetrise the silhouette, square the shoulders, align both sleeves, tidy collar and hem, even out the lighting. Keep the pattern, colour, hardware and structure unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text.' \\\n    --images \"$f\" --size 1024x1024 --quality high --imageFormat jpeg \\\n    --save \"docs/item-repair/retouched/$(basename $f)\"\ndone\n\n# 先估价不真跑\ndlazy gpt-image-2 --dry-run --prompt '...' --images a.jpg --size 1024x1024 --quality high\n```\n\n### 延伸阅读\n\n| 要查什么 | 去哪 |\n| --- | --- |\n| 认证、多后端配置、输出结构、错误码 | [`references/provider-cli.md`](references/provider-cli.md) |\n| `gpt-image-2` 的全部可用参数 | [`references/model-flags.md`](references/model-flags.md) |\n| 统一入口的全部选项 | `node scripts/gen.mjs --help` |\n\n## 5、Prompt 模板\n\n```text\nStudio retouch of a [品类] product photo.\n[多图时：Images 1-N are the same product from different angles; use them together\nto understand the construction.]\n\n[从第三节选一个模板的 prompt 主体]\n\nKeep the [款式/图案/五金/结构] and the exact [颜色] unchanged and sharper than before.\n\nPure white seamless background with a subtle soft contact shadow.\nPhotorealistic, print-ready, no text, no watermark.\n```\n\n**按问题追加的修正句**\n\n| 问题 | 追加到 prompt 末尾 |\n| --- | --- |\n| 结构褶皱被压平了 | `Do not flatten structural folds: [褶裥/抽绳/荷叶边] must remain fully three-dimensional.` |\n| 修成了另一款 | `The silhouette, seam lines and hardware positions must match the source exactly.` |\n| 背景没提纯 | `The background must be a single flat [颜色] with no gradient, texture or vignette.` |\n| 商品被磨皮 | `Preserve fabric micro-texture; do not smooth the surface into plastic.` |\n| 对称化过头、变形 | `Symmetrise only the layout, not the garment proportions.` |\n| 缺陷被抹掉了 | `Do not remove holes, stains or damage — only fix wrinkles, layout and lighting.` |\n\n---\n\n## 6、执行流程\n\n1. **选模板**（第三节）：平铺精修 / 只去皱 / 通用精修 / 自定义。\n2. **多视角就一起传**：同一商品最多 4 张，模型能更准地理解结构。\n3. **写保真句 + 背景句**；如果商品有结构性褶皱，务必加「不许压平」句。\n4. **`--quality high`** → `--batch 2` 挑图，落盘到 `docs/item-repair/`。\n5. **并排对比原图**：结构褶是否还在、五金位置是否没动、有没有被磨皮、商品缺陷有没有被不当抹除。\n6. **需要面料纹理进一步提升**时，接 [material-enhancement](https://github.com/dlazy-ai/ecommerce-skills/blob/main/skills/material-enhancement/skill.md)。\n\n---\n\n## 7、常见问题\n\n| 现象 | 原因 | 处理 |\n| --- | --- | --- |\n| 百褶/抽绳被压平 | 未区分结构褶 | 追加禁止压平结构褶句 |\n| 修成了另一个款式 | 未锁定结构 | 追加轮廓/缝线/五金位置对齐句 |\n| 表面被磨皮成塑料 | 过度平滑 | 追加保留微观纹理句；`--quality high` |\n| 背景还是有渐变 | 未要求纯色 | 追加单色背景句 |\n| 对称化把版型改窄了 | 过度对称 | 追加「只对称布局不改比例」句 |\n| 商品的破损被抹掉 | 不当修图 | 追加禁止抹除缺陷句——这条是合规红线 |\n\n---\n\n## Tips\n\nVisit https://dlazy.com for more information.\n\nFile v1.0.18:_meta.json\n\n{\n  \"ownerId\": \"kn7c5wgeajfcfvdfb5ceemvdb984cjpd\",\n  \"slug\": \"item-repair\",\n  \"version\": \"1.0.18\",\n  \"publishedAt\": 1791423874406\n}\n\nFile v1.0.18:references/model-flags.md\n\n# `gpt-image-2` 参数清单\r\n\r\n本技能默认用的模型的完整参数。日常只需要「参数约定」里那几个，\r\n这份清单在需要用到非常规参数时再看。\r\n\r\n**CRITICAL INSTRUCTION FOR AGENT**:\r\nRun the `dlazy gpt-image-2` command to get results.\r\n\r\n```bash\r\ndlazy gpt-image-2 -h\r\n\r\nOptions:\r\n  --prompt <prompt>            Prompt\r\n  --images [images...]         Images [image: url or local path] (max 5)\r\n  --size <size>                Size [default: auto] (choices: \"1024x1024\",\r\n                               \"1536x1024\", \"1024x1536\", \"2048x2048\",\r\n                               \"2048x1152\", \"3840x2160\", \"2160x3840\", \"auto\")\r\n  --imageFormat <imageFormat>  Image Format [default: jpeg] (choices: \"jpeg\",\r\n                               \"png\", \"webp\")\r\n  --quality <quality>          Quality [default: medium] (choices: \"low\",\r\n                               \"medium\", \"high\")\r\n  --dry-run                    Print payload without executing the tool\r\n  --no-wait                    Return generateId immediately for async tasks\r\n  --timeout <seconds>          Max seconds to wait for async completion\r\n                               (default: \"1800\")\r\n  --input <jsonOrFile>         Inline JSON or @path/to/file.json — merged under\r\n                               flag values (flags win)\r\n  --save <path>                Download the result asset to this local path\r\n                               (mkdir + retry handled for you). A destination\r\n                               path — NOT a response format; for stdout shape\r\n                               use --format\r\n  --batch <n>                  Fan-out N parallel runs (cloud tools only)\r\n                               (default: \"1\")\r\n  -h, --help                   display help for command\r\n```\r\n\r\n> Any flag also accepts pipe references — `-` (auto-pick from upstream stdin), `@N` (n-th output), `@N.path` (jsonpath into output), `@*` (all primary values), `@stdin` / `@stdin:path` (whole envelope). See `dlazy --help` for details.\r\n\r\n---\r\n\r\n换其他后端时参数由 `scripts/gen.mjs` 统一翻译，见 [`provider-cli.md`](provider-cli.md)。\n\nFile v1.0.18:references/provider-cli.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/provider-cli.md 同步生成，不要直接改这里。 -->\n# 后端调用参考\n\n技能正文只写「要生成什么」。认证、计费、错误码、输出结构这些每个技能都一样的东西放在这里，\n**用到时再读**，不占技能的常驻上下文。\n\n---\n\n## 一、认证\n\n### 默认后端 dLazy\n\n```bash\ndlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入\n```\n\nkey 存在用户配置目录（macOS/Linux `~/.dlazy/config.json`，Windows `%USERPROFILE%\\.dlazy\\config.json`），\n权限限本机用户。也可以每次调用用环境变量 `DLAZY_API_KEY` 传入。\n\n手动获取：登录 [dlazy.com](https://dlazy.com) → [API Key 页面](https://dlazy.com/dashboard/organization/api-key)。\nkey 按组织隔离，可随时轮换或吊销。\n\n### 其他后端\n\n本技能库不锁定单一厂商。配好任意一家的 key 即可跑：\n\n| 后端 | 环境变量 | 说明 |\n| --- | --- | --- |\n| `dlazy` | `dlazy login` 或 `DLAZY_API_KEY` | 默认，最省事 |\n| `openai` | `OPENAI_API_KEY` | 走 `/v1/images/edits` 与 `/v1/images/generations` |\n| `gemini` | `GEMINI_API_KEY` | Nano Banana 系列 |\n| `fal` | `FAL_KEY` | |\n| `replicate` | `REPLICATE_API_TOKEN` | |\n| `ark` | `ARK_API_KEY` + `ARK_MODEL` | 火山方舟，模型 ID 需按开通情况填 |\n\n选路优先级：`--provider` 参数 > `PROVIDER` 环境变量 > 第一个配了 key 的 > `dlazy`。\n\n```bash\nnode scripts/gen.mjs --doctor     # 看当前哪个后端可用\n```\n\n各后端的模型 ID 可用 `GEN_MODEL_OPENAI` / `GEN_MODEL_GEMINI` / `GEN_MODEL_FAL` /\n`GEN_MODEL_REPLICATE` / `GEN_MODEL_ARK` 覆盖。**厂商目录会变，以各家最新文档为准。**\n\n---\n\n## 二、两种调用方式\n\n### 方式 A：统一入口（推荐）\n\n```bash\nnode scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg\n```\n\n它负责：后端选路、默认尺寸档位、失败重试（429/5xx 指数退避）、落盘建目录、成本估算。\n\n```bash\nnode scripts/gen.mjs --task flat-lay --prompt '...' --dry-run   # 不调用不计费，只看要发什么\nnode scripts/gen.mjs --help\n```\n\n### 方式 B：直接用 dLazy CLI\n\n不想引入 Node 依赖时，技能正文里的 `dlazy ...` 命令可以原样执行，效果等价。\n\n```bash\nnpx @dlazy/cli@1.2.3 <command>     # 不装全局二进制\n```\n\n- CLI 源码：[github.com/dlazy-ai/cli](https://github.com/dlazy-ai/cli) · npm 包 `@dlazy/cli`\n\n---\n\n## 三、数据流向\n\n调用 dLazy 时：提示词与参数发往 `api.dlazy.com`；传入的本地图片会上传到 `files.dlazy.com`\n供模型读取；产出 URL 同样托管在 `files.dlazy.com`。这是云端生成 API 的通用形态。\n换成其他后端时，数据流向对应厂商，不经过 dLazy。\n\n---\n\n## 四、输出结构\n\n`gen.mjs`（加 `--json`）：\n\n```json\n{\n  \"ok\": true,\n  \"task\": \"flat-lay\",\n  \"provider\": \"dlazy\",\n  \"model\": \"gpt-image-2\",\n  \"files\": [\"docs/flat-lay/output-sku001.jpg\"],\n  \"texts\": [],\n  \"estimatedCredits\": 60,\n  \"elapsedMs\": 58213\n}\n```\n\ndLazy CLI 原生：\n\n```json\n{\n  \"ok\": true,\n  \"result\": {\n    \"tool\": \"gpt-image-2\",\n    \"data\": { \"urls\": [\"https://files.dlazy.com/data/ai/....jpg\"] },\n    \"savedPath\": \"docs/flat-lay/example-output.jpg\"\n  }\n}\n```\n\n加 `--no-wait` 的异步任务不返回 `data`，返回 `task: { generateId, status }`，\n用 `dlazy status <generateId> --wait` 轮询。\n\n文本类模型（如质检）产出在 `result.data.texts[0]`：\n\n```bash\ndlazy claude-sonnet-5 --prompt '...' --images x.jpg \\\n  | python3 -c 'import sys,json;print(json.load(sys.stdin)[\"result\"][\"data\"][\"texts\"][0])'\n```\n\n---\n\n## 五、错误处理\n\n| Code | 类型 | 示例 |\n| --- | --- | --- |\n| 401 | 未授权 / 无 key | `ok: false, code: \"unauthorized\"` |\n| 501 | 缺必填参数 | `error: required option '--prompt <prompt>' not specified` |\n| 502 | 本地文件读不到 | `Error: Image file not found: ...` |\n| 503 | 余额不足 | `ok: false, code: \"insufficient_balance\"` |\n| 503 | 服务端错误 | `HTTP status code error (500)` |\n| 504 | 异步任务失败 | `=== Generation Failed ===` / `Prompt violates safety policy` |\n\n**给 Agent 的硬性要求**\n\n1. 命中 `insufficient_balance` → 明确告诉用户算力不足，并给出充值入口\n   <https://dlazy.com/dashboard/organization/settings?tab=credits>\n2. 命中 `unauthorized` / 缺 key → 告诉用户去 <https://dlazy.com/dashboard/organization/api-key>\n   取 key，用 `dlazy auth set <key>` 存好再继续。\n3. 用 `gen.mjs` 时，429 与 5xx 已自动重试；仍失败才向用户报错。\n4. **不要**为了「跑通」而偷偷降级参数（尺寸、档位、批量），先问用户。\n\nFile v1.0.18:scripts/lib/tasks.json\n\n{\r\n  \"_note\": \"技能 → 默认模型与参数。dlazy 列为默认后端的模型名；其他后端走 providers.mjs 的通用映射，可用 GEN_MODEL_<PROVIDER> 覆盖。\",\r\n  \"_credits\": { \"gpt-image-2\": 60, \"seedream-5.0\": 30, \"seedream-5.0-pro\": 45, \"banana-pro\": 25, \"claude-sonnet-5\": 3 },\r\n  \"tasks\": {\r\n    \"flat-lay\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"wear-everything\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"image-fusion\":            { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"one-shot\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"fission-pattern\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-detail\":             { \"model\": \"seedream-5.0-pro\", \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"creative-scene\":          { \"model\": \"banana-pro\",       \"size\": \"1024x1536\", \"format\": \"jpeg\" },\r\n    \"batch-image\":             { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"to-3d\":                   { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-extraction\":     { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"fabric-on-body\":          { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-detail\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-grass-planting\": { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-selling-point\":      { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"item-change-background\":  { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"remove-watermark\":        { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"material-enhancement\":    { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"item-repair\":             { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"detect-task\":             { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"listing-optimizer\":       { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"cross-border-localize\":   { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"brand-kit\":               { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"platform-compliance\":     { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"main-image-video\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"product-video-ad\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"ugc-testimonial\":         { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true }\r\n  }\r\n}\n\nFile v1.0.18:skill-card.md\n\n## Description:\n\nHelps retouch product photos for listings by reducing incidental wrinkles, correcting layout and lighting, and cleaning backgrounds while preserving product details.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[dlazyai](https://clawhub.ai/user/dlazyai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nMerchants and creative teams use the skill to prepare product photos for listings, removing incidental wrinkles and distractions without changing the product's design or concealing defects.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Product photos and prompts may be sent to the selected cloud image provider.\n\nMitigation: Use --dry-run to review requests and send private images only when the provider's handling is acceptable.\n\nRisk: Broad retouching requests may trigger an unwanted image-editing call.\n\nMitigation: Confirm ambiguous requests before invoking the skill.\n\nRisk: Retouching may inadvertently alter structural details or hide product defects.\n\nMitigation: Require preservation of design and genuine defects, then compare edited images against the originals.\n\n## Reference(s):\n\n- [ClawHub skill listing](https://clawhub.ai/dlazyai/skills/item-repair)\n- [Provider setup and output reference](references/provider-cli.md)\n- [Image model options](references/model-flags.md)\n\n## Skill Output:\n\n**Output Type(s):** [Image files, Shell commands, Guidance]\n\n**Output Format:** [JPEG product images with text instructions and optional JSON results]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Supports one to four views of the same product; compare results with originals before publication.]\n\n## Skill Version(s):\n\n1.0.18 (source: skill frontmatter and server release)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.18:examples/brand.yaml\n\n# ⚠️ 由 scripts/build-skills.mjs 从 shared/examples/brand.yaml 同步生成，不要直接改这里。\r\n# 店铺品牌视觉规范 —— 所有生图技能读这一份，保证几百个 SKU 看起来像同一家店。\r\n#   node scripts/brand.mjs --brand brand.yaml --for flat-lay\r\n#   node scripts/gen.mjs --task flat-lay --brand brand.yaml --prompt '...'\r\n\r\nbrand:\r\n  name: 示例品牌\r\n  # 一句话概括调性，会原样进 prompt\r\n  tone: quiet minimalist, warm and lived-in, never glossy or commercial\r\n\r\nmodel:\r\n  # 锁模特：给一张脸的参考图，所有技能都会把它作为最后一张参考图传入\r\n  reference: assets/model/face-a.jpg\r\n  description: East Asian woman, late twenties, natural makeup, shoulder-length black hair\r\n  body: slim, height around 168cm\r\n\r\nphotography:\r\n  background: seamless off-white studio backdrop, RGB 248 248 246\r\n  lighting: soft large softbox from camera left, gentle fill, no hard shadows\r\n  camera: 85mm equivalent, eye level, shallow depth of field\r\n  grade: neutral white balance around 5200K, low contrast, slightly lifted blacks\r\n  crop: full body with headroom, product centered\r\n\r\nlayout:\r\n  # 给带排版的技能（主图 / 详情页）用\r\n  margin: at least 8% empty margin on all sides\r\n  typeface: clean sans-serif, no decorative fonts\r\n  text_color: near-black on light background\r\n\r\nforbid:\r\n  - no visible brand logos other than the product's own\r\n  - no text or watermark\r\n  - no exaggerated poses or dramatic wind effects\r\n  - no oversaturated colors\r\n\r\n# 可选：把这些直接写进合规目标，生成时就按平台要求出图\r\ncompliance:\r\n  platform: amazon\n\nArchive v1.0.17: 11 files, 25165 bytes\n\nFiles: examples/brand.yaml (1655b), references/model-flags.md (2144b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2194b), SKILL.md (11359b), _meta.json (131b)\n\nFile v1.0.17:SKILL.md\n\n---\nname: item-repair\nversion: 1.0.17\ndescription: 商品精修、去褶皱。随手拍的商品图 → 可直接上架的精修图。当用户说「精修」「去褶皱」「修图」「拍得不好看」「整理一下」时使用。\n---\n\n# item-repair — 一键提升商品图质感\n\n把**随手拍的商品图**修成**可上架的精修图**：压平褶皱、摆正对称、匀光、提纯背景。\n\n和 [material-enhancement](https://github.com/dlazy-ai/ecommerce-skills/blob/main/skills/material-enhancement/skill.md) 的分工：material-enhancement 修**面料纹理**（在模特图上），本技能修**摆放与光照**（在商品图上）。两者可以串起来用。\n\n---\n\n## 生成效果示例\n\n| 输入：原商品图 |\n| --- |\n| <img src=\"https://raw.githubusercontent.com/dlazy-ai/ecommerce-skills/main/docs/item-repair/source-flatlay.jpg\" width=\"280\"> |\n| `source-flatlay.jpg` — 军绿麻花针织毛衣平铺图（袖身有随机褶皱、左右不完全对称），800×800 |\n\n实际执行的命令（平铺图精修 + 材质增强）：\n\n```bash\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a flat-lay garment photo. Clean up this olive-green cable-knit sweater to catalog standard: press out the random wrinkles and creases in the body and sleeves, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting so there is no hot spot or colour cast. Keep the cable-knit and diamond stitch pattern, the exact olive-green colour, the ribbed collar/cuffs/hem and the woven cuff label unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text, no watermark.' \\\n  --images docs/item-repair/source-flatlay.jpg \\\n  --size 1024x1024 --quality high --imageFormat jpeg \\\n  --save docs/item-repair/example-output.jpg\n```\n\n**输出**\n\n<img src=\"https://raw.githubusercontent.com/dlazy-ai/ecommerce-skills/main/docs/item-repair/example-output.jpg\" width=\"320\">\n\n`example-output.jpg` — 1024×1024，60 credits。随机褶皱被压平、肩线方正、两只袖子长度与角度对齐、下摆罗纹平整、光照均匀无高光斑；麻花与菱形织法、军绿色、罗纹结构与右袖织标保留且比原图更清晰，背景提纯为白底带柔和接地投影。\n\n---\n\n## 1、能力边界\n\n| 模板 | 做什么 |\n| --- | --- |\n| 平铺图精修 | 摊平、左右对称、方正肩线、袖长对齐、去褶皱、匀光、纯净背景 |\n| 服装去皱 | 只压平随机褶皱与折痕，保留结构性褶（褶裥、抽绳、垂坠） |\n| 通用精修 | 去画面杂物、匀光、提纯背景、提升清晰度（非服装类目也适用） |\n| 自定义 | 自己描述要修什么 |\n\n| 附加 | 说明 |\n| --- | --- |\n| 多图输入 | 同一商品 1-4 张，模型综合多角度信息理解结构 |\n| 材质增强 | 开关；开启后表面纹理更清晰（等价于 `--quality high`） |\n\n**不做**：不改款式、颜色、图案、五金与结构；不压平结构性褶皱（褶裥、抽绳、荷叶边）；不用于把次品图修成正品图。\n\n---\n\n## 2、输入素材规则\n\n生成前先自检这几条硬性约束：\n\n- 大小：**20KB ~ 15MB**\n- 分辨率：**大于 400×400**\n- 格式：**jpg / jpeg / png / webp**\n\n**输入建议**\n\n| 做法 | 说明 |\n| --- | --- |\n| ✅ 同一商品多角度 | 1-4 张，正面 + 背面 + 细节，模型能更准地推断结构 |\n| ✅ 商品完整入画 | 出画部分只能靠编 |\n| ✅ 光线不要太杂 | 混合色温的光很难匀 |\n| ❌ 商品有明显破损/污渍 | 修图不该掩盖商品缺陷 |\n| ❌ 多个不同商品同框 | 一次只修一个商品 |\n\n---\n\n## 3、四个模板的 prompt 写法\n\n| 模板 | prompt 主体 |\n| --- | --- |\n| 平铺图精修 | `Press out the random wrinkles and creases, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting so there is no hot spot or colour cast.` |\n| 服装去皱 | `Remove only the random wrinkles and packing creases. Preserve every structural fold — pleats, gathers, drawstring ruching and intentional drape must stay exactly as they are.` |\n| 通用精修 | `Remove stray objects, dust and reflections from the frame, even out the lighting, purify the background to a clean seamless [颜色], and raise overall clarity.` |\n| 自定义 | 自己写；建议保留下面的保真句 |\n\n**保真句（四个模板都要带）**：\n\n```text\nKeep the [款式/图案/五金/结构] and the exact [颜色] unchanged and sharper than before.\n```\n\n**背景句**：`Pure white seamless background with a subtle soft contact shadow.`\n\n**去皱的关键区分**：一定要写清「结构性褶皱不许动」，否则百褶裙会被压成一片平板。\n\n---\n\n## 4、工具调用\n\n本技能使用 dLazy 的 **`gpt-image-2`**（图像编辑模型 + `--quality high`；精修要求「结构与颜色零变化、摆放与光照重整」，且支持一次传 1-4 张同商品多视角）。\n\n### 调用方式\n\n两种等价写法，选一种。统一入口会自动选后端、失败重试、建目录落盘、估算成本：\n\n```bash\n# A. 统一入口（推荐）：可切任意后端，加 --dry-run 不计费空跑\nnode scripts/gen.mjs --task item-repair \\\n  --prompt '<见下方 Prompt 模板>' \\\n  --images <按下表顺序> \\\n  --save output/item-repair-<sku>.jpg\n\n# B. 直接用 dLazy CLI（不想引入 Node 依赖时，效果等价）\ndlazy gpt-image-2 --prompt '...' --images ... --save output/item-repair.jpg\n```\n\n**参数约定（本技能固定用法）**\n\n| 参数 | 取值 | 理由 |\n| --- | --- | --- |\n| `--images` | `[图1]` ~ `[图1, 图2, 图3, 图4]`（同一商品多视角） | 对应原站「同一商品 1-4 张」 |\n| `--size` | `1024x1024`（平铺方图）/ `1024x1536`（长款竖版） | 平铺主图通常方图 |\n| `--quality` | `high`（等价「材质增强」开启） | 精修的价值在细节 |\n| `--imageFormat` | `jpeg` | 通用格式 |\n| `--batch` | `2` | 对称化结果有随机性 |\n| `--save` | `docs/item-repair/output-<sku>-retouched.jpg` | 与原图分开归档 |\n\n### Command Examples\n\n```bash\n# basic call: 平铺图精修\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a flat-lay garment photo. Press out the random wrinkles and creases, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting. Keep the pattern, colour, ribbing and label unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. No text.' \\\n  --images docs/item-repair/source-flatlay.jpg \\\n  --size 1024x1024 --quality high\n\n# complex call: 同一商品 4 个视角一起传 + 服装去皱（保留结构褶）\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a garment photo. Images 1-4 are the same product from different angles; use them together to understand the construction. Remove only the random wrinkles and packing creases from the main view. Preserve every structural fold — pleats, gathers, drawstring ruching and intentional drape must stay exactly as they are. Keep the style, colour, print placement, hardware and stitching unchanged and sharper than before. Even out the lighting with no hot spot or colour cast. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text, no watermark.' \\\n  --images docs/item-repair/v1.jpg docs/item-repair/v2.jpg docs/item-repair/v3.jpg docs/item-repair/v4.jpg \\\n  --size 1024x1024 --quality high --imageFormat jpeg \\\n  --batch 2 --save docs/item-repair/output-sku001-retouched.jpg\n\n# 批量精修仓库拍摄的平铺图\nfor f in docs/item-repair/raw/*.jpg; do\n  dlazy gpt-image-2 \\\n    --prompt 'Studio retouch of a flat-lay garment photo. Press out random wrinkles, symmetrise the silhouette, square the shoulders, align both sleeves, tidy collar and hem, even out the lighting. Keep the pattern, colour, hardware and structure unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text.' \\\n    --images \"$f\" --size 1024x1024 --quality high --imageFormat jpeg \\\n    --save \"docs/item-repair/retouched/$(basename $f)\"\ndone\n\n# 先估价不真跑\ndlazy gpt-image-2 --dry-run --prompt '...' --images a.jpg --size 1024x1024 --quality high\n```\n\n### 延伸阅读\n\n| 要查什么 | 去哪 |\n| --- | --- |\n| 认证、多后端配置、输出结构、错误码 | [`references/provider-cli.md`](references/provider-cli.md) |\n| `gpt-image-2` 的全部可用参数 | [`references/model-flags.md`](references/model-flags.md) |\n| 统一入口的全部选项 | `node scripts/gen.mjs --help` |\n\n## 5、Prompt 模板\n\n```text\nStudio retouch of a [品类] product photo.\n[多图时：Images 1-N are the same product from different angles; use them together\nto understand the construction.]\n\n[从第三节选一个模板的 prompt 主体]\n\nKeep the [款式/图案/五金/结构] and the exact [颜色] unchanged and sharper than before.\n\nPure white seamless background with a subtle soft contact shadow.\nPhotorealistic, print-ready, no text, no watermark.\n```\n\n**按问题追加的修正句**\n\n| 问题 | 追加到 prompt 末尾 |\n| --- | --- |\n| 结构褶皱被压平了 | `Do not flatten structural folds: [褶裥/抽绳/荷叶边] must remain fully three-dimensional.` |\n| 修成了另一款 | `The silhouette, seam lines and hardware positions must match the source exactly.` |\n| 背景没提纯 | `The background must be a single flat [颜色] with no gradient, texture or vignette.` |\n| 商品被磨皮 | `Preserve fabric micro-texture; do not smooth the surface into plastic.` |\n| 对称化过头、变形 | `Symmetrise only the layout, not the garment proportions.` |\n| 缺陷被抹掉了 | `Do not remove holes, stains or damage — only fix wrinkles, layout and lighting.` |\n\n---\n\n## 6、执行流程\n\n1. **选模板**（第三节）：平铺精修 / 只去皱 / 通用精修 / 自定义。\n2. **多视角就一起传**：同一商品最多 4 张，模型能更准地理解结构。\n3. **写保真句 + 背景句**；如果商品有结构性褶皱，务必加「不许压平」句。\n4. **`--quality high`** → `--batch 2` 挑图，落盘到 `docs/item-repair/`。\n5. **并排对比原图**：结构褶是否还在、五金位置是否没动、有没有被磨皮、商品缺陷有没有被不当抹除。\n6. **需要面料纹理进一步提升**时，接 [material-enhancement](https://github.com/dlazy-ai/ecommerce-skills/blob/main/skills/material-enhancement/skill.md)。\n\n---\n\n## 7、常见问题\n\n| 现象 | 原因 | 处理 |\n| --- | --- | --- |\n| 百褶/抽绳被压平 | 未区分结构褶 | 追加禁止压平结构褶句 |\n| 修成了另一个款式 | 未锁定结构 | 追加轮廓/缝线/五金位置对齐句 |\n| 表面被磨皮成塑料 | 过度平滑 | 追加保留微观纹理句；`--quality high` |\n| 背景还是有渐变 | 未要求纯色 | 追加单色背景句 |\n| 对称化把版型改窄了 | 过度对称 | 追加「只对称布局不改比例」句 |\n| 商品的破损被抹掉 | 不当修图 | 追加禁止抹除缺陷句——这条是合规红线 |\n\n---\n\n## Tips\n\nVisit https://dlazy.com for more information.\n\nFile v1.0.17:_meta.json\n\n{\n  \"ownerId\": \"kn7c5wgeajfcfvdfb5ceemvdb984cjpd\",\n  \"slug\": \"item-repair\",\n  \"version\": \"1.0.17\",\n  \"publishedAt\": 1791078274062\n}\n\nFile v1.0.17:references/model-flags.md\n\n# `gpt-image-2` 参数清单\r\n\r\n本技能默认用的模型的完整参数。日常只需要「参数约定」里那几个，\r\n这份清单在需要用到非常规参数时再看。\r\n\r\n**CRITICAL INSTRUCTION FOR AGENT**:\r\nRun the `dlazy gpt-image-2` command to get results.\r\n\r\n```bash\r\ndlazy gpt-image-2 -h\r\n\r\nOptions:\r\n  --prompt <prompt>            Prompt\r\n  --images [images...]         Images [image: url or local path] (max 5)\r\n  --size <size>                Size [default: auto] (choices: \"1024x1024\",\r\n                               \"1536x1024\", \"1024x1536\", \"2048x2048\",\r\n                               \"2048x1152\", \"3840x2160\", \"2160x3840\", \"auto\")\r\n  --imageFormat <imageFormat>  Image Format [default: jpeg] (choices: \"jpeg\",\r\n                               \"png\", \"webp\")\r\n  --quality <quality>          Quality [default: medium] (choices: \"low\",\r\n                               \"medium\", \"high\")\r\n  --dry-run                    Print payload without executing the tool\r\n  --no-wait                    Return generateId immediately for async tasks\r\n  --timeout <seconds>          Max seconds to wait for async completion\r\n                               (default: \"1800\")\r\n  --input <jsonOrFile>         Inline JSON or @path/to/file.json — merged under\r\n                               flag values (flags win)\r\n  --save <path>                Download the result asset to this local path\r\n                               (mkdir + retry handled for you). A destination\r\n                               path — NOT a response format; for stdout shape\r\n                               use --format\r\n  --batch <n>                  Fan-out N parallel runs (cloud tools only)\r\n                               (default: \"1\")\r\n  -h, --help                   display help for command\r\n```\r\n\r\n> Any flag also accepts pipe references — `-` (auto-pick from upstream stdin), `@N` (n-th output), `@N.path` (jsonpath into output), `@*` (all primary values), `@stdin` / `@stdin:path` (whole envelope). See `dlazy --help` for details.\r\n\r\n---\r\n\r\n换其他后端时参数由 `scripts/gen.mjs` 统一翻译，见 [`provider-cli.md`](provider-cli.md)。\n\nFile v1.0.17:references/provider-cli.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/provider-cli.md 同步生成，不要直接改这里。 -->\n# 后端调用参考\n\n技能正文只写「要生成什么」。认证、计费、错误码、输出结构这些每个技能都一样的东西放在这里，\n**用到时再读**，不占技能的常驻上下文。\n\n---\n\n## 一、认证\n\n### 默认后端 dLazy\n\n```bash\ndlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入\n```\n\nkey 存在用户配置目录（macOS/Linux `~/.dlazy/config.json`，Windows `%USERPROFILE%\\.dlazy\\config.json`），\n权限限本机用户。也可以每次调用用环境变量 `DLAZY_API_KEY` 传入。\n\n手动获取：登录 [dlazy.com](https://dlazy.com) → [API Key 页面](https://dlazy.com/dashboard/organization/api-key)。\nkey 按组织隔离，可随时轮换或吊销。\n\n### 其他后端\n\n本技能库不锁定单一厂商。配好任意一家的 key 即可跑：\n\n| 后端 | 环境变量 | 说明 |\n| --- | --- | --- |\n| `dlazy` | `dlazy login` 或 `DLAZY_API_KEY` | 默认，最省事 |\n| `openai` | `OPENAI_API_KEY` | 走 `/v1/images/edits` 与 `/v1/images/generations` |\n| `gemini` | `GEMINI_API_KEY` | Nano Banana 系列 |\n| `fal` | `FAL_KEY` | |\n| `replicate` | `REPLICATE_API_TOKEN` | |\n| `ark` | `ARK_API_KEY` + `ARK_MODEL` | 火山方舟，模型 ID 需按开通情况填 |\n\n选路优先级：`--provider` 参数 > `PROVIDER` 环境变量 > 第一个配了 key 的 > `dlazy`。\n\n```bash\nnode scripts/gen.mjs --doctor     # 看当前哪个后端可用\n```\n\n各后端的模型 ID 可用 `GEN_MODEL_OPENAI` / `GEN_MODEL_GEMINI` / `GEN_MODEL_FAL` /\n`GEN_MODEL_REPLICATE` / `GEN_MODEL_ARK` 覆盖。**厂商目录会变，以各家最新文档为准。**\n\n---\n\n## 二、两种调用方式\n\n### 方式 A：统一入口（推荐）\n\n```bash\nnode scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg\n```\n\n它负责：后端选路、默认尺寸档位、失败重试（429/5xx 指数退避）、落盘建目录、成本估算。\n\n```bash\nnode scripts/gen.mjs --task flat-lay --prompt '...' --dry-run   # 不调用不计费，只看要发什么\nnode scripts/gen.mjs --help\n```\n\n### 方式 B：直接用 dLazy CLI\n\n不想引入 Node 依赖时，技能正文里的 `dlazy ...` 命令可以原样执行，效果等价。\n\n```bash\nnpx @dlazy/cli@1.2.3 <command>     # 不装全局二进制\n```\n\n- CLI 源码：[github.com/dlazy-ai/cli](https://github.com/dlazy-ai/cli) · npm 包 `@dlazy/cli`\n\n---\n\n## 三、数据流向\n\n调用 dLazy 时：提示词与参数发往 `api.dlazy.com`；传入的本地图片会上传到 `files.dlazy.com`\n供模型读取；产出 URL 同样托管在 `files.dlazy.com`。这是云端生成 API 的通用形态。\n换成其他后端时，数据流向对应厂商，不经过 dLazy。\n\n---\n\n## 四、输出结构\n\n`gen.mjs`（加 `--json`）：\n\n```json\n{\n  \"ok\": true,\n  \"task\": \"flat-lay\",\n  \"provider\": \"dlazy\",\n  \"model\": \"gpt-image-2\",\n  \"files\": [\"docs/flat-lay/output-sku001.jpg\"],\n  \"texts\": [],\n  \"estimatedCredits\": 60,\n  \"elapsedMs\": 58213\n}\n```\n\ndLazy CLI 原生：\n\n```json\n{\n  \"ok\": true,\n  \"result\": {\n    \"tool\": \"gpt-image-2\",\n    \"data\": { \"urls\": [\"https://files.dlazy.com/data/ai/....jpg\"] },\n    \"savedPath\": \"docs/flat-lay/example-output.jpg\"\n  }\n}\n```\n\n加 `--no-wait` 的异步任务不返回 `data`，返回 `task: { generateId, status }`，\n用 `dlazy status <generateId> --wait` 轮询。\n\n文本类模型（如质检）产出在 `result.data.texts[0]`：\n\n```bash\ndlazy claude-sonnet-5 --prompt '...' --images x.jpg \\\n  | python3 -c 'import sys,json;print(json.load(sys.stdin)[\"result\"][\"data\"][\"texts\"][0])'\n```\n\n---\n\n## 五、错误处理\n\n| Code | 类型 | 示例 |\n| --- | --- | --- |\n| 401 | 未授权 / 无 key | `ok: false, code: \"unauthorized\"` |\n| 501 | 缺必填参数 | `error: required option '--prompt <prompt>' not specified` |\n| 502 | 本地文件读不到 | `Error: Image file not found: ...` |\n| 503 | 余额不足 | `ok: false, code: \"insufficient_balance\"` |\n| 503 | 服务端错误 | `HTTP status code error (500)` |\n| 504 | 异步任务失败 | `=== Generation Failed ===` / `Prompt violates safety policy` |\n\n**给 Agent 的硬性要求**\n\n1. 命中 `insufficient_balance` → 明确告诉用户算力不足，并给出充值入口\n   <https://dlazy.com/dashboard/organization/settings?tab=credits>\n2. 命中 `unauthorized` / 缺 key → 告诉用户去 <https://dlazy.com/dashboard/organization/api-key>\n   取 key，用 `dlazy auth set <key>` 存好再继续。\n3. 用 `gen.mjs` 时，429 与 5xx 已自动重试；仍失败才向用户报错。\n4. **不要**为了「跑通」而偷偷降级参数（尺寸、档位、批量），先问用户。\n\nFile v1.0.17:scripts/lib/tasks.json\n\n{\r\n  \"_note\": \"技能 → 默认模型与参数。dlazy 列为默认后端的模型名；其他后端走 providers.mjs 的通用映射，可用 GEN_MODEL_<PROVIDER> 覆盖。\",\r\n  \"_credits\": { \"gpt-image-2\": 60, \"seedream-5.0\": 30, \"seedream-5.0-pro\": 45, \"banana-pro\": 25, \"claude-sonnet-5\": 3 },\r\n  \"tasks\": {\r\n    \"flat-lay\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"wear-everything\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"image-fusion\":            { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"one-shot\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"fission-pattern\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-detail\":             { \"model\": \"seedream-5.0-pro\", \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"creative-scene\":          { \"model\": \"banana-pro\",       \"size\": \"1024x1536\", \"format\": \"jpeg\" },\r\n    \"batch-image\":             { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"to-3d\":                   { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-extraction\":     { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"fabric-on-body\":          { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-detail\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-grass-planting\": { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-selling-point\":      { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"item-change-background\":  { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"remove-watermark\":        { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"material-enhancement\":    { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"item-repair\":             { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"detect-task\":             { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"listing-optimizer\":       { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"cross-border-localize\":   { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"brand-kit\":               { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"platform-compliance\":     { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"main-image-video\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"product-video-ad\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"ugc-testimonial\":         { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true }\r\n  }\r\n}\n\nFile v1.0.17:skill-card.md\n\n## Description:\n\nRetouches product photos for catalog use by reducing incidental wrinkles, balancing lighting, and cleaning backgrounds while preserving product details.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[dlazyai](https://clawhub.ai/user/dlazyai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nE-commerce sellers and content teams use this skill to prepare single-product photos for listings while preserving colors, construction, and visible defects.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Product images and prompts may be sent to an external image provider, exposing confidential catalog material.\n\nMitigation: Review before installing for confidential images; choose an approved provider explicitly and avoid private or internal image URLs.\n\nRisk: The shared generation tool can fetch supplied image URLs and supports tasks beyond item repair.\n\nMitigation: Use --dry-run to inspect the intended request, prefer local files or trusted HTTPS sources, and review the tool's scope before execution.\n\nRisk: Retouching may change product structure or hide defects, making listing images misleading.\n\nMitigation: Ask the model to preserve construction and visible defects, then compare output against the original before publishing.\n\n## Reference(s):\n\n- [Item Repair on ClawHub](https://clawhub.ai/dlazyai/skills/item-repair)\n- [Provider and CLI reference](references/provider-cli.md)\n- [Image model options](references/model-flags.md)\n- [dLazy CLI source](https://github.com/dlazy-ai/cli)\n\n## Skill Output:\n\n**Output Type(s):** [Guidance, Shell commands]\n\n**Output Format:** [Markdown with shell commands]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Commands can save retouched product images; compare results with originals before publishing.]\n\n## Skill Version(s):\n\n1.0.17 (source: frontmatter and release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.17:examples/brand.yaml\n\n# ⚠️ 由 scripts/build-skills.mjs 从 shared/examples/brand.yaml 同步生成，不要直接改这里。\r\n# 店铺品牌视觉规范 —— 所有生图技能读这一份，保证几百个 SKU 看起来像同一家店。\r\n#   node scripts/brand.mjs --brand brand.yaml --for flat-lay\r\n#   node scripts/gen.mjs --task flat-lay --brand brand.yaml --prompt '...'\r\n\r\nbrand:\r\n  name: 示例品牌\r\n  # 一句话概括调性，会原样进 prompt\r\n  tone: quiet minimalist, warm and lived-in, never glossy or commercial\r\n\r\nmodel:\r\n  # 锁模特：给一张脸的参考图，所有技能都会把它作为最后一张参考图传入\r\n  reference: assets/model/face-a.jpg\r\n  description: East Asian woman, late twenties, natural makeup, shoulder-length black hair\r\n  body: slim, height around 168cm\r\n\r\nphotography:\r\n  background: seamless off-white studio backdrop, RGB 248 248 246\r\n  lighting: soft large softbox from camera left, gentle fill, no hard shadows\r\n  camera: 85mm equivalent, eye level, shallow depth of field\r\n  grade: neutral white balance around 5200K, low contrast, slightly lifted blacks\r\n  crop: full body with headroom, product centered\r\n\r\nlayout:\r\n  # 给带排版的技能（主图 / 详情页）用\r\n  margin: at least 8% empty margin on all sides\r\n  typeface: clean sans-serif, no decorative fonts\r\n  text_color: near-black on light background\r\n\r\nforbid:\r\n  - no visible brand logos other than the product's own\r\n  - no text or watermark\r\n  - no exaggerated poses or dramatic wind effects\r\n  - no oversaturated colors\r\n\r\n# 可选：把这些直接写进合规目标，生成时就按平台要求出图\r\ncompliance:\r\n  platform: amazon\n\nArchive v1.0.16: 11 files, 25088 bytes\n\nFiles: examples/brand.yaml (1655b), references/model-flags.md (2144b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2003b), SKILL.md (11359b), _meta.json (131b)\n\nFile v1.0.16:SKILL.md\n\n---\nname: item-repair\nversion: 1.0.16\ndescription: 商品精修、去褶皱。随手拍的商品图 → 可直接上架的精修图。当用户说「精修」「去褶皱」「修图」「拍得不好看」「整理一下」时使用。\n---\n\n# item-repair — 一键提升商品图质感\n\n把**随手拍的商品图**修成**可上架的精修图**：压平褶皱、摆正对称、匀光、提纯背景。\n\n和 [material-enhancement](https://github.com/dlazy-ai/ecommerce-skills/blob/main/skills/material-enhancement/skill.md) 的分工：material-enhancement 修**面料纹理**（在模特图上），本技能修**摆放与光照**（在商品图上）。两者可以串起来用。\n\n---\n\n## 生成效果示例\n\n| 输入：原商品图 |\n| --- |\n| <img src=\"https://raw.githubusercontent.com/dlazy-ai/ecommerce-skills/main/docs/item-repair/source-flatlay.jpg\" width=\"280\"> |\n| `source-flatlay.jpg` — 军绿麻花针织毛衣平铺图（袖身有随机褶皱、左右不完全对称），800×800 |\n\n实际执行的命令（平铺图精修 + 材质增强）：\n\n```bash\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a flat-lay garment photo. Clean up this olive-green cable-knit sweater to catalog standard: press out the random wrinkles and creases in the body and sleeves, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting so there is no hot spot or colour cast. Keep the cable-knit and diamond stitch pattern, the exact olive-green colour, the ribbed collar/cuffs/hem and the woven cuff label unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text, no watermark.' \\\n  --images docs/item-repair/source-flatlay.jpg \\\n  --size 1024x1024 --quality high --imageFormat jpeg \\\n  --save docs/item-repair/example-output.jpg\n```\n\n**输出**\n\n<img src=\"https://raw.githubusercontent.com/dlazy-ai/ecommerce-skills/main/docs/item-repair/example-output.jpg\" width=\"320\">\n\n`example-output.jpg` — 1024×1024，60 credits。随机褶皱被压平、肩线方正、两只袖子长度与角度对齐、下摆罗纹平整、光照均匀无高光斑；麻花与菱形织法、军绿色、罗纹结构与右袖织标保留且比原图更清晰，背景提纯为白底带柔和接地投影。\n\n---\n\n## 1、能力边界\n\n| 模板 | 做什么 |\n| --- | --- |\n| 平铺图精修 | 摊平、左右对称、方正肩线、袖长对齐、去褶皱、匀光、纯净背景 |\n| 服装去皱 | 只压平随机褶皱与折痕，保留结构性褶（褶裥、抽绳、垂坠） |\n| 通用精修 | 去画面杂物、匀光、提纯背景、提升清晰度（非服装类目也适用） |\n| 自定义 | 自己描述要修什么 |\n\n| 附加 | 说明 |\n| --- | --- |\n| 多图输入 | 同一商品 1-4 张，模型综合多角度信息理解结构 |\n| 材质增强 | 开关；开启后表面纹理更清晰（等价于 `--quality high`） |\n\n**不做**：不改款式、颜色、图案、五金与结构；不压平结构性褶皱（褶裥、抽绳、荷叶边）；不用于把次品图修成正品图。\n\n---\n\n## 2、输入素材规则\n\n生成前先自检这几条硬性约束：\n\n- 大小：**20KB ~ 15MB**\n- 分辨率：**大于 400×400**\n- 格式：**jpg / jpeg / png / webp**\n\n**输入建议**\n\n| 做法 | 说明 |\n| --- | --- |\n| ✅ 同一商品多角度 | 1-4 张，正面 + 背面 + 细节，模型能更准地推断结构 |\n| ✅ 商品完整入画 | 出画部分只能靠编 |\n| ✅ 光线不要太杂 | 混合色温的光很难匀 |\n| ❌ 商品有明显破损/污渍 | 修图不该掩盖商品缺陷 |\n| ❌ 多个不同商品同框 | 一次只修一个商品 |\n\n---\n\n## 3、四个模板的 prompt 写法\n\n| 模板 | prompt 主体 |\n| --- | --- |\n| 平铺图精修 | `Press out the random wrinkles and creases, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting so there is no hot spot or colour cast.` |\n| 服装去皱 | `Remove only the random wrinkles and packing creases. Preserve every structural fold — pleats, gathers, drawstring ruching and intentional drape must stay exactly as they are.` |\n| 通用精修 | `Remove stray objects, dust and reflections from the frame, even out the lighting, purify the background to a clean seamless [颜色], and raise overall clarity.` |\n| 自定义 | 自己写；建议保留下面的保真句 |\n\n**保真句（四个模板都要带）**：\n\n```text\nKeep the [款式/图案/五金/结构] and the exact [颜色] unchanged and sharper than before.\n```\n\n**背景句**：`Pure white seamless background with a subtle soft contact shadow.`\n\n**去皱的关键区分**：一定要写清「结构性褶皱不许动」，否则百褶裙会被压成一片平板。\n\n---\n\n## 4、工具调用\n\n本技能使用 dLazy 的 **`gpt-image-2`**（图像编辑模型 + `--quality high`；精修要求「结构与颜色零变化、摆放与光照重整」，且支持一次传 1-4 张同商品多视角）。\n\n### 调用方式\n\n两种等价写法，选一种。统一入口会自动选后端、失败重试、建目录落盘、估算成本：\n\n```bash\n# A. 统一入口（推荐）：可切任意后端，加 --dry-run 不计费空跑\nnode scripts/gen.mjs --task item-repair \\\n  --prompt '<见下方 Prompt 模板>' \\\n  --images <按下表顺序> \\\n  --save output/item-repair-<sku>.jpg\n\n# B. 直接用 dLazy CLI（不想引入 Node 依赖时，效果等价）\ndlazy gpt-image-2 --prompt '...' --images ... --save output/item-repair.jpg\n```\n\n**参数约定（本技能固定用法）**\n\n| 参数 | 取值 | 理由 |\n| --- | --- | --- |\n| `--images` | `[图1]` ~ `[图1, 图2, 图3, 图4]`（同一商品多视角） | 对应原站「同一商品 1-4 张」 |\n| `--size` | `1024x1024`（平铺方图）/ `1024x1536`（长款竖版） | 平铺主图通常方图 |\n| `--quality` | `high`（等价「材质增强」开启） | 精修的价值在细节 |\n| `--imageFormat` | `jpeg` | 通用格式 |\n| `--batch` | `2` | 对称化结果有随机性 |\n| `--save` | `docs/item-repair/output-<sku>-retouched.jpg` | 与原图分开归档 |\n\n### Command Examples\n\n```bash\n# basic call: 平铺图精修\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a flat-lay garment photo. Press out the random wrinkles and creases, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting. Keep the pattern, colour, ribbing and label unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. No text.' \\\n  --images docs/item-repair/source-flatlay.jpg \\\n  --size 1024x1024 --quality high\n\n# complex call: 同一商品 4 个视角一起传 + 服装去皱（保留结构褶）\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a garment photo. Images 1-4 are the same product from different angles; use them together to understand the construction. Remove only the random wrinkles and packing creases from the main view. Preserve every structural fold — pleats, gathers, drawstring ruching and intentional drape must stay exactly as they are. Keep the style, colour, print placement, hardware and stitching unchanged and sharper than before. Even out the lighting with no hot spot or colour cast. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text, no watermark.' \\\n  --images docs/item-repair/v1.jpg docs/item-repair/v2.jpg docs/item-repair/v3.jpg docs/item-repair/v4.jpg \\\n  --size 1024x1024 --quality high --imageFormat jpeg \\\n  --batch 2 --save docs/item-repair/output-sku001-retouched.jpg\n\n# 批量精修仓库拍摄的平铺图\nfor f in docs/item-repair/raw/*.jpg; do\n  dlazy gpt-image-2 \\\n    --prompt 'Studio retouch of a flat-lay garment photo. Press out random wrinkles, symmetrise the silhouette, square the shoulders, align both sleeves, tidy collar and hem, even out the lighting. Keep the pattern, colour, hardware and structure unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text.' \\\n    --images \"$f\" --size 1024x1024 --quality high --imageFormat jpeg \\\n    --save \"docs/item-repair/retouched/$(basename $f)\"\ndone\n\n# 先估价不真跑\ndlazy gpt-image-2 --dry-run --prompt '...' --images a.jpg --size 1024x1024 --quality high\n```\n\n### 延伸阅读\n\n| 要查什么 | 去哪 |\n| --- | --- |\n| 认证、多后端配置、输出结构、错误码 | [`references/provider-cli.md`](references/provider-cli.md) |\n| `gpt-image-2` 的全部可用参数 | [`references/model-flags.md`](references/model-flags.md) |\n| 统一入口的全部选项 | `node scripts/gen.mjs --help` |\n\n## 5、Prompt 模板\n\n```text\nStudio retouch of a [品类] product photo.\n[多图时：Images 1-N are the same product from different angles; use them together\nto understand the construction.]\n\n[从第三节选一个模板的 prompt 主体]\n\nKeep the [款式/图案/五金/结构] and the exact [颜色] unchanged and sharper than before.\n\nPure white seamless background with a subtle soft contact shadow.\nPhotorealistic, print-ready, no text, no watermark.\n```\n\n**按问题追加的修正句**\n\n| 问题 | 追加到 prompt 末尾 |\n| --- | --- |\n| 结构褶皱被压平了 | `Do not flatten structural folds: [褶裥/抽绳/荷叶边] must remain fully three-dimensional.` |\n| 修成了另一款 | `The silhouette, seam lines and hardware positions must match the source exactly.` |\n| 背景没提纯 | `The background must be a single flat [颜色] with no gradient, texture or vignette.` |\n| 商品被磨皮 | `Preserve fabric micro-texture; do not smooth the surface into plastic.` |\n| 对称化过头、变形 | `Symmetrise only the layout, not the garment proportions.` |\n| 缺陷被抹掉了 | `Do not remove holes, stains or damage — only fix wrinkles, layout and lighting.` |\n\n---\n\n## 6、执行流程\n\n1. **选模板**（第三节）：平铺精修 / 只去皱 / 通用精修 / 自定义。\n2. **多视角就一起传**：同一商品最多 4 张，模型能更准地理解结构。\n3. **写保真句 + 背景句**；如果商品有结构性褶皱，务必加「不许压平」句。\n4. **`--quality high`** → `--batch 2` 挑图，落盘到 `docs/item-repair/`。\n5. **并排对比原图**：结构褶是否还在、五金位置是否没动、有没有被磨皮、商品缺陷有没有被不当抹除。\n6. **需要面料纹理进一步提升**时，接 [material-enhancement](https://github.com/dlazy-ai/ecommerce-skills/blob/main/skills/material-enhancement/skill.md)。\n\n---\n\n## 7、常见问题\n\n| 现象 | 原因 | 处理 |\n| --- | --- | --- |\n| 百褶/抽绳被压平 | 未区分结构褶 | 追加禁止压平结构褶句 |\n| 修成了另一个款式 | 未锁定结构 | 追加轮廓/缝线/五金位置对齐句 |\n| 表面被磨皮成塑料 | 过度平滑 | 追加保留微观纹理句；`--quality high` |\n| 背景还是有渐变 | 未要求纯色 | 追加单色背景句 |\n| 对称化把版型改窄了 | 过度对称 | 追加「只对称布局不改比例」句 |\n| 商品的破损被抹掉 | 不当修图 | 追加禁止抹除缺陷句——这条是合规红线 |\n\n---\n\n## Tips\n\nVisit https://dlazy.com for more information.\n\nFile v1.0.16:_meta.json\n\n{\n  \"ownerId\": \"kn7c5wgeajfcfvdfb5ceemvdb984cjpd\",\n  \"slug\": \"item-repair\",\n  \"version\": \"1.0.16\",\n  \"publishedAt\": 1790918223280\n}\n\nFile v1.0.16:references/model-flags.md\n\n# `gpt-image-2` 参数清单\r\n\r\n本技能默认用的模型的完整参数。日常只需要「参数约定」里那几个，\r\n这份清单在需要用到非常规参数时再看。\r\n\r\n**CRITICAL INSTRUCTION FOR AGENT**:\r\nRun the `dlazy gpt-image-2` command to get results.\r\n\r\n```bash\r\ndlazy gpt-image-2 -h\r\n\r\nOptions:\r\n  --prompt <prompt>            Prompt\r\n  --images [images...]         Images [image: url or local path] (max 5)\r\n  --size <size>                Size [default: auto] (choices: \"1024x1024\",\r\n                               \"1536x1024\", \"1024x1536\", \"2048x2048\",\r\n                               \"2048x1152\", \"3840x2160\", \"2160x3840\", \"auto\")\r\n  --imageFormat <imageFormat>  Image Format [default: jpeg] (choices: \"jpeg\",\r\n                               \"png\", \"webp\")\r\n  --quality <quality>          Quality [default: medium] (choices: \"low\",\r\n                               \"medium\", \"high\")\r\n  --dry-run                    Print payload without executing the tool\r\n  --no-wait                    Return generateId immediately for async tasks\r\n  --timeout <seconds>          Max seconds to wait for async completion\r\n                               (default: \"1800\")\r\n  --input <jsonOrFile>         Inline JSON or @path/to/file.json — merged under\r\n                               flag values (flags win)\r\n  --save <path>                Download the result asset to this local path\r\n                               (mkdir + retry handled for you). A destination\r\n                               path — NOT a response format; for stdout shape\r\n                               use --format\r\n  --batch <n>                  Fan-out N parallel runs (cloud tools only)\r\n                               (default: \"1\")\r\n  -h, --help                   display help for command\r\n```\r\n\r\n> Any flag also accepts pipe references — `-` (auto-pick from upstream stdin), `@N` (n-th output), `@N.path` (jsonpath into output), `@*` (all primary values), `@stdin` / `@stdin:path` (whole envelope). See `dlazy --help` for details.\r\n\r\n---\r\n\r\n换其他后端时参数由 `scripts/gen.mjs` 统一翻译，见 [`provider-cli.md`](provider-cli.md)。\n\nFile v1.0.16:references/provider-cli.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/provider-cli.md 同步生成，不要直接改这里。 -->\n# 后端调用参考\n\n技能正文只写「要生成什么」。认证、计费、错误码、输出结构这些每个技能都一样的东西放在这里，\n**用到时再读**，不占技能的常驻上下文。\n\n---\n\n## 一、认证\n\n### 默认后端 dLazy\n\n```bash\ndlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入\n```\n\nkey 存在用户配置目录（macOS/Linux `~/.dlazy/config.json`，Windows `%USERPROFILE%\\.dlazy\\config.json`），\n权限限本机用户。也可以每次调用用环境变量 `DLAZY_API_KEY` 传入。\n\n手动获取：登录 [dlazy.com](https://dlazy.com) → [API Key 页面](https://dlazy.com/dashboard/organization/api-key)。\nkey 按组织隔离，可随时轮换或吊销。\n\n### 其他后端\n\n本技能库不锁定单一厂商。配好任意一家的 key 即可跑：\n\n| 后端 | 环境变量 | 说明 |\n| --- | --- | --- |\n| `dlazy` | `dlazy login` 或 `DLAZY_API_KEY` | 默认，最省事 |\n| `openai` | `OPENAI_API_KEY` | 走 `/v1/images/edits` 与 `/v1/images/generations` |\n| `gemini` | `GEMINI_API_KEY` | Nano Banana 系列 |\n| `fal` | `FAL_KEY` | |\n| `replicate` | `REPLICATE_API_TOKEN` | |\n| `ark` | `ARK_API_KEY` + `ARK_MODEL` | 火山方舟，模型 ID 需按开通情况填 |\n\n选路优先级：`--provider` 参数 > `PROVIDER` 环境变量 > 第一个配了 key 的 > `dlazy`。\n\n```bash\nnode scripts/gen.mjs --doctor     # 看当前哪个后端可用\n```\n\n各后端的模型 ID 可用 `GEN_MODEL_OPENAI` / `GEN_MODEL_GEMINI` / `GEN_MODEL_FAL` /\n`GEN_MODEL_REPLICATE` / `GEN_MODEL_ARK` 覆盖。**厂商目录会变，以各家最新文档为准。**\n\n---\n\n## 二、两种调用方式\n\n### 方式 A：统一入口（推荐）\n\n```bash\nnode scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg\n```\n\n它负责：后端选路、默认尺寸档位、失败重试（429/5xx 指数退避）、落盘建目录、成本估算。\n\n```bash\nnode scripts/gen.mjs --task flat-lay --prompt '...' --dry-run   # 不调用不计费，只看要发什么\nnode scripts/gen.mjs --help\n```\n\n### 方式 B：直接用 dLazy CLI\n\n不想引入 Node 依赖时，技能正文里的 `dlazy ...` 命令可以原样执行，效果等价。\n\n```bash\nnpx @dlazy/cli@1.2.3 <command>     # 不装全局二进制\n```\n\n- CLI 源码：[github.com/dlazy-ai/cli](https://github.com/dlazy-ai/cli) · npm 包 `@dlazy/cli`\n\n---\n\n## 三、数据流向\n\n调用 dLazy 时：提示词与参数发往 `api.dlazy.com`；传入的本地图片会上传到 `files.dlazy.com`\n供模型读取；产出 URL 同样托管在 `files.dlazy.com`。这是云端生成 API 的通用形态。\n换成其他后端时，数据流向对应厂商，不经过 dLazy。\n\n---\n\n## 四、输出结构\n\n`gen.mjs`（加 `--json`）：\n\n```json\n{\n  \"ok\": true,\n  \"task\": \"flat-lay\",\n  \"provider\": \"dlazy\",\n  \"model\": \"gpt-image-2\",\n  \"files\": [\"docs/flat-lay/output-sku001.jpg\"],\n  \"texts\": [],\n  \"estimatedCredits\": 60,\n  \"elapsedMs\": 58213\n}\n```\n\ndLazy CLI 原生：\n\n```json\n{\n  \"ok\": true,\n  \"result\": {\n    \"tool\": \"gpt-image-2\",\n    \"data\": { \"urls\": [\"https://files.dlazy.com/data/ai/....jpg\"] },\n    \"savedPath\": \"docs/flat-lay/example-output.jpg\"\n  }\n}\n```\n\n加 `--no-wait` 的异步任务不返回 `data`，返回 `task: { generateId, status }`，\n用 `dlazy status <generateId> --wait` 轮询。\n\n文本类模型（如质检）产出在 `result.data.texts[0]`：\n\n```bash\ndlazy claude-sonnet-5 --prompt '...' --images x.jpg \\\n  | python3 -c 'import sys,json;print(json.load(sys.stdin)[\"result\"][\"data\"][\"texts\"][0])'\n```\n\n---\n\n## 五、错误处理\n\n| Code | 类型 | 示例 |\n| --- | --- | --- |\n| 401 | 未授权 / 无 key | `ok: false, code: \"unauthorized\"` |\n| 501 | 缺必填参数 | `error: required option '--prompt <prompt>' not specified` |\n| 502 | 本地文件读不到 | `Error: Image file not found: ...` |\n| 503 | 余额不足 | `ok: false, code: \"insufficient_balance\"` |\n| 503 | 服务端错误 | `HTTP status code error (500)` |\n| 504 | 异步任务失败 | `=== Generation Failed ===` / `Prompt violates safety policy` |\n\n**给 Agent 的硬性要求**\n\n1. 命中 `insufficient_balance` → 明确告诉用户算力不足，并给出充值入口\n   <https://dlazy.com/dashboard/organization/settings?tab=credits>\n2. 命中 `unauthorized` / 缺 key → 告诉用户去 <https://dlazy.com/dashboard/organization/api-key>\n   取 key，用 `dlazy auth set <key>` 存好再继续。\n3. 用 `gen.mjs` 时，429 与 5xx 已自动重试；仍失败才向用户报错。\n4. **不要**为了「跑通」而偷偷降级参数（尺寸、档位、批量），先问用户。\n\nFile v1.0.16:scripts/lib/tasks.json\n\n{\r\n  \"_note\": \"技能 → 默认模型与参数。dlazy 列为默认后端的模型名；其他后端走 providers.mjs 的通用映射，可用 GEN_MODEL_<PROVIDER> 覆盖。\",\r\n  \"_credits\": { \"gpt-image-2\": 60, \"seedream-5.0\": 30, \"seedream-5.0-pro\": 45, \"banana-pro\": 25, \"claude-sonnet-5\": 3 },\r\n  \"tasks\": {\r\n    \"flat-lay\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"wear-everything\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"image-fusion\":            { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"one-shot\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"fission-pattern\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-detail\":             { \"model\": \"seedream-5.0-pro\", \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"creative-scene\":          { \"model\": \"banana-pro\",       \"size\": \"1024x1536\", \"format\": \"jpeg\" },\r\n    \"batch-image\":             { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"to-3d\":                   { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-extraction\":     { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"fabric-on-body\":          { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-detail\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-grass-planting\": { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-selling-point\":      { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"item-change-background\":  { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"remove-watermark\":        { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"material-enhancement\":    { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"item-repair\":             { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"detect-task\":             { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"listing-optimizer\":       { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"cross-border-localize\":   { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"brand-kit\":               { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"platform-compliance\":     { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"main-image-video\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"product-video-ad\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"ugc-testimonial\":         { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true }\r\n  }\r\n}\n\nFile v1.0.16:skill-card.md\n\n## Description:\n\nRetouches product photos for listings by smoothing incidental wrinkles, balancing lighting, and cleaning backgrounds while preserving product details.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[dlazyai](https://clawhub.ai/user/dlazyai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nE-commerce sellers and creative teams use this skill to prepare product photos for listings, removing incidental creases and improving lighting and backgrounds without changing the product itself.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Product photos and prompts may be sent to an external AI provider for processing.\n\nMitigation: Use only images approved for cloud processing, confirm the selected provider, and inspect requests with --dry-run before generating.\n\nRisk: Retouching can inadvertently alter product details or conceal defects in listing images.\n\nMitigation: Compare outputs against the source and reject changes to construction, color, hardware, intentional folds, or actual damage.\n\n## Reference(s):\n\n- [Item Repair release on ClawHub](https://clawhub.ai/dlazyai/skills/item-repair)\n- [Provider CLI reference](references/provider-cli.md)\n- [Image model flags](references/model-flags.md)\n\n## Skill Output:\n\n**Output Type(s):** [Guidance, Shell commands, Images]\n\n**Output Format:** [Text or Markdown instructions and commands; saved product images when generation is run]\n\n**Output Parameters:** [1D for agent responses; image files for generated assets]\n\n**Other Properties Related to Output:** [Supports one to four product views and optional local output paths.]\n\n## Skill Version(s):\n\n1.0.16 (source: release evidence and skill frontmatter)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.16:examples/brand.yaml\n\n# ⚠️ 由 scripts/build-skills.mjs 从 shared/examples/brand.yaml 同步生成，不要直接改这里。\r\n# 店铺品牌视觉规范 —— 所有生图技能读这一份，保证几百个 SKU 看起来像同一家店。\r\n#   node scripts/brand.mjs --brand brand.yaml --for flat-lay\r\n#   node scripts/gen.mjs --task flat-lay --brand brand.yaml --prompt '...'\r\n\r\nbrand:\r\n  name: 示例品牌\r\n  # 一句话概括调性，会原样进 prompt\r\n  tone: quiet minimalist, warm and lived-in, never glossy or commercial\r\n\r\nmodel:\r\n  # 锁模特：给一张脸的参考图，所有技能都会把它作为最后一张参考图传入\r\n  reference: assets/model/face-a.jpg\r\n  description: East Asian woman, late twenties, natural makeup, shoulder-length black hair\r\n  body: slim, height around 168cm\r\n\r\nphotography:\r\n  background: seamless off-white studio backdrop, RGB 248 248 246\r\n  lighting: soft large softbox from camera left, gentle fill, no hard shadows\r\n  camera: 85mm equivalent, eye level, shallow depth of field\r\n  grade: neutral white balance around 5200K, low contrast, slightly lifted blacks\r\n  crop: full body with headroom, product centered\r\n\r\nlayout:\r\n  # 给带排版的技能（主图 / 详情页）用\r\n  margin: at least 8% empty margin on all sides\r\n  typeface: clean sans-serif, no decorative fonts\r\n  text_color: near-black on light background\r\n\r\nforbid:\r\n  - no visible brand logos other than the product's own\r\n  - no text or watermark\r\n  - no exaggerated poses or dramatic wind effects\r\n  - no oversaturated colors\r\n\r\n# 可选：把这些直接写进合规目标，生成时就按平台要求出图\r\ncompliance:\r\n  platform: amazon\n\nArchive v1.0.15: 11 files, 25061 bytes\n\nFiles: examples/brand.yaml (1655b), references/model-flags.md (2144b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (1962b), SKILL.md (11359b), _meta.json (131b)\n\nFile v1.0.15:SKILL.md\n\n---\nname: item-repair\nversion: 1.0.15\ndescription: 商品精修、去褶皱。随手拍的商品图 → 可直接上架的精修图。当用户说「精修」「去褶皱」「修图」「拍得不好看」「整理一下」时使用。\n---\n\n# item-repair — 一键提升商品图质感\n\n把**随手拍的商品图**修成**可上架的精修图**：压平褶皱、摆正对称、匀光、提纯背景。\n\n和 [material-enhancement](https://github.com/dlazy-ai/ecommerce-skills/blob/main/skills/material-enhancement/skill.md) 的分工：material-enhancement 修**面料纹理**（在模特图上），本技能修**摆放与光照**（在商品图上）。两者可以串起来用。\n\n---\n\n## 生成效果示例\n\n| 输入：原商品图 |\n| --- |\n| <img src=\"https://raw.githubusercontent.com/dlazy-ai/ecommerce-skills/main/docs/item-repair/source-flatlay.jpg\" width=\"280\"> |\n| `source-flatlay.jpg` — 军绿麻花针织毛衣平铺图（袖身有随机褶皱、左右不完全对称），800×800 |\n\n实际执行的命令（平铺图精修 + 材质增强）：\n\n```bash\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a flat-lay garment photo. Clean up this olive-green cable-knit sweater to catalog standard: press out the random wrinkles and creases in the body and sleeves, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting so there is no hot spot or colour cast. Keep the cable-knit and diamond stitch pattern, the exact olive-green colour, the ribbed collar/cuffs/hem and the woven cuff label unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text, no watermark.' \\\n  --images docs/item-repair/source-flatlay.jpg \\\n  --size 1024x1024 --quality high --imageFormat jpeg \\\n  --save docs/item-repair/example-output.jpg\n```\n\n**输出**\n\n<img src=\"https://raw.githubusercontent.com/dlazy-ai/ecommerce-skills/main/docs/item-repair/example-output.jpg\" width=\"320\">\n\n`example-output.jpg` — 1024×1024，60 credits。随机褶皱被压平、肩线方正、两只袖子长度与角度对齐、下摆罗纹平整、光照均匀无高光斑；麻花与菱形织法、军绿色、罗纹结构与右袖织标保留且比原图更清晰，背景提纯为白底带柔和接地投影。\n\n---\n\n## 1、能力边界\n\n| 模板 | 做什么 |\n| --- | --- |\n| 平铺图精修 | 摊平、左右对称、方正肩线、袖长对齐、去褶皱、匀光、纯净背景 |\n| 服装去皱 | 只压平随机褶皱与折痕，保留结构性褶（褶裥、抽绳、垂坠） |\n| 通用精修 | 去画面杂物、匀光、提纯背景、提升清晰度（非服装类目也适用） |\n| 自定义 | 自己描述要修什么 |\n\n| 附加 | 说明 |\n| --- | --- |\n| 多图输入 | 同一商品 1-4 张，模型综合多角度信息理解结构 |\n| 材质增强 | 开关；开启后表面纹理更清晰（等价于 `--quality high`） |\n\n**不做**：不改款式、颜色、图案、五金与结构；不压平结构性褶皱（褶裥、抽绳、荷叶边）；不用于把次品图修成正品图。\n\n---\n\n## 2、输入素材规则\n\n生成前先自检这几条硬性约束：\n\n- 大小：**20KB ~ 15MB**\n- 分辨率：**大于 400×400**\n- 格式：**jpg / jpeg / png / webp**\n\n**输入建议**\n\n| 做法 | 说明 |\n| --- | --- |\n| ✅ 同一商品多角度 | 1-4 张，正面 + 背面 + 细节，模型能更准地推断结构 |\n| ✅ 商品完整入画 | 出画部分只能靠编 |\n| ✅ 光线不要太杂 | 混合色温的光很难匀 |\n| ❌ 商品有明显破损/污渍 | 修图不该掩盖商品缺陷 |\n| ❌ 多个不同商品同框 | 一次只修一个商品 |\n\n---\n\n## 3、四个模板的 prompt 写法\n\n| 模板 | prompt 主体 |\n| --- | --- |\n| 平铺图精修 | `Press out the random wrinkles and creases, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting so there is no hot spot or colour cast.` |\n| 服装去皱 | `Remove only the random wrinkles and packing creases. Preserve every structural fold — pleats, gathers, drawstring ruching and intentional drape must stay exactly as they are.` |\n| 通用精修 | `Remove stray objects, dust and reflections from the frame, even out the lighting, purify the background to a clean seamless [颜色], and raise overall clarity.` |\n| 自定义 | 自己写；建议保留下面的保真句 |\n\n**保真句（四个模板都要带）**：\n\n```text\nKeep the [款式/图案/五金/结构] and the exact [颜色] unchanged and sharper than before.\n```\n\n**背景句**：`Pure white seamless background with a subtle soft contact shadow.`\n\n**去皱的关键区分**：一定要写清「结构性褶皱不许动」，否则百褶裙会被压成一片平板。\n\n---\n\n## 4、工具调用\n\n本技能使用 dLazy 的 **`gpt-image-2`**（图像编辑模型 + `--quality high`；精修要求「结构与颜色零变化、摆放与光照重整」，且支持一次传 1-4 张同商品多视角）。\n\n### 调用方式\n\n两种等价写法，选一种。统一入口会自动选后端、失败重试、建目录落盘、估算成本：\n\n```bash\n# A. 统一入口（推荐）：可切任意后端，加 --dry-run 不计费空跑\nnode scripts/gen.mjs --task item-repair \\\n  --prompt '<见下方 Prompt 模板>' \\\n  --images <按下表顺序> \\\n  --save output/item-repair-<sku>.jpg\n\n# B. 直接用 dLazy CLI（不想引入 Node 依赖时，效果等价）\ndlazy gpt-image-2 --prompt '...' --images ... --save output/item-repair.jpg\n```\n\n**参数约定（本技能固定用法）**\n\n| 参数 | 取值 | 理由 |\n| --- | --- | --- |\n| `--images` | `[图1]` ~ `[图1, 图2, 图3, 图4]`（同一商品多视角） | 对应原站「同一商品 1-4 张」 |\n| `--size` | `1024x1024`（平铺方图）/ `1024x1536`（长款竖版） | 平铺主图通常方图 |\n| `--quality` | `high`（等价「材质增强」开启） | 精修的价值在细节 |\n| `--imageFormat` | `jpeg` | 通用格式 |\n| `--batch` | `2` | 对称化结果有随机性 |\n| `--save` | `docs/item-repair/output-<sku>-retouched.jpg` | 与原图分开归档 |\n\n### Command Examples\n\n```bash\n# basic call: 平铺图精修\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a flat-lay garment photo. Press out the random wrinkles and creases, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting. Keep the pattern, colour, ribbing and label unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. No text.' \\\n  --images docs/item-repair/source-flatlay.jpg \\\n  --size 1024x1024 --quality high\n\n# complex call: 同一商品 4 个视角一起传 + 服装去皱（保留结构褶）\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a garment photo. Images 1-4 are the same product from different angles; use them together to understand the construction. Remove only the random wrinkles and packing creases from the main view. Preserve every structural fold — pleats, gathers, drawstring ruching and intentional drape must stay exactly as they are. Keep the style, colour, print placement, hardware and stitching unchanged and sharper than before. Even out the lighting with no hot spot or colour cast. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text, no watermark.' \\\n  --images docs/item-repair/v1.jpg docs/item-repair/v2.jpg docs/item-repair/v3.jpg docs/item-repair/v4.jpg \\\n  --size 1024x1024 --quality high --imageFormat jpeg \\\n  --batch 2 --save docs/item-repair/output-sku001-retouched.jpg\n\n# 批量精修仓库拍摄的平铺图\nfor f in docs/item-repair/raw/*.jpg; do\n  dlazy gpt-image-2 \\\n    --prompt 'Studio retouch of a flat-lay garment photo. Press out random wrinkles, symmetrise the silhouette, square the shoulders, align both sleeves, tidy collar and hem, even out the lighting. Keep the pattern, colour, hardware and structure unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text.' \\\n    --images \"$f\" --size 1024x1024 --quality high --imageFormat jpeg \\\n    --save \"docs/item-repair/retouched/$(basename $f)\"\ndone\n\n# 先估价不真跑\ndlazy gpt-image-2 --dry-run --prompt '...' --images a.jpg --size 1024x1024 --quality high\n```\n\n### 延伸阅读\n\n| 要查什么 | 去哪 |\n| --- | --- |\n| 认证、多后端配置、输出结构、错误码 | [`references/provider-cli.md`](references/provider-cli.md) |\n| `gpt-image-2` 的全部可用参数 | [`references/model-flags.md`](references/model-flags.md) |\n| 统一入口的全部选项 | `node scripts/gen.mjs --help` |\n\n## 5、Prompt 模板\n\n```text\nStudio retouch of a [品类] product photo.\n[多图时：Images 1-N are the same product from different angles; use them together\nto understand the construction.]\n\n[从第三节选一个模板的 prompt 主体]\n\nKeep the [款式/图案/五金/结构] and the exact [颜色] unchanged and sharper than before.\n\nPure white seamless background with a subtle soft contact shadow.\nPhotorealistic, print-ready, no text, no watermark.\n```\n\n**按问题追加的修正句**\n\n| 问题 | 追加到 prompt 末尾 |\n| --- | --- |\n| 结构褶皱被压平了 | `Do not flatten structural folds: [褶裥/抽绳/荷叶边] must remain fully three-dimensional.` |\n| 修成了另一款 | `The silhouette, seam lines and hardware positions must match the source exactly.` |\n| 背景没提纯 | `The background must be a single flat [颜色] with no gradient, texture or vignette.` |\n| 商品被磨皮 | `Preserve fabric micro-texture; do not smooth the surface into plastic.` |\n| 对称化过头、变形 | `Symmetrise only the layout, not the garment proportions.` |\n| 缺陷被抹掉了 | `Do not remove holes, stains or damage — only fix wrinkles, layout and lighting.` |\n\n---\n\n## 6、执行流程\n\n1. **选模板**（第三节）：平铺精修 / 只去皱 / 通用精修 / 自定义。\n2. **多视角就一起传**：同一商品最多 4 张，模型能更准地理解结构。\n3. **写保真句 + 背景句**；如果商品有结构性褶皱，务必加「不许压平」句。\n4. **`--quality high`** → `--batch 2` 挑图，落盘到 `docs/item-repair/`。\n5. **并排对比原图**：结构褶是否还在、五金位置是否没动、有没有被磨皮、商品缺陷有没有被不当抹除。\n6. **需要面料纹理进一步提升**时，接 [material-enhancement](https://github.com/dlazy-ai/ecommerce-skills/blob/main/skills/material-enhancement/skill.md)。\n\n---\n\n## 7、常见问题\n\n| 现象 | 原因 | 处理 |\n| --- | --- | --- |\n| 百褶/抽绳被压平 | 未区分结构褶 | 追加禁止压平结构褶句 |\n| 修成了另一个款式 | 未锁定结构 | 追加轮廓/缝线/五金位置对齐句 |\n| 表面被磨皮成塑料 | 过度平滑 | 追加保留微观纹理句；`--quality high` |\n| 背景还是有渐变 | 未要求纯色 | 追加单色背景句 |\n| 对称化把版型改窄了 | 过度对称 | 追加「只对称布局不改比例」句 |\n| 商品的破损被抹掉 | 不当修图 | 追加禁止抹除缺陷句——这条是合规红线 |\n\n---\n\n## Tips\n\nVisit https://dlazy.com for more information.\n\nFile v1.0.15:_meta.json\n\n{\n  \"ownerId\": \"kn7c5wgeajfcfvdfb5ceemvdb984cjpd\",\n  \"slug\": \"item-repair\",\n  \"version\": \"1.0.15\",\n  \"publishedAt\": 1790732917618\n}\n\nFile v1.0.15:references/model-flags.md\n\n# `gpt-image-2` 参数清单\r\n\r\n本技能默认用的模型的完整参数。日常只需要「参数约定」里那几个，\r\n这份清单在需要用到非常规参数时再看。\r\n\r\n**CRITICAL INSTRUCTION FOR AGENT**:\r\nRun the `dlazy gpt-image-2` command to get results.\r\n\r\n```bash\r\ndlazy gpt-image-2 -h\r\n\r\nOptions:\r\n  --prompt <prompt>            Prompt\r\n  --images [images...]         Images [image: url or local path] (max 5)\r\n  --size <size>                Size [default: auto] (choices: \"1024x1024\",\r\n                               \"1536x1024\", \"1024x1536\", \"2048x2048\",\r\n                               \"2048x1152\", \"3840x2160\", \"2160x3840\", \"auto\")\r\n  --imageFormat <imageFormat>  Image Format [default: jpeg] (choices: \"jpeg\",\r\n                               \"png\", \"webp\")\r\n  --quality <quality>          Quality [default: medium] (choices: \"low\",\r\n                               \"medium\", \"high\")\r\n  --dry-run                    Print payload without executing the tool\r\n  --no-wait                    Return generateId immediately for async tasks\r\n  --timeout <seconds>          Max seconds to wait for async completion\r\n                               (default: \"1800\")\r\n  --input <jsonOrFile>         Inline JSON or @path/to/file.json — merged under\r\n                               flag values (flags win)\r\n  --save <path>                Download the result asset to this local path\r\n                               (mkdir + retry handled for you). A destination\r\n                               path — NOT a response format; for stdout shape\r\n                               use --format\r\n  --batch <n>                  Fan-out N parallel runs (cloud tools only)\r\n                               (default: \"1\")\r\n  -h, --help                   display help for command\r\n```\r\n\r\n> Any flag also accepts pipe references — `-` (auto-pick from upstream stdin), `@N` (n-th output), `@N.path` (jsonpath into output), `@*` (all primary values), `@stdin` / `@stdin:path` (whole envelope). See `dlazy --help` for details.\r\n\r\n---\r\n\r\n换其他后端时参数由 `scripts/gen.mjs` 统一翻译，见 [`provider-cli.md`](provider-cli.md)。\n\nFile v1.0.15:references/provider-cli.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/provider-cli.md 同步生成，不要直接改这里。 -->\n# 后端调用参考\n\n技能正文只写「要生成什么」。认证、计费、错误码、输出结构这些每个技能都一样的东西放在这里，\n**用到时再读**，不占技能的常驻上下文。\n\n---\n\n## 一、认证\n\n### 默认后端 dLazy\n\n```bash\ndlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入\n```\n\nkey 存在用户配置目录（macOS/Linux `~/.dlazy/config.json`，Windows `%USERPROFILE%\\.dlazy\\config.json`），\n权限限本机用户。也可以每次调用用环境变量 `DLAZY_API_KEY` 传入。\n\n手动获取：登录 [dlazy.com](https://dlazy.com) → [API Key 页面](https://dlazy.com/dashboard/organization/api-key)。\nkey 按组织隔离，可随时轮换或吊销。\n\n### 其他后端\n\n本技能库不锁定单一厂商。配好任意一家的 key 即可跑：\n\n| 后端 | 环境变量 | 说明 |\n| --- | --- | --- |\n| `dlazy` | `dlazy login` 或 `DLAZY_API_KEY` | 默认，最省事 |\n| `openai` | `OPENAI_API_KEY` | 走 `/v1/images/edits` 与 `/v1/images/generations` |\n| `gemini` | `GEMINI_API_KEY` | Nano Banana 系列 |\n| `fal` | `FAL_KEY` | |\n| `replicate` | `REPLICATE_API_TOKEN` | |\n| `ark` | `ARK_API_KEY` + `ARK_MODEL` | 火山方舟，模型 ID 需按开通情况填 |\n\n选路优先级：`--provider` 参数 > `PROVIDER` 环境变量 > 第一个配了 key 的 > `dlazy`。\n\n```bash\nnode scripts/gen.mjs --doctor     # 看当前哪个后端可用\n```\n\n各后端的模型 ID 可用 `GEN_MODEL_OPENAI` / `GEN_MODEL_GEMINI` / `GEN_MODEL_FAL` /\n`GEN_MODEL_REPLICATE` / `GEN_MODEL_ARK` 覆盖。**厂商目录会变，以各家最新文档为准。**\n\n---\n\n## 二、两种调用方式\n\n### 方式 A：统一入口（推荐）\n\n```bash\nnode scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg\n```\n\n它负责：后端选路、默认尺寸档位、失败重试（429/5xx 指数退避）、落盘建目录、成本估算。\n\n```bash\nnode scripts/gen.mjs --task flat-lay --prompt '...' --dry-run   # 不调用不计费，只看要发什么\nnode scripts/gen.mjs --help\n```\n\n### 方式 B：直接用 dLazy CLI\n\n不想引入 Node 依赖时，技能正文里的 `dlazy ...` 命令可以原样执行，效果等价。\n\n```bash\nnpx @dlazy/cli@1.2.3 <command>     # 不装全局二进制\n```\n\n- CLI 源码：[github.com/dlazy-ai/cli](https://github.com/dlazy-ai/cli) · npm 包 `@dlazy/cli`\n\n---\n\n## 三、数据流向\n\n调用 dLazy 时：提示词与参数发往 `api.dlazy.com`；传入的本地图片会上传到 `files.dlazy.com`\n供模型读取；产出 URL 同样托管在 `files.dlazy.com`。这是云端生成 API 的通用形态。\n换成其他后端时，数据流向对应厂商，不经过 dLazy。\n\n---\n\n## 四、输出结构\n\n`gen.mjs`（加 `--json`）：\n\n```json\n{\n  \"ok\": true,\n  \"task\": \"flat-lay\",\n  \"provider\": \"dlazy\",\n  \"model\": \"gpt-image-2\",\n  \"files\": [\"docs/flat-lay/output-sku001.jpg\"],\n  \"texts\": [],\n  \"estimatedCredits\": 60,\n  \"elapsedMs\": 58213\n}\n```\n\ndLazy CLI 原生：\n\n```json\n{\n  \"ok\": true,\n  \"result\": {\n    \"tool\": \"gpt-image-2\",\n    \"data\": { \"urls\": [\"https://files.dlazy.com/data/ai/....jpg\"] },\n    \"savedPath\": \"docs/flat-lay/example-output.jpg\"\n  }\n}\n```\n\n加 `--no-wait` 的异步任务不返回 `data`，返回 `task: { generateId, status }`，\n用 `dlazy status <generateId> --wait` 轮询。\n\n文本类模型（如质检）产出在 `result.data.texts[0]`：\n\n```bash\ndlazy claude-sonnet-5 --prompt '...' --images x.jpg \\\n  | python3 -c 'import sys,json;print(json.load(sys.stdin)[\"result\"][\"data\"][\"texts\"][0])'\n```\n\n---\n\n## 五、错误处理\n\n| Code | 类型 | 示例 |\n| --- | --- | --- |\n| 401 | 未授权 / 无 key | `ok: false, code: \"unauthorized\"` |\n| 501 | 缺必填参数 | `error: required option '--prompt <prompt>' not specified` |\n| 502 | 本地文件读不到 | `Error: Image file not found: ...` |\n| 503 | 余额不足 | `ok: false, code: \"insufficient_balance\"` |\n| 503 | 服务端错误 | `HTTP status code error (500)` |\n| 504 | 异步任务失败 | `=== Generation Failed ===` / `Prompt violates safety policy` |\n\n**给 Agent 的硬性要求**\n\n1. 命中 `insufficient_balance` → 明确告诉用户算力不足，并给出充值入口\n   <https://dlazy.com/dashboard/organization/settings?tab=credits>\n2. 命中 `unauthorized` / 缺 key → 告诉用户去 <https://dlazy.com/dashboard/organization/api-key>\n   取 key，用 `dlazy auth set <key>` 存好再继续。\n3. 用 `gen.mjs` 时，429 与 5xx 已自动重试；仍失败才向用户报错。\n4. **不要**为了「跑通」而偷偷降级参数（尺寸、档位、批量），先问用户。\n\nFile v1.0.15:scripts/lib/tasks.json\n\n{\r\n  \"_note\": \"技能 → 默认模型与参数。dlazy 列为默认后端的模型名；其他后端走 providers.mjs 的通用映射，可用 GEN_MODEL_<PROVIDER> 覆盖。\",\r\n  \"_credits\": { \"gpt-image-2\": 60, \"seedream-5.0\": 30, \"seedream-5.0-pro\": 45, \"banana-pro\": 25, \"claude-sonnet-5\": 3 },\r\n  \"tasks\": {\r\n    \"flat-lay\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"wear-everything\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"image-fusion\":            { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"one-shot\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"fission-pattern\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-detail\":             { \"model\": \"seedream-5.0-pro\", \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"creative-scene\":          { \"model\": \"banana-pro\",       \"size\": \"1024x1536\", \"format\": \"jpeg\" },\r\n    \"batch-image\":             { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"to-3d\":                   { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-extraction\":     { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"fabric-on-body\":          { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-detail\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-grass-planting\": { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-selling-point\":      { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"item-change-background\":  { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"remove-watermark\":        { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"material-enhancement\":    { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"item-repair\":             { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"detect-task\":             { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"listing-optimizer\":       { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"cross-border-localize\":   { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"brand-kit\":               { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"platform-compliance\":     { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"main-image-video\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"product-video-ad\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"ugc-testimonial\":         { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true }\r\n  }\r\n}\n\nFile v1.0.15:skill-card.md\n\n## Description:\n\nRetouches product photos by removing incidental wrinkles, straightening the presentation, evening lighting, and cleaning backgrounds while preserving product details.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[dlazyai](https://clawhub.ai/user/dlazyai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nMerchants and creative teams use the skill to prepare product photos for listings, removing incidental wrinkles and visual clutter without changing the product's actual design or condition.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Product images and prompts are sent to a configured cloud image provider.\n\nMitigation: Use only approved providers and avoid uploading confidential or unreleased commercial assets without authorization.\n\nRisk: Retouching may alter product details or conceal defects, misleading buyers.\n\nMitigation: Compare outputs with original photos and reject changes to design, color, structural folds, damage, or stains before publishing.\n\n## Reference(s):\n\n- [ClawHub item-repair release](https://clawhub.ai/dlazyai/skills/item-repair)\n- [Provider setup and data flow](references/provider-cli.md)\n- [Image model options](references/model-flags.md)\n\n## Skill Output:\n\n**Output Type(s):** [Guidance, Shell commands, Image files]\n\n**Output Format:** [Markdown guidance and locally saved product images, typically JPEG]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Supports one to four views of the same product; compare retouched images with originals before publishing.]\n\n## Skill Version(s):\n\n1.0.15 (source: SKILL.md frontmatter and server-resolved release)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.15:examples/brand.yaml\n\n# ⚠️ 由 scripts/build-skills.mjs 从 shared/examples/brand.yaml 同步生成，不要直接改这里。\r\n# 店铺品牌视觉规范 —— 所有生图技能读这一份，保证几百个 SKU 看起来像同一家店。\r\n#   node scripts/brand.mjs --brand brand.yaml --for flat-lay\r\n#   node scripts/gen.mjs --task flat-lay --brand brand.yaml --prompt '...'\r\n\r\nbrand:\r\n  name: 示例品牌\r\n  # 一句话概括调性，会原样进 prompt\r\n  tone: quiet minimalist, warm and lived-in, never glossy or commercial\r\n\r\nmodel:\r\n  # 锁模特：给一张脸的参考图，所有技能都会把它作为最后一张参考图传入\r\n  reference: assets/model/face-a.jpg\r\n  description: East Asian woman, late twenties, natural makeup, shoulder-length black hair\r\n  body: slim, height around 168cm\r\n\r\nphotography:\r\n  background: seamless off-white studio backdrop, RGB 248 248 246\r\n  lighting: soft large softbox from camera left, gentle fill, no hard shadows\r\n  camera: 85mm equivalent, eye level, shallow depth of field\r\n  grade: neutral white balance around 5200K, low contrast, slightly lifted blacks\r\n  crop: full body with headroom, product centered\r\n\r\nlayout:\r\n  # 给带排版的技能（主图 / 详情页）用\r\n  margin: at least 8% empty margin on all sides\r\n  typeface: clean sans-serif, no decorative fonts\r\n  text_color: near-black on light background\r\n\r\nforbid:\r\n  - no visible brand logos other than the product's own\r\n  - no text or watermark\r\n  - no exaggerated poses or dramatic wind effects\r\n  - no oversaturated colors\r\n\r\n# 可选：把这些直接写进合规目标，生成时就按平台要求出图\r\ncompliance:\r\n  platform: amazon\n\nArchive v1.0.14: 11 files, 25082 bytes\n\nFiles: examples/brand.yaml (1655b), references/model-flags.md (2144b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2015b), SKILL.md (11359b), _meta.json (131b)\n\nFile v1.0.14:SKILL.md\n\n---\nname: item-repair\nversion: 1.0.14\ndescription: 商品精修、去褶皱。随手拍的商品图 → 可直接上架的精修图。当用户说「精修」「去褶皱」「修图」「拍得不好看」「整理一下」时使用。\n---\n\n# item-repair — 一键提升商品图质感\n\n把**随手拍的商品图**修成**可上架的精修图**：压平褶皱、摆正对称、匀光、提纯背景。\n\n和 [material-enhancement](https://github.com/dlazy-ai/ecommerce-skills/blob/main/skills/material-enhancement/skill.md) 的分工：material-enhancement 修**面料纹理**（在模特图上），本技能修**摆放与光照**（在商品图上）。两者可以串起来用。\n\n---\n\n## 生成效果示例\n\n| 输入：原商品图 |\n| --- |\n| <img src=\"https://raw.githubusercontent.com/dlazy-ai/ecommerce-skills/main/docs/item-repair/source-flatlay.jpg\" width=\"280\"> |\n| `source-flatlay.jpg` — 军绿麻花针织毛衣平铺图（袖身有随机褶皱、左右不完全对称），800×800 |\n\n实际执行的命令（平铺图精修 + 材质增强）：\n\n```bash\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a flat-lay garment photo. Clean up this olive-green cable-knit sweater to catalog standard: press out the random wrinkles and creases in the body and sleeves, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting so there is no hot spot or colour cast. Keep the cable-knit and diamond stitch pattern, the exact olive-green colour, the ribbed collar/cuffs/hem and the woven cuff label unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text, no watermark.' \\\n  --images docs/item-repair/source-flatlay.jpg \\\n  --size 1024x1024 --quality high --imageFormat jpeg \\\n  --save docs/item-repair/example-output.jpg\n```\n\n**输出**\n\n<img src=\"https://raw.githubusercontent.com/dlazy-ai/ecommerce-skills/main/docs/item-repair/example-output.jpg\" width=\"320\">\n\n`example-output.jpg` — 1024×1024，60 credits。随机褶皱被压平、肩线方正、两只袖子长度与角度对齐、下摆罗纹平整、光照均匀无高光斑；麻花与菱形织法、军绿色、罗纹结构与右袖织标保留且比原图更清晰，背景提纯为白底带柔和接地投影。\n\n---\n\n## 1、能力边界\n\n| 模板 | 做什么 |\n| --- | --- |\n| 平铺图精修 | 摊平、左右对称、方正肩线、袖长对齐、去褶皱、匀光、纯净背景 |\n| 服装去皱 | 只压平随机褶皱与折痕，保留结构性褶（褶裥、抽绳、垂坠） |\n| 通用精修 | 去画面杂物、匀光、提纯背景、提升清晰度（非服装类目也适用） |\n| 自定义 | 自己描述要修什么 |\n\n| 附加 | 说明 |\n| --- | --- |\n| 多图输入 | 同一商品 1-4 张，模型综合多角度信息理解结构 |\n| 材质增强 | 开关；开启后表面纹理更清晰（等价于 `--quality high`） |\n\n**不做**：不改款式、颜色、图案、五金与结构；不压平结构性褶皱（褶裥、抽绳、荷叶边）；不用于把次品图修成正品图。\n\n---\n\n## 2、输入素材规则\n\n生成前先自检这几条硬性约束：\n\n- 大小：**20KB ~ 15MB**\n- 分辨率：**大于 400×400**\n- 格式：**jpg / jpeg / png / webp**\n\n**输入建议**\n\n| 做法 | 说明 |\n| --- | --- |\n| ✅ 同一商品多角度 | 1-4 张，正面 + 背面 + 细节，模型能更准地推断结构 |\n| ✅ 商品完整入画 | 出画部分只能靠编 |\n| ✅ 光线不要太杂 | 混合色温的光很难匀 |\n| ❌ 商品有明显破损/污渍 | 修图不该掩盖商品缺陷 |\n| ❌ 多个不同商品同框 | 一次只修一个商品 |\n\n---\n\n## 3、四个模板的 prompt 写法\n\n| 模板 | prompt 主体 |\n| --- | --- |\n| 平铺图精修 | `Press out the random wrinkles and creases, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting so there is no hot spot or colour cast.` |\n| 服装去皱 | `Remove only the random wrinkles and packing creases. Preserve every structural fold — pleats, gathers, drawstring ruching and intentional drape must stay exactly as they are.` |\n| 通用精修 | `Remove stray objects, dust and reflections from the frame, even out the lighting, purify the background to a clean seamless [颜色], and raise overall clarity.` |\n| 自定义 | 自己写；建议保留下面的保真句 |\n\n**保真句（四个模板都要带）**：\n\n```text\nKeep the [款式/图案/五金/结构] and the exact [颜色] unchanged and sharper than before.\n```\n\n**背景句**：`Pure white seamless background with a subtle soft contact shadow.`\n\n**去皱的关键区分**：一定要写清「结构性褶皱不许动」，否则百褶裙会被压成一片平板。\n\n---\n\n## 4、工具调用\n\n本技能使用 dLazy 的 **`gpt-image-2`**（图像编辑模型 + `--quality high`；精修要求「结构与颜色零变化、摆放与光照重整」，且支持一次传 1-4 张同商品多视角）。\n\n### 调用方式\n\n两种等价写法，选一种。统一入口会自动选后端、失败重试、建目录落盘、估算成本：\n\n```bash\n# A. 统一入口（推荐）：可切任意后端，加 --dry-run 不计费空跑\nnode scripts/gen.mjs --task item-repair \\\n  --prompt '<见下方 Prompt 模板>' \\\n  --images <按下表顺序> \\\n  --save output/item-repair-<sku>.jpg\n\n# B. 直接用 dLazy CLI（不想引入 Node 依赖时，效果等价）\ndlazy gpt-image-2 --prompt '...' --images ... --save output/item-repair.jpg\n```\n\n**参数约定（本技能固定用法）**\n\n| 参数 | 取值 | 理由 |\n| --- | --- | --- |\n| `--images` | `[图1]` ~ `[图1, 图2, 图3, 图4]`（同一商品多视角） | 对应原站「同一商品 1-4 张」 |\n| `--size` | `1024x1024`（平铺方图）/ `1024x1536`（长款竖版） | 平铺主图通常方图 |\n| `--quality` | `high`（等价「材质增强」开启） | 精修的价值在细节 |\n| `--imageFormat` | `jpeg` | 通用格式 |\n| `--batch` | `2` | 对称化结果有随机性 |\n| `--save` | `docs/item-repair/output-<sku>-retouched.jpg` | 与原图分开归档 |\n\n### Command Examples\n\n```bash\n# basic call: 平铺图精修\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a flat-lay garment photo. Press out the random wrinkles and creases, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting. Keep the pattern, colour, ribbing and label unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. No text.' \\\n  --images docs/item-repair/source-flatlay.jpg \\\n  --size 1024x1024 --quality high\n\n# complex call: 同一商品 4 个视角一起传 + 服装去皱（保留结构褶）\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a garment photo. Images 1-4 are the same product from different angles; use them together to understand the construction. Remove only the random wrinkles and packing creases from the main view. Preserve every structural fold — pleats, gathers, drawstring ruching and intentional drape must stay exactly as they are. Keep the style, colour, print placement, hardware and stitching unchanged and sharper than before. Even out the lighting with no hot spot or colour cast. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text, no watermark.' \\\n  --images docs/item-repair/v1.jpg docs/item-repair/v2.jpg docs/item-repair/v3.jpg docs/item-repair/v4.jpg \\\n  --size 1024x1024 --quality high --imageFormat jpeg \\\n  --batch 2 --save docs/item-repair/output-sku001-retouched.jpg\n\n# 批量精修仓库拍摄的平铺图\nfor f in docs/item-repair/raw/*.jpg; do\n  dlazy gpt-image-2 \\\n    --prompt 'Studio retouch of a flat-lay garment photo. Press out random wrinkles, symmetrise the silhouette, square the shoulders, align both sleeves, tidy collar and hem, even out the lighting. Keep the pattern, colour, hardware and structure unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text.' \\\n    --images \"$f\" --size 1024x1024 --quality high --imageFormat jpeg \\\n    --save \"docs/item-repair/retouched/$(basename $f)\"\ndone\n\n# 先估价不真跑\ndlazy gpt-image-2 --dry-run --prompt '...' --images a.jpg --size 1024x1024 --quality high\n```\n\n### 延伸阅读\n\n| 要查什么 | 去哪 |\n| --- | --- |\n| 认证、多后端配置、输出结构、错误码 | [`references/provider-cli.md`](references/provider-cli.md) |\n| `gpt-image-2` 的全部可用参数 | [`references/model-flags.md`](references/model-flags.md) |\n| 统一入口的全部选项 | `node scripts/gen.mjs --help` |\n\n## 5、Prompt 模板\n\n```text\nStudio retouch of a [品类] product photo.\n[多图时：Images 1-N are the same product from different angles; use them together\nto understand the construction.]\n\n[从第三节选一个模板的 prompt 主体]\n\nKeep the [款式/图案/五金/结构] and the exact [颜色] unchanged and sharper than before.\n\nPure white seamless background with a subtle soft contact shadow.\nPhotorealistic, print-ready, no text, no watermark.\n```\n\n**按问题追加的修正句**\n\n| 问题 | 追加到 prompt 末尾 |\n| --- | --- |\n| 结构褶皱被压平了 | `Do not flatten structural folds: [褶裥/抽绳/荷叶边] must remain fully three-dimensional.` |\n| 修成了另一款 | `The silhouette, seam lines and hardware positions must match the source exactly.` |\n| 背景没提纯 | `The background must be a single flat [颜色] with no gradient, texture or vignette.` |\n| 商品被磨皮 | `Preserve fabric micro-texture; do not smooth the surface into plastic.` |\n| 对称化过头、变形 | `Symmetrise only the layout, not the garment proportions.` |\n| 缺陷被抹掉了 | `Do not remove holes, stains or damage — only fix wrinkles, layout and lighting.` |\n\n---\n\n## 6、执行流程\n\n1. **选模板**（第三节）：平铺精修 / 只去皱 / 通用精修 / 自定义。\n2. **多视角就一起传**：同一商品最多 4 张，模型能更准地理解结构。\n3. **写保真句 + 背景句**；如果商品有结构性褶皱，务必加「不许压平」句。\n4. **`--quality high`** → `--batch 2` 挑图，落盘到 `docs/item-repair/`。\n5. **并排对比原图**：结构褶是否还在、五金位置是否没动、有没有被磨皮、商品缺陷有没有被不当抹除。\n6. **需要面料纹理进一步提升**时，接 [material-enhancement](https://github.com/dlazy-ai/ecommerce-skills/blob/main/skills/material-enhancement/skill.md)。\n\n---\n\n## 7、常见问题\n\n| 现象 | 原因 | 处理 |\n| --- | --- | --- |\n| 百褶/抽绳被压平 | 未区分结构褶 | 追加禁止压平结构褶句 |\n| 修成了另一个款式 | 未锁定结构 | 追加轮廓/缝线/五金位置对齐句 |\n| 表面被磨皮成塑料 | 过度平滑 | 追加保留微观纹理句；`--quality high` |\n| 背景还是有渐变 | 未要求纯色 | 追加单色背景句 |\n| 对称化把版型改窄了 | 过度对称 | 追加「只对称布局不改比例」句 |\n| 商品的破损被抹掉 | 不当修图 | 追加禁止抹除缺陷句——这条是合规红线 |\n\n---\n\n## Tips\n\nVisit https://dlazy.com for more information.\n\nFile v1.0.14:_meta.json\n\n{\n  \"ownerId\": \"kn7c5wgeajfcfvdfb5ceemvdb984cjpd\",\n  \"slug\": \"item-repair\",\n  \"version\": \"1.0.14\",\n  \"publishedAt\": 1790563054144\n}\n\nFile v1.0.14:references/model-flags.md\n\n# `gpt-image-2` 参数清单\r\n\r\n本技能默认用的模型的完整参数。日常只需要「参数约定」里那几个，\r\n这份清单在需要用到非常规参数时再看。\r\n\r\n**CRITICAL INSTRUCTION FOR AGENT**:\r\nRun the `dlazy gpt-image-2` command to get results.\r\n\r\n```bash\r\ndlazy gpt-image-2 -h\r\n\r\nOptions:\r\n  --prompt <prompt>            Prompt\r\n  --images [images...]         Images [image: url or local path] (max 5)\r\n  --size <size>                Size [default: auto] (choices: \"1024x1024\",\r\n                               \"1536x1024\", \"1024x1536\", \"2048x2048\",\r\n                               \"2048x1152\", \"3840x2160\", \"2160x3840\", \"auto\")\r\n  --imageFormat <imageFormat>  Image Format [default: jpeg] (choices: \"jpeg\",\r\n                               \"png\", \"webp\")\r\n  --quality <quality>          Quality [default: medium] (choices: \"low\",\r\n                               \"medium\", \"high\")\r\n  --dry-run                    Print payload without executing the tool\r\n  --no-wait                    Return generateId immediately for async tasks\r\n  --timeout <seconds>          Max seconds to wait for async completion\r\n                               (default: \"1800\")\r\n  --input <jsonOrFile>         Inline JSON or @path/to/file.json — merged under\r\n                               flag values (flags win)\r\n  --save <path>                Download the result asset to this local path\r\n                               (mkdir + retry handled for you). A destination\r\n                               path — NOT a response format; for stdout shape\r\n                               use --format\r\n  --batch <n>                  Fan-out N parallel runs (cloud tools only)\r\n                               (default: \"1\")\r\n  -h, --help                   display help for command\r\n```\r\n\r\n> Any flag also accepts pipe references — `-` (auto-pick from upstream stdin), `@N` (n-th output), `@N.path` (jsonpath into output), `@*` (all primary values), `@stdin` / `@stdin:path` (whole envelope). See `dlazy --help` for details.\r\n\r\n---\r\n\r\n换其他后端时参数由 `scripts/gen.mjs` 统一翻译，见 [`provider-cli.md`](provider-cli.md)。\n\nFile v1.0.14:references/provider-cli.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/provider-cli.md 同步生成，不要直接改这里。 -->\n# 后端调用参考\n\n技能正文只写「要生成什么」。认证、计费、错误码、输出结构这些每个技能都一样的东西放在这里，\n**用到时再读**，不占技能的常驻上下文。\n\n---\n\n## 一、认证\n\n### 默认后端 dLazy\n\n```bash\ndlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入\n```\n\nkey 存在用户配置目录（macOS/Linux `~/.dlazy/config.json`，Windows `%USERPROFILE%\\.dlazy\\config.json`），\n权限限本机用户。也可以每次调用用环境变量 `DLAZY_API_KEY` 传入。\n\n手动获取：登录 [dlazy.com](https://dlazy.com) → [API Key 页面](https://dlazy.com/dashboard/organization/api-key)。\nkey 按组织隔离，可随时轮换或吊销。\n\n### 其他后端\n\n本技能库不锁定单一厂商。配好任意一家的 key 即可跑：\n\n| 后端 | 环境变量 | 说明 |\n| --- | --- | --- |\n| `dlazy` | `dlazy login` 或 `DLAZY_API_KEY` | 默认，最省事 |\n| `openai` | `OPENAI_API_KEY` | 走 `/v1/images/edits` 与 `/v1/images/generations` |\n| `gemini` | `GEMINI_API_KEY` | Nano Banana 系列 |\n| `fal` | `FAL_KEY` | |\n| `replicate` | `REPLICATE_API_TOKEN` | |\n| `ark` | `ARK_API_KEY` + `ARK_MODEL` | 火山方舟，模型 ID 需按开通情况填 |\n\n选路优先级：`--provider` 参数 > `PROVIDER` 环境变量 > 第一个配了 key 的 > `dlazy`。\n\n```bash\nnode scripts/gen.mjs --doctor     # 看当前哪个后端可用\n```\n\n各后端的模型 ID 可用 `GEN_MODEL_OPENAI` / `GEN_MODEL_GEMINI` / `GEN_MODEL_FAL` /\n`GEN_MODEL_REPLICATE` / `GEN_MODEL_ARK` 覆盖。**厂商目录会变，以各家最新文档为准。**\n\n---\n\n## 二、两种调用方式\n\n### 方式 A：统一入口（推荐）\n\n```bash\nnode scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg\n```\n\n它负责：后端选路、默认尺寸档位、失败重试（429/5xx 指数退避）、落盘建目录、成本估算。\n\n```bash\nnode scripts/gen.mjs --task flat-lay --prompt '...' --dry-run   # 不调用不计费，只看要发什么\nnode scripts/gen.mjs --help\n```\n\n### 方式 B：直接用 dLazy CLI\n\n不想引入 Node 依赖时，技能正文里的 `dlazy ...` 命令可以原样执行，效果等价。\n\n```bash\nnpx @dlazy/cli@1.2.3 <command>     # 不装全局二进制\n```\n\n- CLI 源码：[github.com/dlazy-ai/cli](https://github.com/dlazy-ai/cli) · npm 包 `@dlazy/cli`\n\n---\n\n## 三、数据流向\n\n调用 dLazy 时：提示词与参数发往 `api.dlazy.com`；传入的本地图片会上传到 `files.dlazy.com`\n供模型读取；产出 URL 同样托管在 `files.dlazy.com`。这是云端生成 API 的通用形态。\n换成其他后端时，数据流向对应厂商，不经过 dLazy。\n\n---\n\n## 四、输出结构\n\n`gen.mjs`（加 `--json`）：\n\n```json\n{\n  \"ok\": true,\n  \"task\": \"flat-lay\",\n  \"provider\": \"dlazy\",\n  \"model\": \"gpt-image-2\",\n  \"files\": [\"docs/flat-lay/output-sku001.jpg\"],\n  \"texts\": [],\n  \"estimatedCredits\": 60,\n  \"elapsedMs\": 58213\n}\n```\n\ndLazy CLI 原生：\n\n```json\n{\n  \"ok\": true,\n  \"result\": {\n    \"tool\": \"gpt-image-2\",\n    \"data\": { \"urls\": [\"https://files.dlazy.com/data/ai/....jpg\"] },\n    \"savedPath\": \"docs/flat-lay/example-output.jpg\"\n  }\n}\n```\n\n加 `--no-wait` 的异步任务不返回 `data`，返回 `task: { generateId, status }`，\n用 `dlazy status <generateId> --wait` 轮询。\n\n文本类模型（如质检）产出在 `result.data.texts[0]`：\n\n```bash\ndlazy claude-sonnet-5 --prompt '...' --images x.jpg \\\n  | python3 -c 'import sys,json;print(json.load(sys.stdin)[\"result\"][\"data\"][\"texts\"][0])'\n```\n\n---\n\n## 五、错误处理\n\n| Code | 类型 | 示例 |\n| --- | --- | --- |\n| 401 | 未授权 / 无 key | `ok: false, code: \"unauthorized\"` |\n| 501 | 缺必填参数 | `error: required option '--prompt <prompt>' not specified` |\n| 502 | 本地文件读不到 | `Error: Image file not found: ...` |\n| 503 | 余额不足 | `ok: false, code: \"insufficient_balance\"` |\n| 503 | 服务端错误 | `HTTP status code error (500)` |\n| 504 | 异步任务失败 | `=== Generation Failed ===` / `Prompt violates safety policy` |\n\n**给 Agent 的硬性要求**\n\n1. 命中 `insufficient_balance` → 明确告诉用户算力不足，并给出充值入口\n   <https://dlazy.com/dashboard/organization/settings?tab=credits>\n2. 命中 `unauthorized` / 缺 key → 告诉用户去 <https://dlazy.com/dashboard/organization/api-key>\n   取 key，用 `dlazy auth set <key>` 存好再继续。\n3. 用 `gen.mjs` 时，429 与 5xx 已自动重试；仍失败才向用户报错。\n4. **不要**为了「跑通」而偷偷降级参数（尺寸、档位、批量），先问用户。\n\nFile v1.0.14:scripts/lib/tasks.json\n\n{\r\n  \"_note\": \"技能 → 默认模型与参数。dlazy 列为默认后端的模型名；其他后端走 providers.mjs 的通用映射，可用 GEN_MODEL_<PROVIDER> 覆盖。\",\r\n  \"_credits\": { \"gpt-image-2\": 60, \"seedream-5.0\": 30, \"seedream-5.0-pro\": 45, \"banana-pro\": 25, \"claude-sonnet-5\": 3 },\r\n  \"tasks\": {\r\n    \"flat-lay\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"wear-everything\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"image-fusion\":            { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"one-shot\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"fission-pattern\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-detail\":             { \"model\": \"seedream-5.0-pro\", \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"creative-scene\":          { \"model\": \"banana-pro\",       \"size\": \"1024x1536\", \"format\": \"jpeg\" },\r\n    \"batch-image\":             { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"to-3d\":                   { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-extraction\":     { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"fabric-on-body\":          { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-detail\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-grass-planting\": { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-selling-point\":      { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"item-change-background\":  { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"remove-watermark\":        { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"material-enhancement\":    { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"item-repair\":             { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"detect-task\":             { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"listing-optimizer\":       { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"cross-border-localize\":   { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"brand-kit\":               { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"platform-compliance\":     { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"main-image-video\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"product-video-ad\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"ugc-testimonial\":         { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true }\r\n  }\r\n}\n\nFile v1.0.14:skill-card.md\n\n## Description:\n\nRetouches product photos for listings by reducing incidental wrinkles, straightening presentation, evening lighting, and cleaning backgrounds while preserving product details.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[dlazyai](https://clawhub.ai/user/dlazyai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nE-commerce sellers and creative teams use this skill to prepare product photos for listings, removing incidental creases and visual distractions without changing the product itself.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Product images and prompts are sent to dLazy or a configured cloud image provider.\n\nMitigation: Use only images approved for that provider and account; avoid confidential photos unless the provider settings are appropriate.\n\nRisk: Retouching can alter structural folds, colors, or visible defects and misrepresent the product.\n\nMitigation: Provide explicit source photos and preservation instructions, then compare every result with the original before publishing.\n\n## Reference(s):\n\n- [Item Repair skill release](https://clawhub.ai/dlazyai/skills/item-repair)\n- [Provider and data-flow guidance](references/provider-cli.md)\n- [Image model parameters](references/model-flags.md)\n\n## Skill Output:\n\n**Output Type(s):** [Guidance, Shell commands, Image files]\n\n**Output Format:** [Markdown guidance and commands; locally saved product images when run]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Image size, format, quality and batch count are configurable; review results against source photos before publishing.]\n\n## Skill Version(s):\n\n1.0.14 (source: server-resolved release and skill frontmatter)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.14:examples/brand.yaml\n\n# ⚠️ 由 scripts/build-skills.mjs 从 shared/examples/brand.yaml 同步生成，不要直接改这里。\r\n# 店铺品牌视觉规范 —— 所有生图技能读这一份，保证几百个 SKU 看起来像同一家店。\r\n#   node scripts/brand.mjs --brand brand.yaml --for flat-lay\r\n#   node scripts/gen.mjs --task flat-lay --brand brand.yaml --prompt '...'\r\n\r\nbrand:\r\n  name: 示例品牌\r\n  # 一句话概括调性，会原样进 prompt\r\n  tone: quiet minimalist, warm and lived-in, never glossy or commercial\r\n\r\nmodel:\r\n  # 锁模特：给一张脸的参考图，所有技能都会把它作为最后一张参考图传入\r\n  reference: assets/model/face-a.jpg\r\n  description: East Asian woman, late twenties, natural makeup, shoulder-length black hair\r\n  body: slim, height around 168cm\r\n\r\nphotography:\r\n  background: seamless off-white studio backdrop, RGB 248 248 246\r\n  lighting: soft large softbox from camera left, gentle fill, no hard shadows\r\n  camera: 85mm equivalent, eye level, shallow depth of field\r\n  grade: neutral white balance around 5200K, low contrast, slightly lifted blacks\r\n  crop: full body with headroom, product centered\r\n\r\nlayout:\r\n  # 给带排版的技能（主图 / 详情页）用\r\n  margin: at least 8% empty margin on all sides\r\n  typeface: clean sans-serif, no decorative fonts\r\n  text_color: near-black on light background\r\n\r\nforbid:\r\n  - no visible brand logos other than the product's own\r\n  - no text or watermark\r\n  - no exaggerated poses or dramatic wind effects\r\n  - no oversaturated colors\r\n\r\n# 可选：把这些直接写进合规目标，生成时就按平台要求出图\r\ncompliance:\r\n  platform: amazon\n\nArchive v1.0.13: 11 files, 25295 bytes\n\nFiles: examples/brand.yaml (1655b), references/model-flags.md (2144b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2518b), SKILL.md (11359b), _meta.json (131b)\n\nFile v1.0.13:SKILL.md\n\n---\nname: item-repair\nversion: 1.0.13\ndescription: 商品精修、去褶皱。随手拍的商品图 → 可直接上架的精修图。当用户说「精修」「去褶皱」「修图」「拍得不好看」「整理一下」时使用。\n---\n\n# item-repair — 一键提升商品图质感\n\n把**随手拍的商品图**修成**可上架的精修图**：压平褶皱、摆正对称、匀光、提纯背景。\n\n和 [material-enhancement](https://github.com/dlazy-ai/ecommerce-skills/blob/main/skills/material-enhancement/skill.md) 的分工：material-enhancement 修**面料纹理**（在模特图上），本技能修**摆放与光照**（在商品图上）。两者可以串起来用。\n\n---\n\n## 生成效果示例\n\n| 输入：原商品图 |\n| --- |\n| <img src=\"https://raw.githubusercontent.com/dlazy-ai/ecommerce-skills/main/docs/item-repair/source-flatlay.jpg\" width=\"280\"> |\n| `source-flatlay.jpg` — 军绿麻花针织毛衣平铺图（袖身有随机褶皱、左右不完全对称），800×800 |\n\n实际执行的命令（平铺图精修 + 材质增强）：\n\n```bash\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a flat-lay garment photo. Clean up this olive-green cable-knit sweater to catalog standard: press out the random wrinkles and creases in the body and sleeves, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting so there is no hot spot or colour cast. Keep the cable-knit and diamond stitch pattern, the exact olive-green colour, the ribbed collar/cuffs/hem and the woven cuff label unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text, no watermark.' \\\n  --images docs/item-repair/source-flatlay.jpg \\\n  --size 1024x1024 --quality high --imageFormat jpeg \\\n  --save docs/item-repair/example-output.jpg\n```\n\n**输出**\n\n<img src=\"https://raw.githubusercontent.com/dlazy-ai/ecommerce-skills/main/docs/item-repair/example-output.jpg\" width=\"320\">\n\n`example-output.jpg` — 1024×1024，60 credits。随机褶皱被压平、肩线方正、两只袖子长度与角度对齐、下摆罗纹平整、光照均匀无高光斑；麻花与菱形织法、军绿色、罗纹结构与右袖织标保留且比原图更清晰，背景提纯为白底带柔和接地投影。\n\n---\n\n## 1、能力边界\n\n| 模板 | 做什么 |\n| --- | --- |\n| 平铺图精修 | 摊平、左右对称、方正肩线、袖长对齐、去褶皱、匀光、纯净背景 |\n| 服装去皱 | 只压平随机褶皱与折痕，保留结构性褶（褶裥、抽绳、垂坠） |\n| 通用精修 | 去画面杂物、匀光、提纯背景、提升清晰度（非服装类目也适用） |\n| 自定义 | 自己描述要修什么 |\n\n| 附加 | 说明 |\n| --- | --- |\n| 多图输入 | 同一商品 1-4 张，模型综合多角度信息理解结构 |\n| 材质增强 | 开关；开启后表面纹理更清晰（等价于 `--quality high`） |\n\n**不做**：不改款式、颜色、图案、五金与结构；不压平结构性褶皱（褶裥、抽绳、荷叶边）；不用于把次品图修成正品图。\n\n---\n\n## 2、输入素材规则\n\n生成前先自检这几条硬性约束：\n\n- 大小：**20KB ~ 15MB**\n- 分辨率：**大于 400×400**\n- 格式：**jpg / jpeg / png / webp**\n\n**输入建议**\n\n| 做法 | 说明 |\n| --- | --- |\n| ✅ 同一商品多角度 | 1-4 张，正面 + 背面 + 细节，模型能更准地推断结构 |\n| ✅ 商品完整入画 | 出画部分只能靠编 |\n| ✅ 光线不要太杂 | 混合色温的光很难匀 |\n| ❌ 商品有明显破损/污渍 | 修图不该掩盖商品缺陷 |\n| ❌ 多个不同商品同框 | 一次只修一个商品 |\n\n---\n\n## 3、四个模板的 prompt 写法\n\n| 模板 | prompt 主体 |\n| --- | --- |\n| 平铺图精修 | `Press out the random wrinkles and creases, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting so there is no hot spot or colour cast.` |\n| 服装去皱 | `Remove only the random wrinkles and packing creases. Preserve every structural fold — pleats, gathers, drawstring ruching and intentional drape must stay exactly as they are.` |\n| 通用精修 | `Remove stray objects, dust and reflections from the frame, even out the lighting, purify the background to a clean seamless [颜色], and raise overall clarity.` |\n| 自定义 | 自己写；建议保留下面的保真句 |\n\n**保真句（四个模板都要带）**：\n\n```text\nKeep the [款式/图案/五金/结构] and the exact [颜色] unchanged and sharper than before.\n```\n\n**背景句**：`Pure white seamless background with a subtle soft contact shadow.`\n\n**去皱的关键区分**：一定要写清「结构性褶皱不许动」，否则百褶裙会被压成一片平板。\n\n---\n\n## 4、工具调用\n\n本技能使用 dLazy 的 **`gpt-image-2`**（图像编辑模型 + `--quality high`；精修要求「结构与颜色零变化、摆放与光照重整」，且支持一次传 1-4 张同商品多视角）。\n\n### 调用方式\n\n两种等价写法，选一种。统一入口会自动选后端、失败重试、建目录落盘、估算成本：\n\n```bash\n# A. 统一入口（推荐）：可切任意后端，加 --dry-run 不计费空跑\nnode scripts/gen.mjs --task item-repair \\\n  --prompt '<见下方 Prompt 模板>' \\\n  --images <按下表顺序> \\\n  --save output/item-repair-<sku>.jpg\n\n# B. 直接用 dLazy CLI（不想引入 Node 依赖时，效果等价）\ndlazy gpt-image-2 --prompt '...' --images ... --save output/item-repair.jpg\n```\n\n**参数约定（本技能固定用法）**\n\n| 参数 | 取值 | 理由 |\n| --- | --- | --- |\n| `--images` | `[图1]` ~ `[图1, 图2, 图3, 图4]`（同一商品多视角） | 对应原站「同一商品 1-4 张」 |\n| `--size` | `1024x1024`（平铺方图）/ `1024x1536`（长款竖版） | 平铺主图通常方图 |\n| `--quality` | `high`（等价「材质增强」开启） | 精修的价值在细节 |\n| `--imageFormat` | `jpeg` | 通用格式 |\n| `--batch` | `2` | 对称化结果有随机性 |\n| `--save` | `docs/item-repair/output-<sku>-retouched.jpg` | 与原图分开归档 |\n\n### Command Examples\n\n```bash\n# basic call: 平铺图精修\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a flat-lay garment photo. Press out the random wrinkles and creases, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting. Keep the pattern, colour, ribbing and label unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. No text.' \\\n  --images docs/item-repair/source-flatlay.jpg \\\n  --size 1024x1024 --quality high\n\n# complex call: 同一商品 4 个视角一起传 + 服装去皱（保留结构褶）\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a garment photo. Images 1-4 are the same product from different angles; use them together to understand the construction. Remove only the random wrinkles and packing creases from the main view. Preserve every structural fold — pleats, gathers, drawstring ruching and intentional drape must stay exactly as they are. Keep the style, colour, print placement, hardware and stitching unchanged and sharper than before. Even out the lighting with no hot spot or colour cast. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text, no watermark.' \\\n  --images docs/item-repair/v1.jpg docs/item-repair/v2.jpg docs/item-repair/v3.jpg docs/item-repair/v4.jpg \\\n  --size 1024x1024 --quality high --imageFormat jpeg \\\n  --batch 2 --save docs/item-repair/output-sku001-retouched.jpg\n\n# 批量精修仓库拍摄的平铺图\nfor f in docs/item-repair/raw/*.jpg; do\n  dlazy gpt-image-2 \\\n    --prompt 'Studio retouch of a flat-lay garment photo. Press out random wrinkles, symmetrise the silhouette, square the shoulders, align both sleeves, tidy collar and hem, even out the lighting. Keep the pattern, colour, hardware and structure unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text.' \\\n    --images \"$f\" --size 1024x1024 --quality high --imageFormat jpeg \\\n    --save \"docs/item-repair/retouched/$(basename $f)\"\ndone\n\n# 先估价不真跑\ndlazy gpt-image-2 --dry-run --prompt '...' --images a.jpg --size 1024x1024 --quality high\n```\n\n### 延伸阅读\n\n| 要查什么 | 去哪 |\n| --- | --- |\n| 认证、多后端配置、输出结构、错误码 | [`references/provider-cli.md`](references/provider-cli.md) |\n| `gpt-image-2` 的全部可用参数 | [`references/model-flags.md`](references/model-flags.md) |\n| 统一入口的全部选项 | `node scripts/gen.mjs --help` |\n\n## 5、Prompt 模板\n\n```text\nStudio retouch of a [品类] product photo.\n[多图时：Images 1-N are the same product from different angles; use them together\nto understand the construction.]\n\n[从第三节选一个模板的 prompt 主体]\n\nKeep the [款式/图案/五金/结构] and the exact [颜色] unchanged and sharper than before.\n\nPure white seamless background with a subtle soft contact shadow.\nPhotorealistic, print-ready, no text, no watermark.\n```\n\n**按问题追加的修正句**\n\n| 问题 | 追加到 prompt 末尾 |\n| --- | --- |\n| 结构褶皱被压平了 | `Do not flatten structural folds: [褶裥/抽绳/荷叶边] must remain fully three-dimensional.` |\n| 修成了另一款 | `The silhouette, seam lines and hardware positions must match the source exactly.` |\n| 背景没提纯 | `The background must be a single flat [颜色] with no gradient, texture or vignette.` |\n| 商品被磨皮 | `Preserve fabric micro-texture; do not smooth the surface into plastic.` |\n| 对称化过头、变形 | `Symmetrise only the layout, not the garment proportions.` |\n| 缺陷被抹掉了 | `Do not remove holes, stains or damage — only fix wrinkles, layout and lighting.` |\n\n---\n\n## 6、执行流程\n\n1. **选模板**（第三节）：平铺精修 / 只去皱 / 通用精修 / 自定义。\n2. **多视角就一起传**：同一商品最多 4 张，模型能更准地理解结构。\n3. **写保真句 + 背景句**；如果商品有结构性褶皱，务必加「不许压平」句。\n4. **`--quality high`** → `--batch 2` 挑图，落盘到 `docs/item-repair/`。\n5. **并排对比原图**：结构褶是否还在、五金位置是否没动、有没有被磨皮、商品缺陷有没有被不当抹除。\n6. **需要面料纹理进一步提升**时，接 [material-enhancement](https://github.com/dlazy-ai/ecommerce-skills/blob/main/skills/material-enhancement/skill.md)。\n\n---\n\n## 7、常见问题\n\n| 现象 | 原因 | 处理 |\n| --- | --- | --- |\n| 百褶/抽绳被压平 | 未区分结构褶 | 追加禁止压平结构褶句 |\n| 修成了另一个款式 | 未锁定结构 | 追加轮廓/缝线/五金位置对齐句 |\n| 表面被磨皮成塑料 | 过度平滑 | 追加保留微观纹理句；`--quality high` |\n| 背景还是有渐变 | 未要求纯色 | 追加单色背景句 |\n| 对称化把版型改窄了 | 过度对称 | 追加「只对称布局不改比例」句 |\n| 商品的破损被抹掉 | 不当修图 | 追加禁止抹除缺陷句——这条是合规红线 |\n\n---\n\n## Tips\n\nVisit https://dlazy.com for more information.\n\nFile v1.0.13:_meta.json\n\n{\n  \"ownerId\": \"kn7c5wgeajfcfvdfb5ceemvdb984cjpd\",\n  \"slug\": \"item-repair\",\n  \"version\": \"1.0.13\",\n  \"publishedAt\": 1790217545546\n}\n\nFile v1.0.13:references/model-flags.md\n\n# `gpt-image-2` 参数清单\r\n\r\n本技能默认用的模型的完整参数。日常只需要「参数约定」里那几个，\r\n这份清单在需要用到非常规参数时再看。\r\n\r\n**CRITICAL INSTRUCTION FOR AGENT**:\r\nRun the `dlazy gpt-image-2` command to get results.\r\n\r\n```bash\r\ndlazy gpt-image-2 -h\r\n\r\nOptions:\r\n  --prompt <prompt>            Prompt\r\n  --images [images...]         Images [image: url or local path] (max 5)\r\n  --size <size>                Size [default: auto] (choices: \"1024x1024\",\r\n                               \"1536x1024\", \"1024x1536\", \"2048x2048\",\r\n                               \"2048x1152\", \"3840x2160\", \"2160x3840\", \"auto\")\r\n  --imageFormat <imageFormat>  Image Format [default: jpeg] (choices: \"jpeg\",\r\n                               \"png\", \"webp\")\r\n  --quality <quality>          Quality [default: medium] (choices: \"low\",\r\n                               \"medium\", \"high\")\r\n  --dry-run                    Print payload without executing the tool\r\n  --no-wait                    Return generateId immediately for async tasks\r\n  --timeout <seconds>          Max seconds to wait for async completion\r\n                               (default: \"1800\")\r\n  --input <jsonOrFile>         Inline JSON or @path/to/file.json — merged under\r\n                               flag values (flags win)\r\n  --save <path>                Download the result asset to this local path\r\n                               (mkdir + retry handled for you). A destination\r\n                               path — NOT a response format; for stdout shape\r\n                               use --format\r\n  --batch <n>                  Fan-out N parallel runs (cloud tools only)\r\n                               (default: \"1\")\r\n  -h, --help                   display help for command\r\n```\r\n\r\n> Any flag also accepts pipe references — `-` (auto-pick from upstream stdin), `@N` (n-th output), `@N.path` (jsonpath into output), `@*` (all primary values), `@stdin` / `@stdin:path` (whole envelope). See `dlazy --help` for details.\r\n\r\n---\r\n\r\n换其他后端时参数由 `scripts/gen.mjs` 统一翻译，见 [`provider-cli.md`](provider-cli.md)。\n\nFile v1.0.13:references/provider-cli.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/provider-cli.md 同步生成，不要直接改这里。 -->\n# 后端调用参考\n\n技能正文只写「要生成什么」。认证、计费、错误码、输出结构这些每个技能都一样的东西放在这里，\n**用到时再读**，不占技能的常驻上下文。\n\n---\n\n## 一、认证\n\n### 默认后端 dLazy\n\n```bash\ndlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入\n```\n\nkey 存在用户配置目录（macOS/Linux `~/.dlazy/config.json`，Windows `%USERPROFILE%\\.dlazy\\config.json`），\n权限限本机用户。也可以每次调用用环境变量 `DLAZY_API_KEY` 传入。\n\n手动获取：登录 [dlazy.com](https://dlazy.com) → [API Key 页面](https://dlazy.com/dashboard/organization/api-key)。\nkey 按组织隔离，可随时轮换或吊销。\n\n### 其他后端\n\n本技能库不锁定单一厂商。配好任意一家的 key 即可跑：\n\n| 后端 | 环境变量 | 说明 |\n| --- | --- | --- |\n| `dlazy` | `dlazy login` 或 `DLAZY_API_KEY` | 默认，最省事 |\n| `openai` | `OPENAI_API_KEY` | 走 `/v1/images/edits` 与 `/v1/images/generations` |\n| `gemini` | `GEMINI_API_KEY` | Nano Banana 系列 |\n| `fal` | `FAL_KEY` | |\n| `replicate` | `REPLICATE_API_TOKEN` | |\n| `ark` | `ARK_API_KEY` + `ARK_MODEL` | 火山方舟，模型 ID 需按开通情况填 |\n\n选路优先级：`--provider` 参数 > `PROVIDER` 环境变量 > 第一个配了 key 的 > `dlazy`。\n\n```bash\nnode scripts/gen.mjs --doctor     # 看当前哪个后端可用\n```\n\n各后端的模型 ID 可用 `GEN_MODEL_OPENAI` / `GEN_MODEL_GEMINI` / `GEN_MODEL_FAL` /\n`GEN_MODEL_REPLICATE` / `GEN_MODEL_ARK` 覆盖。**厂商目录会变，以各家最新文档为准。**\n\n---\n\n## 二、两种调用方式\n\n### 方式 A：统一入口（推荐）\n\n```bash\nnode scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg\n```\n\n它负责：后端选路、默认尺寸档位、失败重试（429/5xx 指数退避）、落盘建目录、成本估算。\n\n```bash\nnode scripts/gen.mjs --task flat-lay --prompt '...' --dry-run   # 不调用不计费，只看要发什么\nnode scripts/gen.mjs --help\n```\n\n### 方式 B：直接用 dLazy CLI\n\n不想引入 Node 依赖时，技能正文里的 `dlazy ...` 命令可以原样执行，效果等价。\n\n```bash\nnpx @dlazy/cli@1.2.3 <command>     # 不装全局二进制\n```\n\n- CLI 源码：[github.com/dlazy-ai/cli](https://github.com/dlazy-ai/cli) · npm 包 `@dlazy/cli`\n\n---\n\n## 三、数据流向\n\n调用 dLazy 时：提示词与参数发往 `api.dlazy.com`；传入的本地图片会上传到 `files.dlazy.com`\n供模型读取；产出 URL 同样托管在 `files.dlazy.com`。这是云端生成 API 的通用形态。\n换成其他后端时，数据流向对应厂商，不经过 dLazy。\n\n---\n\n## 四、输出结构\n\n`gen.mjs`（加 `--json`）：\n\n```json\n{\n  \"ok\": true,\n  \"task\": \"flat-lay\",\n  \"provider\": \"dlazy\",\n  \"model\": \"gpt-image-2\",\n  \"files\": [\"docs/flat-lay/output-sku001.jpg\"],\n  \"texts\": [],\n  \"estimatedCredits\": 60,\n  \"elapsedMs\": 58213\n}\n```\n\ndLazy CLI 原生：\n\n```json\n{\n  \"ok\": true,\n  \"result\": {\n    \"tool\": \"gpt-image-2\",\n    \"data\": { \"urls\": [\"https://files.dlazy.com/data/ai/....jpg\"] },\n    \"savedPath\": \"docs/flat-lay/example-output.jpg\"\n  }\n}\n```\n\n加 `--no-wait` 的异步任务不返回 `data`，返回 `task: { generateId, status }`，\n用 `dlazy status <generateId> --wait` 轮询。\n\n文本类模型（如质检）产出在 `result.data.texts[0]`：\n\n```bash\ndlazy claude-sonnet-5 --prompt '...' --images x.jpg \\\n  | python3 -c 'import sys,json;print(json.load(sys.stdin)[\"result\"][\"data\"][\"texts\"][0])'\n```\n\n---\n\n## 五、错误处理\n\n| Code | 类型 | 示例 |\n| --- | --- | --- |\n| 401 | 未授权 / 无 key | `ok: false, code: \"unauthorized\"` |\n| 501 | 缺必填参数 | `error: required option '--prompt <prompt>' not specified` |\n| 502 | 本地文件读不到 | `Error: Image file not found: ...` |\n| 503 | 余额不足 | `ok: false, code: \"insufficient_balance\"` |\n| 503 | 服务端错误 | `HTTP status code error (500)` |\n| 504 | 异步任务失败 | `=== Generation Failed ===` / `Prompt violates safety policy` |\n\n**给 Agent 的硬性要求**\n\n1. 命中 `insufficient_balance` → 明确告诉用户算力不足，并给出充值入口\n   <https://dlazy.com/dashboard/organization/settings?tab=credits>\n2. 命中 `unauthorized` / 缺 key → 告诉用户去 <https://dlazy.com/dashboard/organization/api-key>\n   取 key，用 `dlazy auth set <key>` 存好再继续。\n3. 用 `gen.mjs` 时，429 与 5xx 已自动重试；仍失败才向用户报错。\n4. **不要**为了「跑通」而偷偷降级参数（尺寸、档位、批量），先问用户。\n\nFile v1.0.13:scripts/lib/tasks.json\n\n{\r\n  \"_note\": \"技能 → 默认模型与参数。dlazy 列为默认后端的模型名；其他后端走 providers.mjs 的通用映射，可用 GEN_MODEL_<PROVIDER> 覆盖。\",\r\n  \"_credits\": { \"gpt-image-2\": 60, \"seedream-5.0\": 30, \"seedream-5.0-pro\": 45, \"banana-pro\": 25, \"claude-sonnet-5\": 3 },\r\n  \"tasks\": {\r\n    \"flat-lay\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"wear-everything\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"image-fusion\":            { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"one-shot\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"fission-pattern\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-detail\":             { \"model\": \"seedream-5.0-pro\", \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"creative-scene\":          { \"model\": \"banana-pro\",       \"size\": \"1024x1536\", \"format\": \"jpeg\" },\r\n    \"batch-image\":             { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"to-3d\":                   { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-extraction\":     { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"fabric-on-body\":          { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-detail\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-grass-planting\": { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-selling-point\":      { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"item-change-background\":  { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"remove-watermark\":        { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"material-enhancement\":    { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"item-repair\":             { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"detect-task\":             { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"listing-optimizer\":       { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"cross-border-localize\":   { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"brand-kit\":               { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"platform-compliance\":     { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"main-image-video\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"product-video-ad\":        { \"model\": \"$DLAZY_V\n\nArchive v1.0.12: 11 files, 25464 bytes\n\nFiles: examples/brand.yaml (1655b), references/model-flags.md (2144b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2678b), SKILL.md (11359b), _meta.json (131b)\n\nArchive v1.0.11: 11 files, 25356 bytes\n\nFiles: examples/brand.yaml (1655b), references/model-flags.md (2144b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2581b), SKILL.md (11359b), _meta.json (131b)\n\nArchive v1.0.10: 11 files, 25510 bytes\n\nFiles: examples/brand.yaml (1655b), references/model-flags.md (2144b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2863b), SKILL.md (11359b), _meta.json (131b)","readmeExcerpt":"Skill: 商品图精修 Item Repair Owner: dlazyai Summary: 商品精修、去褶皱。随手拍的商品图 → 可直接上架的精修图。当用户说「精修」「去褶皱」「修图」「拍得不好看」「整理一下」时使用。 Tags: latest:1.0.19 Version history: v1.0.19 | 2026-10-10T01:52:09.773Z | user 例行版本更新 2026-10-10 v1.0.18 | 2026-10-08T01:44:34.406Z | user 例行版本更新 2026-10-08 v1.0.17 | 2026-10-04T01:44:34.062Z | user 例行版本更新 2026-10-04 v1.0.16 | 2026-10-02T05:17:03.280Z | user 例行版本更新 2026-10-02 v1.0.15 | 2026-09-30T01:48:37.","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"dlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a flat-lay garment photo. Clean up this olive-green cable-knit sweater to catalog standard: press out the random wrinkles and creases in the body and sleeves, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting so there is no hot spot or colour cast. Keep the cable-knit and diamond stitch pattern, the exact olive-green colour, the ribbed collar/cuffs/hem and the woven cuff label unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text, no watermark.' \\\n  --images docs/item-repair/source-flatlay.jpg \\\n  --size 1024x1024 --quality high --imageFormat jpeg \\\n  --save docs/item-repair/example-output.jpg"},{"language":"text","snippet":"Keep the [款式/图案/五金/结构] and the exact [颜色] unchanged and sharper than before."},{"language":"bash","snippet":"# A. 统一入口（推荐）：可切任意后端，加 --dry-run 不计费空跑\nnode scripts/gen.mjs --task item-repair \\\n  --prompt '<见下方 Prompt 模板>' \\\n  --images <按下表顺序> \\\n  --save output/item-repair-<sku>.jpg\n\n# B. 直接用 dLazy CLI（不想引入 Node 依赖时，效果等价）\ndlazy gpt-image-2 --prompt '...' --images ... --save output/item-repair.jpg"},{"language":"bash","snippet":"# basic call: 平铺图精修\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a flat-lay garment photo. Press out the random wrinkles and creases, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting. Keep the pattern, colour, ribbing and label unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. No text.' \\\n  --images docs/item-repair/source-flatlay.jpg \\\n  --size 1024x1024 --quality high\n\n# complex call: 同一商品 4 个视角一起传 + 服装去皱（保留结构褶）\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a garment photo. Images 1-4 are the same product from different angles; use them together to understand the construction. Remove only the random wrinkles and packing creases from the main view. Preserve every structural fold — pleats, gathers, drawstring ruching and intentional drape must stay exactly as they are. Keep the style, colour, print placement, hardware and stitching unchanged and sharper than before. Even out the lighting with no hot spot or colour cast. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text, no watermark.' \\\n  --images docs/item-repair/v1.jpg docs/item-repair/v2.jpg docs/item-repair/v3.jpg docs/item-repair/v4.jpg \\\n  --size 1024x1024 --quality high --imageFormat jpeg \\\n  --batch 2 --save docs/item-repair/output-sku001-retouched.jpg\n\n# 批量精修仓库拍摄的平铺图\nfor f in docs/item-repair/raw/*.jpg; do\n  dlazy gpt-image-2 \\\n    --prompt 'Studio retouch of a flat-lay garment photo. Press out random wrinkles, symmetrise the silhouette, square the shoulders, align both sleeves, tidy collar and hem, even out the lighting. Keep the pattern, colour, hardware and structure unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text.' \\\n    --images \"$f\" --size 1024x1024 --quality high --imageFormat jpeg \\\n    --save \"docs/item-repa"},{"language":"text","snippet":"Studio retouch of a [品类] product photo.\n[多图时：Images 1-N are the same product from different angles; use them together\nto understand the construction.]\n\n[从第三节选一个模板的 prompt 主体]\n\nKeep the [款式/图案/五金/结构] and the exact [颜色] unchanged and sharper than before.\n\nPure white seamless background with a subtle soft contact shadow.\nPhotorealistic, print-ready, no text, no watermark."},{"language":"bash","snippet":"dlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: item-repair\nversion: 1.0.19\ndescription: 商品精修、去褶皱。随手拍的商品图 → 可直接上架的精修图。当用户说「精修」「去褶皱」「修图」「拍得不好看」「整理一下」时使用。\n---\n\n# item-repair — 一键提升商品图质感\n\n把**随手拍的商品图**修成**可上架的精修图**：压平褶皱、摆正对称、匀光、提纯背景。\n\n和 [material-enhancement](https://github.com/dlazy-ai/ecommerce-skills/blob/main/skills/material-enhancement/skill.md) 的分工：material-enhancement 修**面料纹理**（在模特图上），本技能修**摆放与光照**（在商品图上）。两者可以串起来用。\n\n---\n\n## 生成效果示例\n\n| 输入：原商品图 |\n| --- |\n| <img src=\"https://raw.githubusercontent.com/dlazy-ai/ecommerce-skills/main/docs/item-repair/source-flatlay.jpg\" width=\"280\"> |\n| `source-flatlay.jpg` — 军绿麻花针织毛衣平铺图（袖身有随机褶皱、左右不完全对称），800×800 |\n\n实际执行的命令（平铺图精修 + 材质增强）：\n\n```bash\ndlazy gpt-image-2 \\\n  --prompt 'Studio retouch of a flat-lay garment photo. Clean up this olive-green cable-knit sweater to catalog standard: press out the random wrinkles and creases in the body and sleeves, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting so there is no hot spot or colour cast. Keep the cable-knit and diamond stitch pattern, the exact olive-green colour, the ribbed collar/cuffs/hem and the woven cuff label unchanged and sharper than before. Pure white seamless background with a subtle soft contact shadow. Photorealistic, print-ready, no text, no watermark.' \\\n  --images docs/item-repair/source-flatlay.jpg \\\n  --size 1024x1024 --quality high --imageFormat jpeg \\\n  --save docs/item-repair/example-output.jpg\n```\n\n**输出**\n\n<img src=\"https://raw.githubusercontent.com/dlazy-ai/ecommerce-skills/main/docs/item-repair/example-output.jpg\" width=\"320\">\n\n`example-output.jpg` — 1024×1024，60 credits。随机褶皱被压平、肩线方正、两只袖子长度与角度对齐、下摆罗纹平整、光照均匀无高光斑；麻花与菱形织法、军绿色、罗纹结构与右袖织标保留且比原图更清晰，背景提纯为白底带柔和接地投影。\n\n---\n\n## 1、能力边界\n\n| 模板 | 做什么 |\n| --- | --- |\n| 平铺图精修 | 摊平、左右对称、方正肩线、袖长对齐、去褶皱、匀光、纯净背景 |\n| 服装去皱 | 只压平随机褶皱与折痕，保留结构性褶（褶裥、抽绳、垂坠） |\n| 通用精修 | 去画面杂物、匀光、提纯背景、提升清晰度（非服装类目也适用） |\n| 自定义 | 自己描述要修什么 |\n\n| 附加 | 说明 |\n| --- | --- |\n| 多图输入 | 同一商品 1-4 张，模型综合多角度信息理解结构 |\n| 材质增强 | 开关；开启后表面纹理更清晰（等价于 `--quality high`） |\n\n**不做**：不改款式、颜色、图案、五金与结构；不压平结构性褶皱（褶裥、抽绳、荷叶边）；不用于把次品图修成正品图。\n\n---\n\n## 2、输入素材规则\n\n生成前先自检这几条硬性约束：\n\n- 大小：**20KB ~ 15MB**\n- 分辨率：**大于 400×400**\n- 格式：**jpg / jpeg / png / webp**\n\n**输入建议**\n\n| 做法 | 说明 |\n| --- | --- |\n| ✅ 同一商品多角度 | 1-4 张，正面 + 背面 + 细节，模型能更准地推断结构 |\n| ✅ 商品完整入画 | 出画部分只能靠编 |\n| ✅ 光线不要太杂 | 混合色温的光很难匀 |\n| ❌ 商品有明显破损/污渍 | 修图不该掩盖商品缺陷 |\n| ❌ 多个不同商品同框 | 一次只修一个商品 |\n\n---\n\n## 3、四个模板的 prompt 写法\n\n| 模板 | prompt 主体 |\n| --- | --- |\n| 平铺图精修 | `Press out the random wrinkles and creases, straighten and symmetrise the silhouette, square the shoulders, align both sleeves evenly, tidy the collar and hem, and even out the lighting so there is no hot spot or colour cast.` |\n| 服装去皱 | `Remove only the random wrinkles and packing creases. Preserve every structural fold — pleats, gathers, drawstring ruching and intentional drape must stay exactly as they are.` |\n| 通用精修 | `Remove stray objects, dust and reflections from the frame, even out the lighting, purify the background t"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7c5wgeajfcfvdfb5ceemvdb984cjpd\",\n  \"slug\": \"item-repair\",\n  \"version\": \"1.0.19\",\n  \"publishedAt\": 1791597129773\n}"},{"path":"references/model-flags.md","content":"# `gpt-image-2` 参数清单\r\n\r\n本技能默认用的模型的完整参数。日常只需要「参数约定」里那几个，\r\n这份清单在需要用到非常规参数时再看。\r\n\r\n**CRITICAL INSTRUCTION FOR AGENT**:\r\nRun the `dlazy gpt-image-2` command to get results.\r\n\r\n```bash\r\ndlazy gpt-image-2 -h\r\n\r\nOptions:\r\n  --prompt <prompt>            Prompt\r\n  --images [images...]         Images [image: url or local path] (max 5)\r\n  --size <size>                Size [default: auto] (choices: \"1024x1024\",\r\n                               \"1536x1024\", \"1024x1536\", \"2048x2048\",\r\n                               \"2048x1152\", \"3840x2160\", \"2160x3840\", \"auto\")\r\n  --imageFormat <imageFormat>  Image Format [default: jpeg] (choices: \"jpeg\",\r\n                               \"png\", \"webp\")\r\n  --quality <quality>          Quality [default: medium] (choices: \"low\",\r\n                               \"medium\", \"high\")\r\n  --dry-run                    Print payload without executing the tool\r\n  --no-wait                    Return generateId immediately for async tasks\r\n  --timeout <seconds>          Max seconds to wait for async completion\r\n                               (default: \"1800\")\r\n  --input <jsonOrFile>         Inline JSON or @path/to/file.json — merged under\r\n                               flag values (flags win)\r\n  --save <path>                Download the result asset to this local path\r\n                               (mkdir + retry handled for you). A destination\r\n                               path — NOT a response format; for stdout shape\r\n                               use --format\r\n  --batch <n>                  Fan-out N parallel runs (cloud tools only)\r\n                               (default: \"1\")\r\n  -h, --help                   display help for command\r\n```\r\n\r\n> Any flag also accepts pipe references — `-` (auto-pick from upstream stdin), `@N` (n-th output), `@N.path` (jsonpath into output), `@*` (all primary values), `@stdin` / `@stdin:path` (whole envelope). See `dlazy --help` for details.\r\n\r\n---\r\n\r\n换其他后端时参数由 `scripts/gen.mjs` 统一翻译，见 [`provider-cli.md`](provider-cli.md)。"},{"path":"references/provider-cli.md","content":"<!-- 由 scripts/build-skills.mjs 从 shared/references/provider-cli.md 同步生成，不要直接改这里。 -->\n# 后端调用参考\n\n技能正文只写「要生成什么」。认证、计费、错误码、输出结构这些每个技能都一样的东西放在这里，\n**用到时再读**，不占技能的常驻上下文。\n\n---\n\n## 一、认证\n\n### 默认后端 dLazy\n\n```bash\ndlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入\n```\n\nkey 存在用户配置目录（macOS/Linux `~/.dlazy/config.json`，Windows `%USERPROFILE%\\.dlazy\\config.json`），\n权限限本机用户。也可以每次调用用环境变量 `DLAZY_API_KEY` 传入。\n\n手动获取：登录 [dlazy.com](https://dlazy.com) → [API Key 页面](https://dlazy.com/dashboard/organization/api-key)。\nkey 按组织隔离，可随时轮换或吊销。\n\n### 其他后端\n\n本技能库不锁定单一厂商。配好任意一家的 key 即可跑：\n\n| 后端 | 环境变量 | 说明 |\n| --- | --- | --- |\n| `dlazy` | `dlazy login` 或 `DLAZY_API_KEY` | 默认，最省事 |\n| `openai` | `OPENAI_API_KEY` | 走 `/v1/images/edits` 与 `/v1/images/generations` |\n| `gemini` | `GEMINI_API_KEY` | Nano Banana 系列 |\n| `fal` | `FAL_KEY` | |\n| `replicate` | `REPLICATE_API_TOKEN` | |\n| `ark` | `ARK_API_KEY` + `ARK_MODEL` | 火山方舟，模型 ID 需按开通情况填 |\n\n选路优先级：`--provider` 参数 > `PROVIDER` 环境变量 > 第一个配了 key 的 > `dlazy`。\n\n```bash\nnode scripts/gen.mjs --doctor     # 看当前哪个后端可用\n```\n\n各后端的模型 ID 可用 `GEN_MODEL_OPENAI` / `GEN_MODEL_GEMINI` / `GEN_MODEL_FAL` /\n`GEN_MODEL_REPLICATE` / `GEN_MODEL_ARK` 覆盖。**厂商目录会变，以各家最新文档为准。**\n\n---\n\n## 二、两种调用方式\n\n### 方式 A：统一入口（推荐）\n\n```bash\nnode scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg\n```\n\n它负责：后端选路、默认尺寸档位、失败重试（429/5xx 指数退避）、落盘建目录、成本估算。\n\n```bash\nnode scripts/gen.mjs --task flat-lay --prompt '...' --dry-run   # 不调用不计费，只看要发什么\nnode scripts/gen.mjs --help\n```\n\n### 方式 B：直接用 dLazy CLI\n\n不想引入 Node 依赖时，技能正文里的 `dlazy ...` 命令可以原样执行，效果等价。\n\n```bash\nnpx @dlazy/cli@1.2.3 <command>     # 不装全局二进制\n```\n\n- CLI 源码：[github.com/dlazy-ai/cli](https://github.com/dlazy-ai/cli) · npm 包 `@dlazy/cli`\n\n---\n\n## 三、数据流向\n\n调用 dLazy 时：提示词与参数发往 `api.dlazy.com`；传入的本地图片会上传到 `files.dlazy.com`\n供模型读取；产出 URL 同样托管在 `files.dlazy.com`。这是云端生成 API 的通用形态。\n换成其他后端时，数据流向对应厂商，不经过 dLazy。\n\n---\n\n## 四、输出结构\n\n`gen.mjs`（加 `--json`）：\n\n```json\n{\n  \"ok\": true,\n  \"task\": \"flat-lay\",\n  \"provider\": \"dlazy\",\n  \"model\": \"gpt-image-2\",\n  \"files\": [\"docs/flat-lay/output-sku001.jpg\"],\n  \"texts\": [],\n  \"estimatedCredits\": 60,\n  \"elapsedMs\": 58213\n}\n```\n\ndLazy CLI 原生：\n\n```json\n{\n  \"ok\": true,\n  \"result\": {\n    \"tool\": \"gpt-image-2\",\n    \"data\": { \"urls\": [\"https://files.dlazy.com/data/ai/....jpg\"] },\n    \"savedPath\": \"docs/flat-lay/example-output.jpg\"\n  }\n}\n```\n\n加 `--no-wait` 的异步任务不返回 `data`，返回 `task: { generateId, status }`，\n用 `dlazy status <generateId> --wait` 轮询。\n\n文本类模型（如质检）产出在 `result.data.texts[0]`：\n\n```bash\ndlazy claude-sonnet-5 --prompt '...' --images x.jpg \\\n  | python3 -c 'import sys,json;print(json.load(sys.stdin)[\"result\"][\"data\"][\"texts\"][0])'\n```\n\n---\n\n## 五、错误处理\n\n| Code | 类型 | 示例 |\n| --- | --- | --- |\n| 401 | 未授权 / 无 key | `ok: false, code: \"unauthorized\"` |\n| 501 | 缺必填参数 | `error: required option '--prompt <prompt>' not specified` |\n| 502 | 本地文件读不到 | `Error: Image file not found: ...` |\n| 503 | 余额不足 | `ok: false, code: \"insufficient_balance\"` |\n| 503 | 服务端错误 | `HTT"},{"path":"scripts/lib/tasks.json","content":"{\r\n  \"_note\": \"技能 → 默认模型与参数。dlazy 列为默认后端的模型名；其他后端走 providers.mjs 的通用映射，可用 GEN_MODEL_<PROVIDER> 覆盖。\",\r\n  \"_credits\": { \"gpt-image-2\": 60, \"seedream-5.0\": 30, \"seedream-5.0-pro\": 45, \"banana-pro\": 25, \"claude-sonnet-5\": 3 },\r\n  \"tasks\": {\r\n    \"flat-lay\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"wear-everything\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"image-fusion\":            { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"one-shot\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"fission-pattern\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-detail\":             { \"model\": \"seedream-5.0-pro\", \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"creative-scene\":          { \"model\": \"banana-pro\",       \"size\": \"1024x1536\", \"format\": \"jpeg\" },\r\n    \"batch-image\":             { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"to-3d\":                   { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-extraction\":     { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"fabric-on-body\":          { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-detail\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-grass-planting\": { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-selling-point\":      { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"item-change-background\":  { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"remove-watermark\":        { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"material-enhancement\":    { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"item-repair\":             { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"detect-task\":             { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"listing-optimizer\":       { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"cross-border-localize\":   { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"brand-kit\":               { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"platform-compliance\":     { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"main-image-video\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"product-"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"商品精修、去褶皱。随手拍的商品图 → 可直接上架的精修图。当用户说「精修」「去褶皱」「修图」「拍得不好看」「整理一下」时使用。 Skill: 商品图精修 Item Repair Owner: dlazyai Summary: 商品精修、去褶皱。随手拍的商品图 → 可直接上架的精修图。当用户说「精修」「去褶皱」「修图」「拍得不好看」「整理一下」时使用。 Tags: latest:1.0.19 Version history: v1.0.19 | 2026-10-10T01:52:09.773Z | user 例行版本更新 2026-10-10 v1.0.18 | 2026-10-08T01:44:34.406Z | user 例行版本更新 2026-10-08 v1.0.17 | 2026-10-04T01:44:34.062Z | user 例行版本更新 2026-10-04 v1.0.16 | 2026-10-02T05:17:03.280Z | user 例行版本更新 2026-10-02 v1.0.15 | 2026-09-30T01:48:37.","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1047,"uniquenessScore":52,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T19:27:19.107Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-10T19:27:19.107Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T21:55:54.324Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}