linkfox-aigc-imagegen-product

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

商品图生成

Product Image Generation

统一入口:非服饰类商品(美妆、数码、家居、食品等)的全类型电商出图能力。单张直出 & 套图编排都从这一个 skill 进入。
Unified Entry: Full-category e-commerce image generation capability for non-apparel products (cosmetics, digital products, home goods, food, etc.). Both single-image direct generation & image set orchestration are accessed through this skill.

入口路由

Entry Routing

条件路径操作
只要一张特定类型的图(如"做一张白底图")单张直出确定 type → Read 对应
references/types/<type>.md
→ 执行共享流水线
要多张 / 多类型 / 套图(如"做一套图""出5张图")套图编排Read
references/runtime/00-index.md
→ 按步 Read
01-plan
/
02-confirm
→ 调
scripts/run_collection_pipeline.py
三阶段(plan / dispatch / summary,agent 顺序发 3 个 Bash;dispatch 在 skill 层用
ThreadPoolExecutor
并发跑
scripts/run_one_task.py
,agent 自己并发;禁止 Read
maintainer/collection/
或套图阶段 Read
types/*.md
ConditionPathOperation
Only one specific type of image is needed (e.g., "create a white background image")Single-image Direct GenerationConfirm type → Read corresponding
references/types/<type>.md
→ Execute shared pipeline
Multiple images / multiple types / image sets are needed (e.g., "create an image set" "generate 5 images")Image Set OrchestrationRead
references/runtime/00-index.md
→ Read
01-plan
/
02-confirm
step by step → Call
scripts/run_collection_pipeline.py
three phases (plan / dispatch / summary, agent sends 3 Bash commands in sequence; dispatch uses
ThreadPoolExecutor
at skill layer to run
scripts/run_one_task.py
concurrently, agent itself does not run concurrently; Prohibit reading
maintainer/collection/
or reading
types/*.md
during image set phase)

类型路由表

Type Routing Table

type名称与卖点关联是否有画面描述默认比例详情 reference
WHITE_BG白底图1:1
references/types/white-bg.md
SCENE场景图1:1
references/types/scene.md
CLOSE_UP特写图1:1
references/types/close-up.md
SELLING_POINT卖点图1:1
references/types/selling-point.md
PREMIUM_APLUS高级A+图1464:600
references/types/aplus.md
STANDARD_APLUS普通A+图970:600
references/types/aplus.md
PHONE_APLUS手机A+图600:450
references/types/aplus.md
确定 type 后,必须 Read 对应的 type reference 文件获取该类型的步骤 2 差异逻辑和提示词模板,禁止跳过
typeNameAssociated with Selling PointsHas Scene DescriptionDefault RatioDetails Reference
WHITE_BGWhite Background ImageNoNo1:1
references/types/white-bg.md
SCENEScene ImageYesYes1:1
references/types/scene.md
CLOSE_UPClose-up ImageYesYes1:1
references/types/close-up.md
SELLING_POINTSelling Point ImageYesYes1:1
references/types/selling-point.md
PREMIUM_APLUSPremium A+ ImageYesYes1464:600
references/types/aplus.md
STANDARD_APLUSStandard A+ ImageYesYes970:600
references/types/aplus.md
PHONE_APLUSMobile A+ ImageYesYes600:450
references/types/aplus.md
After confirming the type, must Read the corresponding type reference file to obtain the step 2 differential logic and prompt template for that type, prohibit skipping.

不适用

Inapplicable Scenarios

  • 服饰 / 模特类图片(上装/下装/连衣裙/外套/鞋帽等)→ 走
    linkfox-aigc-imagegen-cloth
    系列。
  • 纯图片编辑操作(换背景、去水印、换角度等已有明确创意方向的操作)→ 走
    linkfox-aigc-imagegen
  • 纯文字生成 →
    linkfox-aigc-textgen
  • 视频生成 →
    linkfox-aigc-videogen
  • Apparel / model-related images (tops/bottoms/dresses/outerwear/shoes & hats, etc.) → Use
    linkfox-aigc-imagegen-cloth
    series.
  • Pure image editing operations (background replacement, watermark removal, angle change, etc. with clear creative directions) → Use
    linkfox-aigc-imagegen
    .
  • Pure text generation →
    linkfox-aigc-textgen
    .
  • Video generation →
    linkfox-aigc-videogen
    .

共享流水线

Shared Pipeline

所有类型都走同一条 3 步流水线,差异部分由各 type reference 定义。
All types follow the same 3-step pipeline, with differences defined by each type reference.

步骤 1:校验图片 URL 可访问性(所有类型通用)

Step 1: Verify Image URL Accessibility (Universal for All Types)

  • 输入
    imageUrls
  • 空数组护栏(强制):若
    imageUrls
    为空数组 / 缺失 / 全部无效,立即停止,不得带空图调下游。优先从上下文(用户本轮/历史上传的原始图片路径)补齐;仍无法补齐时如实向用户报错并请求重新上传,禁止带空
    imageUrls
    继续执行。
  • 操作:逐项检查
    imageUrls
    中的值(保持原顺序):已是公开 URL(http/https 开头)→ 直接透传;本地文件路径(非 http/https)→ 调
    linkfox-file-upload
    上传获得公开 URL 后替换。
  • 输出
    imageUrls
    (全部为公开可访问的 HTTPS URL)
  • Input:
    imageUrls
  • Empty Array Guard (Mandatory): If
    imageUrls
    is an empty array / missing / all invalid, stop immediately, do not call downstream with empty images. Prioritize supplementing from context (original image paths uploaded by the user in current/historical rounds); if still unable to supplement, truthfully report an error to the user and request re-upload, prohibit continuing execution with empty
    imageUrls
    .
  • Operation: Check each value in
    imageUrls
    one by one (maintain original order): if it is already a public URL (starts with http/https) → directly pass through; if it is a local file path (non http/https) → call
    linkfox-file-upload
    to upload and obtain a public URL for replacement.
  • Output:
    imageUrls
    (all are publicly accessible HTTPS URLs)

步骤 2:构造最终 prompt(差异部分见各 type reference)

Step 2: Construct Final Prompt (Differences See Each Type Reference)

各类型的步骤 2 逻辑不同(是否调 textgen、用哪个模型、是否做敏感词规避等),详见已 Read 的
references/types/<type>.md
白底图静态直出约束(WHITE_BG):用
scripts/build_imagegen_prompt.py --type WHITE_BG
构建 imagegen 参数文件,脚本会自动从
references/types/white-bg.md
text
代码块提取白底图静态正文作为最终 prompt。正文较长,一律交脚本读取,不要手动复制或经 shell 变量传递
textgen 链式调用约束(适用于除白底图外的所有类型):凡需调
linkfox-aigc-textgen
的类型,必须使用本 skill 的
build_textgen_params.py
辅助脚本构建 textgen 参数文件(脚本自动完成模板读取、占位符填充、模型/thinkingLevel 设置、敏感词规避指令追加),然后按 textgen SKILL.md 的链式调用方式执行。
套图强制走 pipeline 三阶段:套图路径用
scripts/run_collection_pipeline.py
跑 plan / dispatch / summary 三阶段,agent 按顺序发 3 个 Bash;并发由 skill 层 dispatch 用
ThreadPoolExecutor
完成,agent 自己不并发
  1. --phase plan
    image-plan.json
    /
    collection-state.json
    ,stdout 直接打 markdown 表格 + 1 行 status JSON(含
    specs[]
    /
    run_one_task_script
    /
    state_file
    /
    total
  2. 用户确认后,agent 只发 1 个 dispatch Bash:
    python <本skill根>/scripts/run_collection_pipeline.py --phase dispatch --state <state_file>
    ;dispatch 内部用
    ThreadPoolExecutor
    并发跑
    run_one_task.py --index 1..N
    ,每个子任务落
    task-result-<id>.json
    片段;dispatch 自身 stdout emit
    Saved full response
    ,仅末尾 1 行
    {"status":"dispatch_complete",...}
    供 agent 内部解析(这条 Bash 不渲染图,是正常的)
  3. --phase summary --state <state_file>
    读片段 → stdout 打末尾 markdown 明细(每张成功图自带
    ![label](abs_path)
    内联引用
    ,前端 markdown 渲染器据此渲染整组图)+ 1 行 status JSON;同时合并写
    collection-asset-manifest.json
禁止 Agent 手工 S1 或 Read S0~S3 全文;禁止用户确认后自己拆 N 个 Bash 跑
run_one_task.py
(旧协议;现在并发已在 skill 层完成,自己并发只会重复出图);禁止转发 summary markdown 时把
![]()
行剥掉(整组图就靠这些行渲染);禁止在 summary 之外另贴
Saved full response: [...]
(与 markdown
![]()
双重渲染)。下方 bash 单步链路仅适用于单张直出
路径铁律:本链路横跨两个 skill 目录(构参脚本属本 skill,生文与注参脚本属
linkfox-aigc-textgen
),当前工作目录不固定,所有脚本一律用绝对路径调用,不要用裸
scripts/...
相对路径
(相对路径会指向错误目录导致执行失败)。其中
<本skill根目录>
= 本 SKILL.md 所在目录的绝对路径;
<textgen根目录>
通过
skill:linkfox-aigc-textgen
解析其 SKILL.md 所在目录的绝对路径取得。
  1. 构参(本 skill):
    python <本skill根目录>/scripts/build_textgen_params.py --type <TYPE> ... --out <textgen_params.json>
  2. 生文(textgen skill):
    PROMPT=$(python <textgen根目录>/scripts/aigc_textgen.py --stdin --content-only < <textgen_params.json>)
    ——
    --content-only
    输出单行 content 捕获进变量(换行压平为
    、下游自动还原的机制见 textgen SKILL.md)。
  3. 注参(步骤 3,用
    jq
    内联):用
    jq
    $PROMPT
    内联拼进下游 imagegen 参数 JSON,再交
    linkfox-aigc-imagegen
    出图。
    bash
    PROMPT=$(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
)、用
jq -r
抽取原始 content(会重新引入真实换行符破坏拼接)、或直接写 Python 调 API 绕过此链路。
The step 2 logic varies by type (whether to call textgen, which model to use, whether to avoid sensitive words, etc.), see the Read
references/types/<type>.md
for details.
White Background Image Static Direct Generation Constraint (WHITE_BG): Use
scripts/build_imagegen_prompt.py --type WHITE_BG
to build the imagegen parameter file. The script will automatically extract the white background image static text from the
text
code block in
references/types/white-bg.md
as the final prompt. The text is long, always let the script read it, do not manually copy or pass via shell variables.
Textgen Chain Call Constraint (Applicable to All Types Except White Background Image): For types that need to call
linkfox-aigc-textgen
, must use this skill's
build_textgen_params.py
auxiliary script to build the textgen parameter file (the script automatically completes template reading, placeholder filling, model/thinkingLevel setting, sensitive word avoidance instruction appending), then execute according to the chain call method in textgen SKILL.md.
Image Set Must Go Through Pipeline Three Phases: Use
scripts/run_collection_pipeline.py
to run plan / dispatch / summary three phases for image set path, agent sends 3 Bash commands in sequence; concurrency is completed by skill layer dispatch using
ThreadPoolExecutor
, agent itself does not run concurrently:
  1. --phase plan
    writes
    image-plan.json
    /
    collection-state.json
    , stdout directly outputs markdown table + 1 line of status JSON (including
    specs[]
    /
    run_one_task_script
    /
    state_file
    /
    total
    )
  2. After user confirmation, agent only sends 1 dispatch Bash:
    python <root of this skill>/scripts/run_collection_pipeline.py --phase dispatch --state <state_file>
    ; dispatch internally uses
    ThreadPoolExecutor
    to run
    run_one_task.py --index 1..N
    concurrently, each subtask outputs
    task-result-<id>.json
    fragment; dispatch itself does not emit
    Saved full response
    in stdout, only 1 line
    {"status":"dispatch_complete",...}
    at the end for agent internal parsing (this Bash does not render images, it is normal)
  3. --phase summary --state <state_file>
    reads fragments → stdout outputs final markdown details (each successful image comes with
    ![label](abs_path)
    inline reference
    , front-end markdown renderer renders the entire set of images based on this) + 1 line of status JSON; meanwhile, it merges and writes
    collection-asset-manifest.json
Prohibit Agent from manually executing S1 or reading full text of S0~S3; prohibit splitting into N Bash commands to run
run_one_task.py
after user confirmation (old protocol; concurrency is now completed at skill layer, self-concurrency will only result in duplicate images); prohibit stripping
![]()
lines when forwarding summary markdown (the entire set of images relies on these lines for rendering); prohibit attaching
Saved full response: [...]
outside summary (double rendering with markdown
![]()
). The following bash single-step link only applies to single-image direct generation.
Path Iron Rule: This link spans two skill directories (parameter construction scripts belong to this skill, text generation and parameter annotation scripts belong to
linkfox-aigc-textgen
), the current working directory is not fixed, all scripts must be called with absolute paths, do not use bare
scripts/...
relative paths
(relative paths will point to wrong directories and cause execution failure). Where
<root of this skill>
= absolute path of the directory where this SKILL.md is located;
<textgen root directory>
is obtained by parsing the absolute path of the directory where its SKILL.md is located via
skill:linkfox-aigc-textgen
.
  1. Parameter Construction (this skill):
    python <root of this skill>/scripts/build_textgen_params.py --type <TYPE> ... --out <textgen_params.json>
  2. Text Generation (textgen skill):
    PROMPT=$(python <textgen root directory>/scripts/aigc_textgen.py --stdin --content-only < <textgen_params.json>)
    ——
    --content-only
    outputs single-line content captured into variable (line breaks are flattened to
    , downstream automatic restoration mechanism see textgen SKILL.md).
  3. Parameter Annotation (step 3, inline with
    jq
    ): Use
    jq
    to inline
    $PROMPT
    into downstream imagegen parameter JSON, then pass to
    linkfox-aigc-imagegen
    for image generation.
    bash
    PROMPT=$(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.md
Prohibit manually constructing textgen parameter files with Write tool (must use
build_textgen_params.py
), extracting original content with
jq -r
(will reintroduce real line breaks and break splicing), or directly writing Python to call API to bypass this link.

步骤 3:调
linkfox-aigc-imagegen
出图(所有类型通用)

Step 3: Call
linkfox-aigc-imagegen
for Image Generation (Universal for All Types)

  • 输入:步骤 2 的
    prompt
    、步骤 1 的
    imageUrls
    ratio
    resolution
    provider
  • 操作Read
    skill:linkfox-aigc-imagegen
    的 SKILL.md,按其调用方式执行出图脚本
    。传入参数:
    • prompt
      :步骤 2 产出的最终 prompt
    • imageUrls
      :步骤 1 的全部图片 URL
    • provider
      :入参指定的模型(默认
      BANANA_PRO
    • aspectRatio
      ratio
      原样透传
    • resolution
      :原样透传
    • outputNum
      1
  • 输出:图片(
    Saved full response:
    后的本地路径)
  • 单张直出交付(按类型):本 skill 单张直出场景按
    references/runtime/03-deliver.md
    §3.1 走,agent 在 imagegen Bash 完成后必须:
    1. 解析 stdout 的
      Saved full response: ["..."]
      取本地路径(成功时 1 张)
    2. 在对话回复正文里追加 markdown 内联块:
      markdown
      - 第 1 张 · <类型中文名>
        ![<类型中文名>](<abs_path>)
    3. 类型中文名对照:SCENE→场景图 / CLOSE_UP→特写图 / SELLING_POINT→卖点图 / WHITE_BG→白底图 / PREMIUM_APLUS→高级A+图 / STANDARD_APLUS→普通A+图 / PHONE_APLUS→手机A+图
    4. 禁止
      Saved full response: [...]
      /
      Saved full response: <json路径>
      协议原文复述进对话回复——它是 skill ↔ bridge 内部协议行,复述会让用户看到裸露的 JSON 数组路径(即"协议行裸露"故障);只读它取路径,不抄字面
    5. 禁止自行 echo 一遍
      Saved full response:
      字面让 bridge 再渲染——bridge 路径 A 的「任务产出」资源卡是 imagegen Bash stdout 自动触发的,agent 不要手动复制
    6. 双重渲染(markdown 内联图 + bridge「任务产出」资源卡同时呈现)是当前协议下的预期行为,不算故障
    7. 失败情形(stdout 是
      Saved full response: <data 路径>.json
      单文件)按本 SKILL.md「错误处理与失败护栏」如实告知,不追加内联图
  • Input:
    prompt
    from step 2,
    imageUrls
    from step 1,
    ratio
    ,
    resolution
    ,
    provider
  • Operation: Read SKILL.md of
    skill:linkfox-aigc-imagegen
    and execute image generation script according to its calling method
    . Pass parameters:
    • prompt
      : Final prompt produced in step 2
    • imageUrls
      : All image URLs from step 1
    • provider
      : Model specified by input parameters (default
      BANANA_PRO
      )
    • aspectRatio
      : Pass
      ratio
      as is
    • resolution
      : Pass as is
    • outputNum
      :
      1
  • 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
    references/runtime/03-deliver.md
    . After imagegen Bash is completed, agent must:
    1. Parse
      Saved full response: ["..."]
      in stdout to get local path (1 image when successful)
    2. Append markdown inline block to the conversation reply body:
      markdown
      - Image 1 · <Chinese name of type>
        ![<Chinese name of type>](<abs_path>)
    3. Chinese Name Mapping: SCENE→Scene Image / CLOSE_UP→Close-up Image / SELLING_POINT→Selling Point Image / WHITE_BG→White Background Image / PREMIUM_APLUS→Premium A+ Image / STANDARD_APLUS→Standard A+ Image / PHONE_APLUS→Mobile A+ Image
    4. Prohibit repeating the protocol text
      Saved full response: [...]
      /
      Saved full response: <json path>
      into conversation reply — it is an internal protocol line between skill ↔ bridge, repeating it will let users see exposed JSON array paths (i.e., "protocol line exposure" fault); only read it to get the path, do not copy the literal
    5. Prohibit manually echoing
      Saved full response:
      literal to let bridge render again — bridge path A's "task output" resource card is automatically triggered by imagegen Bash stdout, agent should not copy manually
    6. Double rendering (markdown inline image + bridge "task output" resource card displayed simultaneously) is expected behavior under current protocol, not a fault
    7. For failure cases (stdout is
      Saved full response: <data path>.json
      single file), truthfully inform according to "Error Handling and Failure Guards" in this SKILL.md, do not append inline image

中间产物落盘(强制)

Intermediate Product Storage (Mandatory)

所有要跨步骤复用或交付的文件一律落到会话目录
<cwd>/linkfox/<YYYY-MM-DD>/<session>/{data|media}/
(协议见仓库
CLAUDE.md
「输出文件位置」)。
产物类型目录获取方式
品牌基因 JSON
data/
linkfox-aigc-imagegen-brand-gene-extract
save_brand_gene.py
套图规划 image-plan.json
data/
S2 确认后
scripts/save_image_plan.py
逐条追加落盘
imageUrls 数组
data/
步骤 1 校验后 Write 到
$DATADIR/image-urls.json
(通常很小)
task-result-*.json
data/
每个
run_one_task.py
完成后落盘的任务结果片段,summary phase 读后汇总末尾 markdown + asset manifest
collection-asset-manifest.json
data/
summary phase 自动从 task-result 片段中合并
assets[]
写出,记录每张结果图的
src
slot
type
label
,供 Listing HTML 合并重渲染
单张构参 JSON(textgen/imagegen 入参)
data/
build_textgen_params.py
/
build_imagegen_prompt.py
--out
(仅单张直出场景)
结果图
media/
linkfox-aigc-imagegen
脚本自动落盘
DATADIR=$(python <brand-gene根目录>/scripts/save_brand_gene.py --datadir)
;下游
--brand-gene-file
指向 S1 落盘的品牌基因绝对路径。
All files to be reused across steps or delivered must be stored in the session directory
<cwd>/linkfox/<YYYY-MM-DD>/<session>/{data|media}/
(protocol see "Output File Location" in repository
CLAUDE.md
).
Product TypeDirectoryAcquisition Method
Brand Gene JSON
data/
save_brand_gene.py
of
linkfox-aigc-imagegen-brand-gene-extract
Image Set Plan image-plan.json
data/
Append and store item by item via
scripts/save_image_plan.py
after S2 confirmation
imageUrls Array
data/
Write to
$DATADIR/image-urls.json
after step 1 verification (usually small)
task-result-*.json
data/
Task result fragment stored after each
run_one_task.py
is completed, read and summarized into final markdown + asset manifest in summary phase
collection-asset-manifest.json
data/
Automatically merge
assets[]
from task-result fragments and write in summary phase, record
src
,
slot
,
type
,
label
of each result image, for Listing HTML merge and re-rendering
Single-image Parameter Construction JSON (textgen/imagegen input parameters)
data/
--out
of
build_textgen_params.py
/
build_imagegen_prompt.py
(only for single-image direct generation scenario)
Result Images
media/
Automatically stored by
linkfox-aigc-imagegen
script
DATADIR=$(python <brand-gene root directory>/scripts/save_brand_gene.py --datadir)
; downstream
--brand-gene-file
points to the absolute path of brand gene stored in S1.

下游 skill 调用约定

Downstream Skill Calling Convention

本 skill 依赖下表两个下游 skill,按文档化方式调用:先 Read 对方 SKILL.md 了解其调用方式,单张直出按步骤 2/3 的链式命令、套图按
scripts/run_collection_pipeline.py
+
scripts/run_one_task.py
编排——两者都按文档以绝对路径调用下游官方脚本(这是允许的)。本 skill 自带的
build_textgen_params.py
/
build_imagegen_prompt.py
/
run_collection_pipeline.py
/
run_one_task.py
等是参数构建与编排辅助脚本,可直接运行。脱离上述文档化链路自行拼调用、或直连下游 HTTP API 才是不允许的。
下游 skill用途调用时机
linkfox-aigc-imagegen
AI 生图步骤 3(所有类型)
linkfox-aigc-textgen
提示词改写步骤 2(除白底图外的所有类型)
调用方式:Read
skill:<skill-name>
的 SKILL.md,按其中的调用方式章节执行。
This skill relies on the two downstream skills in the table below, call according to documented methods: first Read the other party's SKILL.md to understand their calling method, single-image direct generation follows the chain commands in steps 2/3, image set follows
scripts/run_collection_pipeline.py
+
scripts/run_one_task.py
orchestration — both call downstream official scripts with absolute paths as documented (this is allowed). This skill's own
build_textgen_params.py
/
build_imagegen_prompt.py
/
run_collection_pipeline.py
/
run_one_task.py
etc. are parameter construction and orchestration auxiliary scripts, which can be run directly. It is not allowed to splice calls on your own outside the above documented link, or directly connect to downstream HTTP APIs.
Downstream SkillPurposeCalling Timing
linkfox-aigc-imagegen
AI Image GenerationStep 3 (all types)
linkfox-aigc-textgen
Prompt RewritingStep 2 (all types except white background image)
Calling Method: Read SKILL.md of
skill:<skill-name>
and execute according to its calling method section.

共享输入参数

Shared Input Parameters

以下参数为所有类型通用(类型特有参数见各 type reference):
参数类型默认说明
imageUrls
string[]必填商品参考图 URL。步骤 1 会校验可访问性
ratio
string随类型图片比例,原样透传给 imagegen 的
aspectRatio
resolution
string2K分辨率,2K / 4K
provider
string生图模型(
BANANA_PRO
/
GPT_2_IMAGE
/
BANANA_2
/
AIDRAW_EDIT
/
WAN2_7
);未传入时用
AskUserQuestion
让用户从上述 5 个模型中选择
The following parameters are universal for all types (type-specific parameters see each type reference):
ParameterTypeDefaultDescription
imageUrls
string[]RequiredProduct reference image URLs. Step 1 will verify accessibility
ratio
stringVaries by typeImage ratio, passed directly to
aspectRatio
of imagegen
resolution
string2KResolution, 2K / 4K
provider
stringImage generation model (
BANANA_PRO
/
GPT_2_IMAGE
/
BANANA_2
/
AIDRAW_EDIT
/
WAN2_7
); if not passed, use
AskUserQuestion
to let user select from the above 5 models

错误处理与失败护栏

Error Handling and Failure Guards

linkfox-aigc-imagegen
skill 对业务失败也返回 exit 0(不是非零退出),所以不能靠命令退出码判断成败,必须解析 stdout
1. 怎么判一次调用成败
  • 成功:stdout 含
    Saved full response: ["xxx.png", ...]
    (JSON 数组路径)→ 图片已落盘 media/,取路径展示。
  • 失败:stdout 含
    Saved full response: xxx.json
    (单个 JSON 文件路径,非数组)→ 无图片产物,需读该 JSON 查看错误详情(
    errcode
    /
    errmsg
    /
    error
    )。
2. 失败怎么处理(按类型分流)
失败类型判断依据处理
参数非法
errmsg
/
errorMsg
指向
provider
aspectRatio
resolution
quality
等入参不被接受
AskUserQuestion
让用户重选对应参数
认证失败
errcode==401
或提示 API Key
停止并提示用户配置
LINKFOX_AGENT_API_KEY
,不重试
瞬时错误
error
为网络/超时/连接失败(
Connection failed
、timeout 等)
最多自动重试 1 次;再失败转「其它错误」
其它错误配额、内容被拒、服务端 5xx、未知 errcode 等不重试,如实告知用户失败原因
3. 硬性护栏(违反即视为故障)
  • 禁止因生图失败改调任何其它 skill——本 skill 的生图路径唯一(
    linkfox-aigc-imagegen
    ),失败就按上表处理或上报,绝不"换一个 skill 试试"。
  • 禁止无上限重试:除"瞬时错误最多 1 次"外,同一类失败不得反复重试。
  • 禁止把失败的返回体当成功继续往下走(展示空图、告诉用户"已生成")。
linkfox-aigc-imagegen
skill returns exit 0 for business failures (non-zero exit is not used), so cannot judge success or failure by command exit code, must parse stdout.
1. How to Judge Success or Failure of a Call
  • Success: stdout contains
    Saved full response: ["xxx.png", ...]
    (JSON array path) → Image has been stored in media/, get the path to display.
  • Failure: stdout contains
    Saved full response: xxx.json
    (single JSON file path, non-array) → No image product, need to read the JSON to view error details (
    errcode
    /
    errmsg
    /
    error
    ).
2. How to Handle Failures (By Failure Type)
Failure TypeJudgment BasisHandling
Invalid Parameters
errmsg
/
errorMsg
points to input parameters such as
provider
,
aspectRatio
,
resolution
,
quality
not being accepted
Use
AskUserQuestion
to let user reselect corresponding parameters
Authentication Failure
errcode==401
or prompt for API Key
Stop and prompt user to configure
LINKFOX_AGENT_API_KEY
, do not retry
Transient Error
error
is network/timeout/connection failure (
Connection failed
, timeout, etc.)
Automatically retry at most 1 time; if failed again, switch to "Other Errors"
Other ErrorsQuota 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)
  • Prohibit calling any other skill due to image generation failure — this skill has only one image generation path (
    linkfox-aigc-imagegen
    ), handle or report according to the above table when failed, never "try another skill".
  • Prohibit unlimited retries: Except "transient error at most 1 time", do not retry the same type of failure repeatedly.
  • Prohibit treating failed return body as success and continue (display empty image, tell user "generated successfully").

全局规则

Global Rules

模型类型规则

Model Type Rules

本 skill 支持以下 5 个生图模型,模型由 agent 层通过
provider
参数传入;若未传入则由本 skill 向用户确认。
模型名称内部代码
LFBanana Pro
BANANA_PRO
Img2
GPT_2_IMAGE
LFBanana2
BANANA_2
Linkfox-Image-1
AIDRAW_EDIT
Wan 2.7
WAN2_7
模型确认:若
provider
为空或不在上表内,使用
AskUserQuestion
让用户从上述 5 个模型中选择,用户选择后再继续执行。将
provider
统一下发给步骤 3。
This skill supports the following 5 image generation models, models are passed in by agent layer via
provider
parameter; if not passed in, this skill will confirm with the user.
Model NameInternal Code
LFBanana Pro
BANANA_PRO
Img2
GPT_2_IMAGE
LFBanana2
BANANA_2
Linkfox-Image-1
AIDRAW_EDIT
Wan 2.7
WAN2_7
Model Confirmation: If
provider
is empty or not in the above table, use
AskUserQuestion
to let user select from the above 5 models, continue execution after user selection. Distribute
provider
uniformly to step 3.

分辨率规则

Resolution Rules

分辨率是步骤 3 的必传参数。本 skill 支持 2K、4K
  1. agent 层透传了
    resolution
    (值为 2K 或 4K):直接使用
  2. agent 层未透传:使用
    AskUserQuestion
    让用户从 2K / 4K 中选择
Resolution is a mandatory parameter for step 3. This skill supports 2K, 4K.
  1. Agent layer passed
    resolution
    (value is 2K or 4K): use directly
  2. Agent layer did not pass: use
    AskUserQuestion
    to let user select from 2K / 4K

任务独立性声明

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 continued execution of other tasks.

执行期约束

Execution Constraints

  1. 无上传环节:商品图片以
    imageUrls
    形式直接传递,本 skill 不涉及本地文件上传操作(步骤 1 的 URL 校验除外),禁止探查或调用任何上传脚本。
  2. 计划管理工具使用规范:单张直出时不使用计划工具。套图并发出图前须为 N 张图创建任务计划(见
    references/runtime/02-confirm.md
    )。
  3. 套图落盘:plan / summary 由
    run_collection_pipeline.py
    写盘;禁止 Agent 凭记忆 Write 整份 manifest / image-plan。
  4. Listing 报告回写资产清单(强制):套图 summary 完成后保留
    $DATADIR/collection-asset-manifest.json
    。Listing HTML 合并只用
    agent-listing-result-html-skill/scripts/merge-listing-assets.mjs
    。如果 manifest 中仍是本地
    media/
    路径,由调用方先用
    linkfox-file-upload
    换成公开 OSS URL 并更新 manifest,再执行 merge;本 skill 不直接上传,但不得暗示本地路径可直接写入 HTML。
  1. No Upload Link: Product images are directly passed in the form of
    imageUrls
    , this skill does not involve local file upload operations (except URL verification in step 1), prohibit probing or calling any upload scripts.
  2. Planning Tool Usage Specification: Do not use planning tools for single-image direct generation. Must create task plans for N images before concurrent image generation for image sets (see
    references/runtime/02-confirm.md
    ).
  3. Image Set Storage: plan / summary are written to disk by
    run_collection_pipeline.py
    ; prohibit Agent from writing the entire manifest / image-plan from memory via Write.
  4. Listing Report Write-back Asset Manifest (Mandatory): Retain
    $DATADIR/collection-asset-manifest.json
    after image set summary is completed. Listing HTML merge only uses
    agent-listing-result-html-skill/scripts/merge-listing-assets.mjs
    . If the manifest still contains local
    media/
    paths, the caller must first use
    linkfox-file-upload
    to replace them with public OSS URLs and update the manifest, then execute merge; this skill does not upload directly, but must not imply that local paths can be directly written into HTML.

套图编排流程(runtime,渐进 Read)

Image Set Orchestration Process (runtime, Progressive Read)

仅套图路径触发;单张直出不要 Read 本节。
步骤Read操作
入口
references/runtime/00-index.md
S0 场景判定
plan
references/runtime/01-plan.md
写 job.json →
--phase plan
,stdout markdown 表格原样转发 + AskUserQuestion
确认 → dispatch → summary
references/runtime/02-confirm.md
用户确认 → agent 发 1 个
--phase dispatch
Bash(skill 层并发跑全部
run_one_task.py
,不渲染图)→ 紧接 1 个
--phase summary
Bash 写 manifest + 打含
![]()
的 markdown 明细
维护细则见
references/maintainer/collection/
运行时禁止 Read
Only triggered by image set path; do not read this section for single-image direct generation.
StepReadOperation
Entry
references/runtime/00-index.md
S0 scenario judgment
plan
references/runtime/01-plan.md
Write job.json →
--phase plan
, forward stdout markdown table as is + AskUserQuestion
Confirm → Dispatch → Summary
references/runtime/02-confirm.md
User confirmation → agent sends 1
--phase dispatch
Bash (skill layer runs all
run_one_task.py
concurrently, does not render images) → immediately send 1
--phase summary
Bash to write manifest + output markdown details containing
![]()
Maintenance details see
references/maintainer/collection/
, prohibit reading during runtime.

已知局限

Known Limitations

  • 白底图模板为静态指令,无品类识别与结构判定,全品类统一按"去背 + 精修 + 居中放大"处理;异形 / 透明 / 反光类产品的边缘处理可能不及预期。
  • 场景图/特写图强依赖
    linkfox-aigc-textgen
    GEM_3_FLASH
    )对品类与结构的判定,判定错误会直接传导到构图。
  • 卖点图/A+ 共用字典模板,靠
    {layoutInfo}
    区分;意图填错会导致版式串型。
  • 模板正文以服装品类口吻写就("面料质感 / 版型优势"),用于非服饰商品时由模型自适应。
  • 多张参考图时由模型自行判断主体,复杂组合下可能误判。
  • 不做敏感词改写(场景图/特写图/白底图):若卖点/场景含违禁内容,本链路不拦截,由上游或人工把关。卖点图/A+ 图在 textgen 环节含敏感词规避。
  • White background image template is static instruction, no category recognition and structure judgment, all categories are uniformly processed as "background removal + retouching + centered enlargement"; edge processing of special-shaped / transparent / reflective products may not meet expectations.
  • Scene images/close-up images strongly rely on category and structure judgment of
    linkfox-aigc-textgen
    (
    GEM_3_FLASH
    ), judgment errors will directly affect composition.
  • Selling point images/A+ images share dictionary templates, distinguished by
    {layoutInfo}
    ; wrong intent filling will lead to layout mismatch.
  • Template text is written in apparel category tone ("fabric texture / version advantage"), adapted by model when used for non-apparel products.
  • When multiple reference images are provided, the model judges the subject by itself, which may lead to misjudgment in complex combinations.
  • No sensitive word rewriting (scene images/close-up images/white background images): if selling points/scenes contain prohibited content, this link does not intercept, controlled by upstream or manual review. Selling point images/A+ images include sensitive word avoidance in textgen phase.

解决认证和积分问题

Resolve Authentication and Credit Issues

发生以下异常情况时,采用 references/onboarding.md 引导解决问题:
When the following abnormal situations occur, 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
    LINKFOX_AGENT_API_KEY
    is not configured, nor is
    LINKFOXAGENT_API_KEY
    .
  • Response Returns 401 or 402 Status Code
  • Response Indicates Insufficient Credits or Balance: Message contains "insufficient credit balance/insufficient billing/insufficient balance/quota exceeded/insufficient balance/package expired/need recharge/please recharge", or similar meanings.