The last gate before AI-generated images go liveThe last gate. Determine whether this image can be used directly, where it's broken, and how to fix it.
Difference from other skills: this skilldoes not generate images; it outputs judgments. Its value lies in closing the loop of "generate → detect → re-run" — the detection report directly provides the correction sentences to append to the prompt.
Generation output example
| Input: image to check |
|---|
candidate.jpg — generated by flat-lay of an army-green sweater worn by a model, 1024×1536 |
Command actually executed:
dlazy claude-sonnet-5 \
--prompt '你是电商投放前的图片质检员。审查这张 AI 生成的服装商拍图能否直接用于电商投放。全部用中文作答(第 4 项的 prompt 修正句除外)。严格按以下结构输出:
## 1. 风险等级
低风险 / 中风险 / 高风险(三选一)
## 2. 风险项逐条判定
用表格输出,三列:风险项 / 结论(通过 或 命中)/ 证据。风险项固定为这 8 条:商品崩坏、人脸不自然、手部异常、肢体结构错误、文字乱码、光影矛盾、边缘融合痕迹、平台合规。
## 3. 投放建议
建议投放 / 建议重跑 / 建议人工修图
## 4. 修正建议
若建议重跑或人工修图,给出应追加到生成 prompt 的英文修正句 1-3 条;若建议投放,写「无需修正」。
只输出报告,不要寒暄。' \
--images docs/detect-task/candidate.jpg \
| python3 -c 'import sys,json;print(json.load(sys.stdin)["result"]["data"]["texts"][0])' \
> docs/detect-task/example-report.md
Output: full report see docs/detect-task/example-report.md, 3 credits. Summary:
- Risk level: Low risk
- 8 verdicts: 7 passed;
文字乱码hit (minor) — the woven label pattern on the left cuff is blurry and illegible - Launch recommendation: Manual retouching recommended (only local treatment of the small cuff label is needed)
- Correction suggestion:
clear and legible brand tag/logo embroidery on cuff, sharp fine detail, no blurry or garbled text
This correction sentence can be directly appended to the end of the flat-lay original prompt and re-run — that is the closed loop.
1. Capability boundaries
| Output | Description |
|---|---|
| Risk level | 低风险 / 中风险 / 高风险 |
| Item-by-item verdicts on risk items | 8 items, each giving 通过 / 命中 + one sentence of evidence |
| Launch recommendation | 建议投放 / 建议重跑 / 建议人工修图 |
| Correction suggestion | English correction sentences that can be directly appended to the generation prompt |
8-item risk checklist
| # | Risk item | What to look at |
|---|---|---|
| 1 | Product corruption | Whether the style, weave, print, and logo position are distorted |
| 2 | Unnatural face | Facial proportions, skin texture, gaze |
| 3 | Hand anomalies | Number and shape of fingers |
| 4 | Limb structure errors | Shoulder line, number and orientation of limbs |
| 5 | Garbled text | Any text in the image |
| 6 | Lighting and shadow contradictions | Whether shadow direction and light source are consistent |
| 7 | Edge blending artifacts | Cutout edges, ghosting, blurry patches |
| 8 | Platform compliance | Whether it contains violating elements |
Not doing: Not a replacement for final human review (model judgments have false positives and false negatives); does not make final rulings on law and platform rules; not used to endorse clearly violating images.
2. The report must be able to directly drive a re-run
The point of detection is not to score, but totell the generation step what to change. Therefore item 4 of the report must beEnglish sentences that can be directly copied into the prompt。
Typical mapping:
| Hit item | Correction sentence to append to the generation prompt |
|---|---|
| Product corruption | Cross-check the garment against the reference: [关键特征] must match exactly. |
| Unnatural face | Photorealistic human face: correct facial proportions, natural skin pores and subsurface scattering, natural gaze. |
| Hand anomalies | Hands anatomically correct — five distinct fingers per hand, natural knuckles, no fused or extra digits. |
| Limb structure errors | Correct anatomy: symmetric shoulders, two arms and two legs, no extra or missing limbs, no impossible joint angles. |
| Garbled text | No text anywhere in the image. or (when text is needed)All text must be clear, correctly formed [语言] characters. |
| Lighting and shadow contradictions | Single consistent light source from [方向]; all shadows must fall in the same direction. |
| Edge blending artifacts | Blend all edges seamlessly; no cut-out halo, no ghosting, no blurred patches. |
| Platform compliance | Adjust the composition or remove the violating elements depending on the specific issue |
Closed-loop approach:
生成 → detect-task → 命中项 → 取修正句 → 追加到原 prompt → 重跑 → 再检测
3. Batch sampling inspection
After batch image generation, there is no need to inspect every image (it costs 3 credits/image, but the bottleneck is the time spent manually reading reports). Recommendations:
| Scenario | Sampling ratio |
|---|---|
| First batch of a new specification segment | 100% |
| Batches with verified specifications | 10% ~ 20% random |
| Images with people | Increase to 30% (hands and faces are most prone to breaking) |
| Pure product images with no people | 5% is sufficient |
For batch scripts, see the command examples in Section 5. Automatically send the 高风险 SKUs back to the rerun queue.
4. Tool invocation
This skill uses dLazy's claude-sonnet-5(a text model with image understanding capability; what this skill needs isjudgment and structured reportsrather than images, and it needs to be able to review the image item by item and write actionable correction suggestions—about 3 credits per image).
Invocation method
Two equivalent ways to write it; choose one. The unified entry point automatically selects the backend, retries on failure, creates directories and writes to disk, and estimates cost:
# A. 统一入口(推荐):可切任意后端,加 --dry-run 不计费空跑
node scripts/gen.mjs --task detect-task \
--prompt '<见下方 Prompt 模板>' \
--images <按下表顺序> \
--save output/detect-task-<sku>.jpg
# B. 直接用 dLazy CLI(不想引入 Node 依赖时,效果等价)
dlazy claude-sonnet-5 --prompt '...' --images ... --save output/detect-task.jpg
Parameter conventions (fixed usage for this skill)
| Parameter | Value | Reason |
|---|---|---|
--images |
[待检图](up to 10 images; multiple images from the same batch can be submitted at once for comparison) |
Single-image detection is the most accurate; multiple images are suitable for checking batch-wide consistency |
--prompt |
A fixed QC prompt (see the template in Section 5) | Use the same one throughout the project, otherwise reports are not comparable |
--batch |
1 |
Detection does not require diversity |
--no-wait |
Enable during batch sampling inspection | Submit first, then collect results together |
Get results: The text model's output is in result.data.texts[0](not urls)。
dlazy claude-sonnet-5 --prompt '...' --images a.jpg \
| python3 -c 'import sys,json;print(json.load(sys.stdin)["result"]["data"]["texts"][0])'
dlazy --format text <tool>can also print plain text to stdout; note that--formatis aglobaloption and must be written before the subcommandbefore。
Command Examples
# basic call: 单张检测
dlazy claude-sonnet-5 \
--prompt '你是电商投放前的图片质检员。审查这张 AI 生成的商拍图能否直接投放,输出风险等级、8 项风险的逐条判定、投放建议,以及应追加到生成 prompt 的英文修正句。只输出报告。' \
--images docs/detect-task/candidate.jpg \
| python3 -c 'import sys,json;print(json.load(sys.stdin)["result"]["data"]["texts"][0])'
# complex call: 固定质检 prompt + 批量抽检 + 高风险自动打回
QC='你是电商投放前的图片质检员。审查这张 AI 生成的服装商拍图能否直接用于电商投放。全部用中文作答(第 4 项的 prompt 修正句除外)。严格按以下结构输出:
### 延伸阅读
| 要查什么 | 去哪 |
| --- | --- |
| 认证、多后端配置、输出结构、错误码 | [`references/provider-cli.md`](references/provider-cli.md) |
| `claude-sonnet-5` 的全部可用参数 | [`references/model-flags.md`](references/model-flags.md) |
| 统一入口的全部选项 | `node scripts/gen.mjs --help` |
## 1. 风险等级
低风险 / 中风险 / 高风险(三选一)
## 2. 风险项逐条判定
用表格输出,三列:风险项 / 结论(通过 或 命中)/ 证据。风险项固定为这 8 条:商品崩坏、人脸不自然、手部异常、肢体结构错误、文字乱码、光影矛盾、边缘融合痕迹、平台合规。
## 3. 投放建议
建议投放 / 建议重跑 / 建议人工修图
## 4. 修正建议
若建议重跑或人工修图,给出应追加到生成 prompt 的英文修正句 1-3 条;若建议投放,写「无需修正」。
只输出报告,不要寒暄。'
mkdir -p docs/detect-task/reports
: > docs/detect-task/rerun-queue.txt
for f in docs/batch-image/out/*.jpg; do
SKU=$(basename "$f" .jpg)
dlazy claude-sonnet-5 --prompt "$QC" --images "$f" 2>/dev/null \
| python3 -c 'import sys,json;print(json.load(sys.stdin)["result"]["data"]["texts"][0])' \
> "docs/detect-task/reports/${SKU}.md"
if grep -q '高风险' "docs/detect-task/reports/${SKU}.md"; then
echo "$SKU" >> docs/detect-task/rerun-queue.txt
fi
done
echo "需要重跑:$(wc -l < docs/detect-task/rerun-queue.txt) 个 SKU"
# 先估价不真跑
dlazy claude-sonnet-5 --dry-run --prompt '...' --images a.jpg
Error Handling
| Code | Error Type | Example Message |
|---|---|---|
| 401 | Unauthorized (No API Key) | ok: false, code: "unauthorized", message: "API key is missing or invalid" |
| 501 | Missing required parameter | error: required option '--prompt <prompt>' not specified |
| 502 | Local file read error | Error: Image file/Video file not found: C:\path\to\your\file |
| 503 | API request failed (no balance) | ok: false, code: "insufficient_balance" |
| 503 | API request failed (server error) | HTTP status code error (500 server crash) |
| 504 | Asynchronous task execution failed | === Generation Failed === / {Specific error reason returned by backend, for example "Prompt violates safety policy"} |
AGENT CRITICAL INSTRUCTION:
- If the execution result returns
code: "insufficient_balance", you MUST explicitly inform the user that their credits are insufficient and guide them to recharge: https://dlazy.com/dashboard/organization/settings?tab=credits- If the execution result returns
code: "unauthorized"or indicates missing API key, you MUST inform the user to get their API key from https://dlazy.com/dashboard/organization/api-key and save it usingdlazy auth set <key>and resume the task.
5. Prompt template
This prompt should remain fixed throughout the project, otherwise reports from different batches cannot be compared.
你是电商投放前的图片质检员。审查这张 AI 生成的[品类]商拍图能否直接用于电商投放。
全部用中文作答(第 4 项的 prompt 修正句除外)。严格按以下结构输出:
## 1. 风险等级
低风险 / 中风险 / 高风险(三选一)
## 2. 风险项逐条判定
用表格输出,三列:风险项 / 结论(通过 或 命中)/ 证据。
风险项固定为这 8 条:商品崩坏、人脸不自然、手部异常、肢体结构错误、
文字乱码、光影矛盾、边缘融合痕迹、平台合规。
## 3. 投放建议
建议投放 / 建议重跑 / 建议人工修图
## 4. 修正建议
若建议重跑或人工修图,给出应追加到生成 prompt 的英文修正句 1-3 条;
若建议投放,写「无需修正」。
只输出报告,不要寒暄。
Optional enhancements
| Requirement | Append to prompt |
|---|---|
| Need to compare with the original product image | Pass one more original image and write 图1 是待检图,图2 是原始商品图,逐项比对商品保真度。 |
| Need scoring for sorting | 在风险等级后追加一个 0-100 的可投放分数。 |
| Need to enforce specific platform rules | 额外检查以下平台规则:[规则清单]。 |
| Need machine-readable output | 以 JSON 输出,字段为 risk_level / items[] / recommendation / fixes[]。 |
6. Execution flow
- Fixed QC prompt(template in Section 5), reused throughout the project.
- Single-image detection: Take
result.data.texts[0]to get the report. - Read item 3:
建议投放→ list it;建议人工修图→ send to retouching;建议重跑→ next step. - Take the correction sentence from item 4, append it to the end of the original generation prompt, and rerun.
- Detect once more— Confirm the fix takes effect; don't blindly trust a single rerun.
- Batch scenarios: sample-check at the ratio in Section 4;
高风险automatically enter the rerun queue. - Manual final review: the model has false positives and false negatives; a human still needs to scan it before publishing.
7. Common Questions
| Symptom | Cause | Handling |
|---|---|---|
| Report outputs English | Language not enforced | Write "answer entirely in Chinese" in the prompt |
| Can't get the result | Wrong field retrieved | The text model's result is in data.texts[0], not urls |
--format text error |
Global option in wrong position | --format must be written before the subcommandbefore |
| Reports from different batches can't be compared | The QC prompt is changed every time | Fix one prompt and reuse it across the whole project |
| Obvious corruption not detected | Model false negative | Increase the sampling ratio; manual final review before publishing |
| Normal image judged high risk | Model false positive | Look at the evidence description in item 2 before deciding; don't just look at the level |
| The correction sentence isn't specific enough | The report is too general | Add a strengthened item "must be compared with the original product image" and pass one more original image |
Tips
Visit https://dlazy.com for more information.