linkfox-aigc-imagegen-cloth
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese服饰图生成
Apparel Image Generation
统一入口:服饰 / 模特类商品(上装、下装、连衣裙、外套、鞋帽等)的全类型电商出图能力。单张直出 & 套图编排都从这一个 skill 进入。
Unified Entry: Full-range e-commerce image generation capability for apparel/model-related products (topwear, bottomwear, dresses, outerwear, shoes & hats, etc.). Both single-image direct generation and image-set orchestration are accessed via this single skill.
入口路由
Entry Routing
| 条件 | 路径 | 操作 |
|---|---|---|
| 只要一张特定类型的图(如"做一张模特图") | 单张直出 | 确定 type → Read 对应 |
| 要多张 / 多类型 / 套图(如"做一套图""出5张图") | 套图编排 | Read |
| Condition | Path | Operation |
|---|---|---|
| Only need one image of a specific type (e.g., "make a model image") | Single-image Direct Generation | Confirm type → Read corresponding |
| Need multiple images / multiple types / image sets (e.g., "create an image set" "generate 5 images") | Image-set Orchestration | Read |
类型路由表
Type Routing Table
| type | 名称 | 与卖点关联 | 是否有画面描述 | 默认比例 | 支线 | 是否走 textgen | 详情 reference |
|---|---|---|---|---|---|---|---|
| WHITE_BG | 白底图(隐形模特) | 否 | 否 | 1:1 | ①静态直出 | 否 | |
| MODEL_IMAGE | 模特图 | 否 | 是 | 1:1 | ②占位符直出 | 否 | |
| SCENE | 种草图 | 是 | 是 | 1:1 | ③textgen 改写 | 是 | |
| SELLING_POINT | 卖点图 | 是 | 是 | 1:1 | ③textgen 改写 | 是 | |
| PREMIUM_APLUS | 高级A+图 | 是 | 是 | 1464:600 | ③textgen 改写 | 是 | |
| STANDARD_APLUS | 普通A+图 | 是 | 是 | 970:600 | ③textgen 改写 | 是 | |
| PHONE_APLUS | 手机A+图 | 是 | 是 | 600:450 | ③textgen 改写 | 是 | |
| SIZE | 尺码图 | 否 | 是 | 1:1 | 两阶段:①阶段1=③textgen 前置分析 + ②阶段2=占位符直出 | 阶段1是/阶段2否 | |
确定 type 后,必须 Read 对应的 type reference 文件获取该类型走哪条支线、步骤 2 差异逻辑和运行时模板来源,禁止跳过。
| type | Name | Associated with Selling Points | Has Scene Description | Default Aspect Ratio | Branch | Uses textgen | Details Reference |
|---|---|---|---|---|---|---|---|
| WHITE_BG | White Background Image (Invisible Model) | No | No | 1:1 | ①Static Direct Generation | No | |
| MODEL_IMAGE | Model Image | No | Yes | 1:1 | ②Placeholder Direct Generation | No | |
| SCENE | Lifestyle Marketing Image | Yes | Yes | 1:1 | ③textgen Rewriting | Yes | |
| SELLING_POINT | Selling Point Image | Yes | Yes | 1:1 | ③textgen Rewriting | Yes | |
| PREMIUM_APLUS | Premium A+ Image | Yes | Yes | 1464:600 | ③textgen Rewriting | Yes | |
| STANDARD_APLUS | Standard A+ Image | Yes | Yes | 970:600 | ③textgen Rewriting | Yes | |
| PHONE_APLUS | Mobile A+ Image | Yes | Yes | 600:450 | ③textgen Rewriting | Yes | |
| SIZE | Size Chart Image | No | Yes | 1:1 | Two phases: ①Phase 1 = ③textgen Pre-analysis + ②Phase 2 = Placeholder Direct Generation | Yes in Phase 1 / No in Phase 2 | |
After confirming the type, must Read the corresponding type reference file to get which branch the type follows, the differential logic of Step 2, and the source of runtime templates. SKIPPING IS FORBIDDEN.
不适用
Inapplicable Scenarios
- 非服饰类实物商品(美妆、数码、家居、食品等)→ 走 系列。
linkfox-aigc-imagegen-product - 纯图片编辑操作(换背景、去水印、换角度等已有明确创意方向的操作)→ 走 。
linkfox-aigc-imagegen - 已有模特图换姿势 / 换动作裂变(模特裂变)→ 不在本范围(业务方上游构造 posePrompt,不读字典)。
- 纯文字生成 → 。
linkfox-aigc-textgen - 视频生成 → 。
linkfox-aigc-videogen
- Non-apparel physical products (cosmetics, electronics, home goods, food, etc.) → Use series.
linkfox-aigc-imagegen-product - Pure image editing operations (background replacement, watermark removal, angle change, etc. with clear creative directions) → Use .
linkfox-aigc-imagegen - Pose/action variation of existing model images (model variation) → Not within this scope (business side constructs posePrompt upstream, no dictionary reading).
- Pure text generation → .
linkfox-aigc-textgen - Video generation → .
linkfox-aigc-videogen
共享流水线
Shared Pipeline
所有类型都走同一条 3 步流水线(尺码图为两阶段,见下),步骤 2 的差异由各 type reference 指定走哪条支线。
All types follow the same 3-step pipeline (size chart image uses two phases, see below). The differences in Step 2 are specified by each type reference file indicating which branch to take.
三条支线(步骤 2 的差异本质)
Three Branches (Essence of Differences in Step 2)
| 支线 | 机制 | 是否填占位符 | 是否调 textgen | 是否过敏感词 | 适用类型 |
|---|---|---|---|---|---|
| ① 静态直出 | 用 | 否 | 否 | 否 | WHITE_BG |
| ② 占位符直出 | 模板填占位符后直接出图(用 | 是 | 否 | MODEL_IMAGE 否 / SIZE 阶段2 末尾追加规避指令 | MODEL_IMAGE、SIZE 阶段2 |
| ③ textgen 改写 | 模板填占位符 → | 是 | 是 | SCENE 否 / 卖点·A+ 是 / SIZE 阶段1 否 | SCENE、SELLING_POINT、*_APLUS、SIZE 阶段1 |
| Branch | Mechanism | Fills Placeholders | Calls textgen | Checks Sensitive Words | Applicable Types |
|---|---|---|---|---|---|
| ① Static Direct Generation | Use | No | No | No | WHITE_BG |
| ② Placeholder Direct Generation | Generate images directly after filling placeholders in templates (using | Yes | No | No for MODEL_IMAGE / Append avoidance instructions at the end of SIZE Phase 2 | MODEL_IMAGE, SIZE Phase 2 |
| ③ textgen Rewriting | Fill placeholders in templates → | Yes | Yes | No for SCENE / Yes for Selling Point & A+ / No for SIZE Phase 1 | SCENE, SELLING_POINT, *_APLUS, SIZE Phase 1 |
步骤 1:校验图片 URL 可访问性(所有类型通用)
Step 1: Verify Accessibility of Image URLs (Universal for All Types)
- 输入:
imageUrls - 空数组护栏(强制):若 为空数组 / 缺失 / 全部无效,立即停止,不得带空图调下游。优先从上下文(用户本轮/历史上传的原始图片路径)补齐;仍无法补齐时如实向用户报错并请求重新上传,禁止带空
imageUrls继续执行。imageUrls - 操作:逐项检查 中的值(保持原顺序):已是公开 URL(http/https 开头)→ 直接透传;本地文件路径(非 http/https)→ 调
imageUrls上传获得公开 URL 后替换。linkfox-file-upload - 输出:(全部为公开可访问的 HTTPS URL)
imageUrls
- Input:
imageUrls - Empty Array Guard (Mandatory): If is empty / missing / all invalid, stop immediately, do not call downstream with empty images. Prioritize filling from context (original image paths uploaded by users in current/historical rounds); if still unable to fill, truthfully report error to user and request re-upload. FORBID continuing with empty
imageUrls.imageUrls - Operation: Check each value in in order: if it is a public URL (starts with http/https) → pass through directly; if it is a local file path (not http/https) → call
imageUrlsto upload and get a public URL for replacement.linkfox-file-upload - Output: (all are publicly accessible HTTPS URLs)
imageUrls
步骤 2:构造最终 prompt(差异部分见各 type reference)
Step 2: Construct Final Prompt (Differences Refer to Each Type Reference)
各类型的步骤 2 逻辑不同(走哪条支线、用哪个模型、是否做敏感词规避等),详见已 Read 的 。
references/types/<type>.md①静态直出支线约束(WHITE_BG):用构建 imagegen 参数文件,脚本会自动从scripts/build_imagegen_prompt.py --type WHITE_BG的references/types/white-bg.md代码块提取白底图静态正文作为最终 prompt。正文较长,一律交脚本读取,不要手动复制或经 shell 变量传递。text②占位符直出支线约束(MODEL_IMAGE、SIZE 阶段2):必须使用本 skill 的辅助脚本构建 imagegen 提示词参数文件(脚本自动完成模板读取、占位符填充、null 入参替换、SIZE 阶段2 末尾敏感词规避指令追加),禁止手动用 Write 工具拼接 prompt 或用 shell 变量捕获大文本。SIZE 阶段2 的scripts/build_imagegen_prompt.py用analysis_result注入,避免大文本经 shell。--analysis-file③textgen 改写支线约束(SCENE、SELLING_POINT、*_APLUS、SIZE 阶段1):必须使用本 skill 的辅助脚本构建 textgen 参数文件(脚本自动完成模板读取、占位符填充、模型/thinkingLevel 设置、卖点·A+ 敏感词规避指令追加),然后按 textgen SKILL.md 的链式调用方式执行。build_textgen_params.py套图强制走 pipeline 三阶段:套图路径用跑 plan / dispatch / summary 三阶段,agent 按顺序发 3 个 Bash;并发由 skill 层 dispatch 用scripts/run_collection_pipeline.py完成,agent 自己不并发:ThreadPoolExecutor
写--phase plan/image-plan.json,stdout 直接打 markdown 表格 + 1 行 status JSON(含collection-state.json/specs[]/run_one_task_script/state_file)total- 用户确认后,agent 只发 1 个 dispatch Bash:
;dispatch 内部用python <本skill根>/scripts/run_collection_pipeline.py --phase dispatch --state <state_file>并发跑ThreadPoolExecutor,每个子任务落run_one_task.py --index 1..N片段;dispatch 自身 stdout 不 emittask-result-<id>.json,仅末尾 1 行Saved full response供 agent 内部解析(这条 Bash 不渲染图,是正常的){"status":"dispatch_complete",...} 读片段 → stdout 打末尾 markdown 明细(每张成功图自带--phase summary --state <state_file>内联引用,前端 markdown 渲染器据此渲染整组图)+ 1 行 status JSON;product variant 同时写collection-asset-manifest.json禁止 Agent 在对话中手工完成 S1 推理或 Read S0~S3 全文;禁止用户确认后自己拆 N 个 Bash 跑(旧协议;现在并发已在 skill 层完成,自己并发只会重复出图);禁止转发 summary markdown 时把run_one_task.py行剥掉(整组图就靠这些行渲染);禁止在 summary 之外另贴![]()(与 markdownSaved full response: [...]双重渲染)。下方 bash 单步链路仅适用于单张直出。![]()路径铁律:本链路横跨两个 skill 目录(构参脚本属本 skill,生文与注参脚本属),当前工作目录不固定,所有脚本一律用绝对路径调用,不要用裸linkfox-aigc-textgen相对路径(相对路径会指向错误目录导致执行失败)。其中scripts/...= 本 SKILL.md 所在目录的绝对路径;<本skill根目录>通过<textgen根目录>解析其 SKILL.md 所在目录的绝对路径取得。skill:linkfox-aigc-textgen
- 构参(本 skill):
python <本skill根目录>/scripts/build_textgen_params.py --type <TYPE> ... --out <textgen_params.json>- 生文(textgen skill):
——PROMPT=$(python <textgen根目录>/scripts/aigc_textgen.py --stdin --content-only < <textgen_params.json>)输出单行 content 捕获进变量(换行压平为--content-only、下游自动还原的机制见 textgen SKILL.md)。⏎- 注参(步骤 3,用
内联):用jq把jq内联拼进下游 imagegen 参数 JSON,再交$PROMPT出图。linkfox-aigc-imagegenbashPROMPT=$(python <textgen根目录>/scripts/aigc_textgen.py --stdin --content-only < <textgen_params.json>) PARAMS=$(jq -nc --arg p "$PROMPT" --argjson imgs '<步骤1的URL JSON数组>' \ '{prompt:$p, imageUrls:$imgs, provider:"<provider>", outputNum:1, aspectRatio:"<ratio>", resolution:"<resolution>"}') # 然后按 linkfox-aigc-imagegen SKILL.md 的调用方式把 $PARAMS 传入出图禁止手动用 Write 工具构造 textgen 参数文件(必须经)、用build_textgen_params.py抽取原始 content(会重新引入真实换行符破坏拼接)、或直接写 Python 调 API 绕过此链路。jq -r
The logic of Step 2 varies by type (which branch to take, which model to use, whether to avoid sensitive words, etc.), see the Read for details.
references/types/<type>.mdConstraints for ①Static Direct Generation Branch (WHITE_BG): Useto build the imagegen parameter file. The script will automatically extract the static content of white background images from thescripts/build_imagegen_prompt.py --type WHITE_BGcode block intextas the final prompt. The content is long, always let the script read it, do not manually copy or pass via shell variables.references/types/white-bg.mdConstraints for ②Placeholder Direct Generation Branch (MODEL_IMAGE, SIZE Phase 2): Must use theauxiliary script of this skill to build the imagegen prompt parameter file (the script automatically completes template reading, placeholder filling, null parameter replacement, and sensitive word avoidance instruction appending for SIZE Phase 2). FORBID manually splicing prompts with Write tool or capturing large text with shell variables. Inject thescripts/build_imagegen_prompt.pyof SIZE Phase 2 usinganalysis_resultto avoid passing large text via shell.--analysis-fileConstraints for ③textgen Rewriting Branch (SCENE, SELLING_POINT, *_APLUS, SIZE Phase 1): Must use theauxiliary script of this skill to build the textgen parameter file (the script automatically completes template reading, placeholder filling, model/thinkingLevel setting, and sensitive word avoidance instruction appending for Selling Point & A+), then execute in chain call mode as specified in textgen SKILL.md.build_textgen_params.pyImage-set Must Follow Three-phase Pipeline: For image-set path, run plan / dispatch / summary three phases with, agent sends 3 Bash commands in sequence; concurrency is handled byscripts/run_collection_pipeline.pyat skill layer during dispatch, agent itself does not handle concurrency:ThreadPoolExecutor
writes--phase plan/image-plan.json, stdout directly outputs markdown table + 1 line of status JSON (includingcollection-state.json/specs[]/run_one_task_script/state_file)total- After user confirmation, agent sends only 1 dispatch Bash:
; dispatch internally usespython <root of this skill>/scripts/run_collection_pipeline.py --phase dispatch --state <state_file>to runThreadPoolExecutorconcurrently, each subtask outputsrun_one_task.py --index 1..Nfragment; dispatch itself does not emittask-result-<id>.jsonin stdout, only outputs 1 lineSaved full responseat the end for internal agent parsing (this Bash does not render images, it is normal){"status":"dispatch_complete",...} reads fragments → stdout outputs final markdown details (each successful image comes with--phase summary --state <state_file>inline reference, frontend markdown renderer renders the entire set of images based on this) + 1 line of status JSON; product variant also writescollection-asset-manifest.jsonFORBID Agent manually completing S1 reasoning or reading full text of S0~S3 in conversation; FORBID splitting into N Bash commands to runafter user confirmation (old protocol; concurrency is now handled at skill layer, self-concurrency will only result in duplicate images); FORBID strippingrun_one_task.pylines when forwarding summary markdown (the entire set of images relies on these lines for rendering); FORBID attaching![]()outside summary (causes double rendering with markdownSaved full response: [...]). The following bash single-step link only applies to single-image direct generation.![]()Path Rule: This link spans two skill directories (parameter construction scripts belong to this skill, text generation and parameter injection scripts belong to), the current working directory is not fixed. All scripts must be called with absolute paths, do not use barelinkfox-aigc-textgenrelative paths (relative paths will point to wrong directories and cause execution failure). Wherescripts/...= absolute path of the directory where this SKILL.md is located;<root of this skill>is obtained by parsing the absolute path of the directory where SKILL.md of<textgen root directory>is located.skill:linkfox-aigc-textgen
- Parameter Construction (this skill):
python <root of this skill>/scripts/build_textgen_params.py --type <TYPE> ... --out <textgen_params.json>- Text Generation (textgen skill):
——PROMPT=$(python <textgen root directory>/scripts/aigc_textgen.py --stdin --content-only < <textgen_params.json>)outputs single-line content captured into variable (line breaks are flattened to--content-only, the mechanism for downstream automatic restoration is in textgen SKILL.md).⏎- Parameter Injection (Step 3, inline with
): Usejqto inlinejqinto downstream imagegen parameter JSON, then pass to$PROMPTfor image generation.linkfox-aigc-imagegenbashPROMPT=$(python <textgen root directory>/scripts/aigc_textgen.py --stdin --content-only < <textgen_params.json>) PARAMS=$(jq -nc --arg p "$PROMPT" --argjson imgs '<URL JSON array from Step 1>' \ '{prompt:$p, imageUrls:$imgs, provider:"<provider>", outputNum:1, aspectRatio:"<ratio>", resolution:"<resolution>"}') # Then pass $PARAMS to image generation according to the calling method in linkfox-aigc-imagegen SKILL.mdFORBID manually constructing textgen parameter files with Write tool (must use), extracting original content withbuild_textgen_params.py(will reintroduce real line breaks and break splicing), or directly writing Python to call API to bypass this link.jq -r
步骤 3:调 linkfox-aigc-imagegen
出图(所有类型通用)
linkfox-aigc-imagegenStep 3: Call linkfox-aigc-imagegen
for Image Generation (Universal for All Types)
linkfox-aigc-imagegen- 输入:步骤 2 的 、步骤 1 的
prompt、imageUrls、ratio、resolutionprovider - 操作:Read 的 SKILL.md,按其调用方式执行出图脚本。传入参数:
skill:linkfox-aigc-imagegen- :步骤 2 产出的最终 prompt
prompt - :步骤 1 的全部图片 URL
imageUrls - :入参指定的模型(默认
provider)BANANA_PRO - :
aspectRatio原样透传ratio - :原样透传
resolution - :
outputNum1
- 输出:图片(后的本地路径)
Saved full response: - 单张直出交付(按类型):本 skill 单张直出场景按 §3.1 走,agent 在 imagegen Bash 完成后必须:
references/runtime/03-deliver.md-
解析 stdout 的取本地路径(成功时 1 张)
Saved full response: ["..."] -
在对话回复正文里追加 markdown 内联块:markdown
- 第 1 张 · <类型中文名>  -
类型中文名对照:SCENE→种草图 / SELLING_POINT→卖点图 / MODEL_IMAGE→模特图 / SIZE→尺码图 / WHITE_BG→白底图 / PREMIUM_APLUS→高级A+图 / STANDARD_APLUS→普通A+图 / PHONE_APLUS→手机A+图
-
禁止把/
Saved full response: [...]协议原文复述进对话回复——它是 skill ↔ bridge 内部协议行,复述会让用户看到裸露的 JSON 数组路径(即"协议行裸露"故障);只读它取路径,不抄字面Saved full response: <json路径> -
禁止自行 echo 一遍字面让 bridge 再渲染——bridge 路径 A 的「任务产出」资源卡是 imagegen Bash stdout 自动触发的,agent 不要手动复制
Saved full response: -
双重渲染(markdown 内联图 + bridge「任务产出」资源卡同时呈现)是当前协议下的预期行为,不算故障
-
失败情形(stdout 是单文件)按本 SKILL.md「错误处理与失败护栏」如实告知,不追加内联图
Saved full response: <data 路径>.json
-
- Input: from Step 2,
promptfrom Step 1,imageUrls,ratio,resolutionprovider - Operation: Read SKILL.md of and execute image generation script according to its calling method. Pass parameters:
skill:linkfox-aigc-imagegen- : Final prompt produced in Step 2
prompt - : All image URLs from Step 1
imageUrls - : Model specified by input (default
provider)BANANA_PRO - : Pass
aspectRatioas isratio - : Pass as is
resolution - :
outputNum1
- Output: Image (local path after )
Saved full response: - Single-image Direct Generation Delivery (By Type): For single-image direct generation scenario of this skill, follow §3.1 of . After imagegen Bash completes, agent must:
references/runtime/03-deliver.md-
Parsein stdout to get local path (1 image on success)
Saved full response: ["..."] -
Append markdown inline block to conversation reply content:markdown
- Image 1 · <Chinese name of type>  -
Chinese Name Mapping: SCENE→Lifestyle Marketing Image / SELLING_POINT→Selling Point Image / MODEL_IMAGE→Model Image / SIZE→Size Chart Image / WHITE_BG→White Background Image / PREMIUM_APLUS→Premium A+ Image / STANDARD_APLUS→Standard A+ Image / PHONE_APLUS→Mobile A+ Image
-
FORBID repeating the protocol text/
Saved full response: [...]in conversation reply —— it is an internal protocol line between skill ↔ bridge, repeating it will expose raw JSON array path to users (i.e., "protocol line exposure" fault); only read it to get the path, do not copy the literal textSaved full response: <json path> -
FORBID manually echoingliteral text to let bridge render again —— the "task output" resource card of bridge path A is automatically triggered by imagegen Bash stdout, agent should not copy it manually
Saved full response: -
Double rendering (markdown inline image + bridge "task output" resource card displayed simultaneously) is expected behavior under current protocol, not a fault
-
For failure cases (stdout issingle file), truthfully inform user according to "Error Handling and Failure Guards" in this SKILL.md, do not append inline image
Saved full response: <data path>.json
-
中间产物落盘(强制)
Intermediate Product Storage (Mandatory)
所有要跨步骤复用或交付的文件一律落到会话目录 (协议见仓库 「输出文件位置」)。
<cwd>/linkfox/<YYYY-MM-DD>/<session>/{data|media}/CLAUDE.md| 产物类型 | 目录 | 获取方式 |
|---|---|---|
| 品牌基因 JSON | | |
| 套图规划 image-plan.json | | S2 确认后 |
| imageUrls 数组 | | 步骤 1 校验后 Write 到 |
| task-result-*.json | | 每个 |
| 单张构参 JSON(textgen/imagegen 入参) | | |
| 结果图 | | |
DATADIR=$(python <brand-gene根目录>/scripts/save_brand_gene.py --datadir)--brand-gene-fileAll files to be reused across steps or delivered must be stored in session directory (protocol see "Output File Location" in repository ).
<cwd>/linkfox/<YYYY-MM-DD>/<session>/{data|media}/CLAUDE.md| Product Type | Directory | Acquisition Method |
|---|---|---|
| Brand Gene JSON | | |
| Image-set Plan image-plan.json | | Saved and appended item by item with |
| imageUrls Array | | Write to |
| task-result-*.json | | Task result fragment stored after each |
| Single-image Parameter Construction JSON (textgen/imagegen input) | | |
| Result Image | | Automatically stored by |
DATADIR=$(python <brand-gene root directory>/scripts/save_brand_gene.py --datadir)--brand-gene-file下游 skill 调用约定
Downstream Skill Calling Convention
本 skill 依赖下表两个下游 skill,按文档化方式调用:先 Read 对方 SKILL.md 了解其调用方式,单张直出按步骤 2/3 的链式命令、套图按 + 编排——两者都按文档以绝对路径调用下游官方脚本(这是允许的)。本 skill 自带的 / / / 等是参数构建与编排辅助脚本,可直接运行。脱离上述文档化链路自行拼调用、或直连下游 HTTP API 才是不允许的。
scripts/run_collection_pipeline.pyscripts/run_one_task.pybuild_textgen_params.pybuild_imagegen_prompt.pyrun_collection_pipeline.pyrun_one_task.py| 下游 skill | 用途 | 调用时机 |
|---|---|---|
| AI 生图 | 步骤 3(所有类型) |
| 提示词改写 / 前置分析 | 步骤 2(SCENE、SELLING_POINT、*_APLUS、SIZE 阶段1) |
调用方式:Read 的 SKILL.md,按其中的调用方式章节执行。
skill:<skill-name>This skill depends on two downstream skills in the table below, call according to documented methods: first Read the other party's SKILL.md to understand its calling method, single-image direct generation follows chain commands in Step 2/3, image-set follows orchestration of + —— both call downstream official scripts with absolute paths as documented (this is allowed). Auxiliary scripts like / / / included in this skill can be run directly. It is not allowed to construct calls outside the above documented link or directly connect to downstream HTTP API.
scripts/run_collection_pipeline.pyscripts/run_one_task.pybuild_textgen_params.pybuild_imagegen_prompt.pyrun_collection_pipeline.pyrun_one_task.py| Downstream Skill | Purpose | Calling Timing |
|---|---|---|
| AI Image Generation | Step 3 (all types) |
| Prompt Rewriting / Pre-analysis | Step 2 (SCENE, SELLING_POINT, *_APLUS, SIZE Phase 1) |
Calling Method: Read SKILL.md of and execute according to its calling method section.
skill:<skill-name>共享输入参数
Shared Input Parameters
以下参数为所有类型通用(类型特有参数见各 type reference):
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| string[] | 必填 | 服饰参考图 URL。步骤 1 会校验可访问性 |
| string | 随类型 | 图片比例,原样透传给 imagegen 的 |
| string | 2K | 分辨率,2K / 4K |
| string | — | 生图模型( |
The following parameters are universal for all types (type-specific parameters see each type reference):
| Parameter | Type | Default | Description |
|---|---|---|---|
| string[] | Required | URLs of apparel reference images. Step 1 will verify accessibility |
| string | Varies by type | Image aspect ratio, passed to |
| string | 2K | Resolution, 2K / 4K |
| string | — | Image generation model ( |
错误处理与失败护栏
Error Handling and Failure Guards
skill 对业务失败也返回 exit 0(不是非零退出),所以不能靠命令退出码判断成败,必须解析 stdout。linkfox-aigc-imagegen
1. 怎么判一次调用成败
- 成功:stdout 含 (JSON 数组路径)→ 图片已落盘 media/,取路径展示。
Saved full response: ["xxx.png", ...] - 失败:stdout 含 (单个 JSON 文件路径,非数组)→ 无图片产物,需读该 JSON 查看错误详情(
Saved full response: xxx.json/errcode/errmsg)。error
2. 失败怎么处理(按类型分流)
| 失败类型 | 判断依据 | 处理 |
|---|---|---|
| 参数非法 | | 用 |
| 认证失败 | | 停止并提示用户配置 |
| 瞬时错误 | | 最多自动重试 1 次;再失败转「其它错误」 |
| 其它错误 | 配额、内容被拒、服务端 5xx、未知 errcode 等 | 不重试,如实告知用户失败原因 |
3. 硬性护栏(违反即视为故障)
- ❌ 禁止因生图失败改调任何其它 skill——本 skill 的生图路径唯一(),失败就按上表处理或上报,绝不"换一个 skill 试试"。
linkfox-aigc-imagegen - ❌ 禁止无上限重试:除"瞬时错误最多 1 次"外,同一类失败不得反复重试。
- ❌ 禁止把失败的返回体当成功继续往下走(展示空图、告诉用户"已生成")。
skill returns exit 0 for business failures (non-zero exit is not used), so cannot judge success/failure by command exit code, must parse stdout.linkfox-aigc-imagegen
1. How to Judge Success/Failure of a Call
- Success: stdout contains (JSON array path) → Image has been stored in media/, get path for display.
Saved full response: ["xxx.png", ...] - Failure: stdout contains (single JSON file path, not array) → No image product, need to read this JSON to view error details (
Saved full response: xxx.json/errcode/errmsg).error
2. Failure Handling (By Failure Type)
| Failure Type | Judgment Basis | Handling |
|---|---|---|
| Invalid Parameters | | Use |
| Authentication Failure | | Stop and prompt user to configure |
| Transient Error | | Retry automatically at most 1 time; if failed again, switch to "Other Errors" |
| Other Errors | Quota exceeded, content rejected, server 5xx, unknown errcode, etc. | Do not retry, truthfully inform user of failure reason |
3. Hard Guards (Violation is Considered a Fault)
- ❌ FORBID switching to other skills due to image generation failure —— The only image generation path for this skill is , handle or report according to the above table on failure, never "try another skill".
linkfox-aigc-imagegen - ❌ FORBID unlimited retries: Except for "transient errors with at most 1 retry", do not retry the same type of failure repeatedly.
- ❌ FORBID treating failed return body as success and continuing (display empty image, tell user "generated successfully").
全局规则
Global Rules
模型类型规则
Model Type Rules
本 skill 支持以下 5 个生图模型,模型由 agent 层通过 参数传入;若未传入则由本 skill 向用户确认。
provider| 模型名称 | 内部代码 |
|---|---|
| LFBanana Pro | |
| Img2 | |
| LFBanana2 | |
| Linkfox-Image-1 | |
| Wan 2.7 | |
模型确认:若 为空或不在上表内,使用 让用户从上述 5 个模型中选择,用户选择后再继续执行。将 统一下发给步骤 3。
providerAskUserQuestionproviderThis skill supports the following 5 image generation models, which are passed in by agent layer via parameter; if not passed, this skill will confirm with user.
provider| Model Name | Internal Code |
|---|---|
| LFBanana Pro | |
| Img2 | |
| LFBanana2 | |
| Linkfox-Image-1 | |
| Wan 2.7 | |
Model Confirmation: If is empty or not in the above table, use to let user select from the above 5 models, then continue execution after user selection. Pass uniformly to Step 3.
providerAskUserQuestionprovider分辨率规则
Resolution Rules
分辨率是步骤 3 的必传参数。本 skill 支持 2K、4K。
- agent 层透传了 (值为 2K 或 4K):直接使用
resolution - agent 层未透传:使用 让用户从 2K / 4K 中选择
AskUserQuestion
Resolution is a required parameter for Step 3. This skill supports 2K, 4K.
- If agent layer passes (value is 2K or 4K): use directly
resolution - If agent layer does not pass: use to let user select from 2K / 4K
AskUserQuestion
任务独立性声明
Task Independence Statement
套图中的每张图片都是独立任务,各任务之间互不依赖。单个类型出图失败不影响其余任务继续执行。
Each image in the image set is an independent task, and tasks do not depend on each other. Failure of image generation for a single type does not affect the execution of other tasks.
执行期约束
Execution Constraints
- 无上传环节:服饰图片以 形式直接传递,本 skill 不涉及本地文件上传操作(步骤 1 的 URL 校验除外),禁止探查或调用任何上传脚本。
imageUrls - 计划管理工具使用规范:单张直出时不使用计划工具。套图并发出图前须为 N 张图创建任务计划(见 )。
references/runtime/02-confirm.md - 套图落盘:plan / summary 由 写盘;禁止 Agent 凭记忆 Write 整份 image-plan。
run_collection_pipeline.py - Listing 报告回写资产清单(强制):如果套图结果要合并进 Listing HTML,调用方必须保留 ,并在 merge 前把 manifest 中的本地
$DATADIR/collection-asset-manifest.json路径通过media/换成公开 OSS URL。本 skill 不直接上传,但不得暗示本地路径可直接写入 HTML。linkfox-file-upload
- No Upload Link: Apparel images are directly passed in the form of , this skill does not involve local file upload operations (except URL verification in Step 1). FORBID probing or calling any upload scripts.
imageUrls - Planning Tool Usage Specification: Do not use planning tool for single-image direct generation. Must create task plan for N images before concurrent image generation for image sets (see ).
references/runtime/02-confirm.md - Image-set Storage: plan / summary are written to disk by ; FORBID Agent writing the entire image-plan from memory with Write.
run_collection_pipeline.py - Listing Report Asset Manifest Write-back (Mandatory): If image-set results are to be merged into Listing HTML, caller must retain , and replace local
$DATADIR/collection-asset-manifest.jsonpaths in manifest with public OSS URLs viamedia/before merging. This skill does not upload directly, but must not imply that local paths can be directly written into HTML.linkfox-file-upload
套图编排流程(runtime,渐进 Read)
Image-set Orchestration Process (runtime, Progressive Read)
仅套图路径触发;单张直出不要 Read 本节。
| 步骤 | Read | 操作 |
|---|---|---|
| 入口 | | S0 场景判定 |
| plan | | 写 job.json → |
| 确认 → dispatch → summary | | 用户确认 → agent 发 1 个 |
维护细则(场景 A/G 完整规则、历史 S1 文案规范)见 ,运行时禁止 Read。
references/maintainer/collection/Only triggered by image-set path; do not Read this section for single-image direct generation.
| Step | Read | Operation |
|---|---|---|
| Entry | | S0 scenario judgment |
| plan | | Write job.json → |
| Confirm → Dispatch → Summary | | User confirmation → agent sends 1 |
Maintenance details (complete rules for scenario A/G, historical S1 copywriting specifications) are in , FORBID reading during runtime.
references/maintainer/collection/已知局限
Known Limitations
- 白底图模板为静态指令,强依赖模型对**视角(正面/背面)与版型(男装/女装/童装)**的判定;判错会影响廓形与体积重建。
- 模特图链路不调 textgen、不过敏感词,全部解码与构图判断压在出图模型单次出图上;模板只消费 ,市场化人种 / 品牌调性强控需经
{image_desc}文字描述传入。imageDesc - 种草图强依赖 (
linkfox-aigc-textgen)对目标人群 / 年龄(童装 vs 成人)/ 性别的判定,判定错误会直接传导到模特画像与场景构图。GEM_3_FLASH - 卖点图/A+ 共用字典模板,靠 区分;意图填错会导致版式串型。卖点图/A+ 图在 textgen 环节含敏感词规避。
{layoutInfo} - 尺码图为双阶段链路:阶段1 质量直接决定阶段2 尺码表的品类判定与提示文案;阶段2 敏感词规避降级为"在送 imagegen 的最终 prompt 末尾追加规避指令、由出图模型自审",无确定性词库兜底。
analysis_result - 多张参考图时由模型自行判断主体服饰角色,复杂组合下可能误判主图。
- 不做敏感词改写的支线(种草图/模特图/白底图):若卖点/场景含违禁内容,本链路不拦截,由上游或人工把关。
- White background image template uses static instructions, strongly depends on model's judgment of perspective (front/back) and version (men's/women's/children's clothing); wrong judgment will affect silhouette and volume reconstruction.
- Model image link does not call textgen or check sensitive words, all decoding and composition judgment rely on single image generation by the model; template only consumes , strong control of market-oriented race / brand tone needs to be passed in via
{image_desc}text description.imageDesc - Lifestyle marketing image strongly depends on (
linkfox-aigc-textgen) judgment of target audience / age (children's vs adult) / gender; wrong judgment will directly affect model portrait and scene composition.GEM_3_FLASH - Selling point image/A+ share dictionary template, distinguished by ; wrong intention filling will lead to layout mismatch. Selling point image/A+ include sensitive word avoidance in textgen phase.
{layoutInfo} - Size chart image uses two-phase link: quality of in Phase 1 directly determines category judgment and prompt copy of size chart in Phase 2; sensitive word avoidance in Phase 2 is downgraded to "append avoidance instructions at the end of final prompt sent to imagegen, self-reviewed by image generation model", no deterministic word list fallback.
analysis_result - When multiple reference images are provided, the model judges the role of main apparel automatically, which may misjudge the main image in complex combinations.
- Branches that do not rewrite sensitive words (lifestyle marketing image/model image/white background image): if selling points/scenes contain prohibited content, this link does not intercept, controlled by upstream or manual review.
解决认证和积分问题
Resolve Authentication and Quota Issues
发生以下异常情况时,采用 references/onboarding.md 引导解决问题:
For the following abnormal situations, guide users to solve problems using references/onboarding.md:
异常情况
Abnormal Situations
- 未配置API Key:环境变量未配置 ,也未配置
LINKFOX_AGENT_API_KEY。LINKFOXAGENT_API_KEY - 响应401或402状态码
- 响应提示积分或余额不足:消息含"积分余额不足/计费不足/余额不足/quota exceeded/insufficient balance/套餐到期/需充值/请充值",或类似含义的内容。
- API Key Not Configured: Environment variable is not configured, nor is
LINKFOX_AGENT_API_KEY.LINKFOXAGENT_API_KEY - Response with 401 or 402 Status Code
- Response Indicates Insufficient Quota or Balance: Message contains "insufficient quota balance/insufficient billing/insufficient balance/quota exceeded/insufficient balance/package expired/need to recharge/please recharge" or similar meanings.