---
name: sku-generate
description: 生成 PDP 主图 + Model 模特图. 用户说「生 PDP」「生 model」「重跑 X 张」「跑款」时触发. 包含 5 条核心铁律 + Ref 处理 + API + 老婆 anchor + PDP/Model prompt 模板 + 调性 + 抖店比例 + 自审.
---

# SKU 生图 — PDP 主图 + Model 模特图

> 跑款核心 skill. 包含所有让 AI 出图不变形 / 不偏移 / 不失真的铁律.

---

## §1 ⭐⭐⭐⭐⭐ 核心铁律 — Ref 选图 = 跑款 #1 权重

**用户原话**（2026-05-15 HM6124 v9/v10 验证后锁定）：
> "**事实证明所有图都是我们选参考图的技术**. 选参考图最重要, 它的权重最高, 参考图选不好, 操作不好, 后面的图全部出问题."

> "你不要去形容这个鞋子, 你直接把图给 AI 是什么材质它自己都读得到, 你的语言形容永远没有用图片准确"

= **Ref 选图是跑款 #1 权重**. 不是 prompt 调整, 不是 API 参数, 不是 ANGLE LOCK 段, 是 **Ref 本身选对 + crop 操作正确**.

### 90% 的输出问题都是 Ref 选错 / 操作错（HM6124 5 版踩坑全教训）

| 输出问题 | 真因（Ref 层） | 修复 |
|---|---|---|
| 鞋变形 / 拉伸 | Ref 改了比例（PIL.resize）或 crop 裁掉鞋边缘 | 直接 cp 原图作 ref，crop 保 ratio + 含完整鞋边缘 |
| 鞋型简化 / signature 丢失 | Ref 含其他色边角残留 / contact sheet 污染 | 用档口"单色单只完整"图（§2 Step 0 优先级 1）|
| BG 不对 / 跟 ref BG | 没传 plaster BG anchor / prompt 没强约束 REPLACE | image=[wife, plaster_bg, shoe_ref] 3 张 + 强约束"REPLACE Image N's bg with Image 2" |
| Pose 不对 / AI 自创 | Ref pose 不符目标 / 太软 prompt lock | 选 ref 时按"目标 pose"挑, 不让 AI 自由 |
| AI 强行补头 / 补全身 | Ref 是 close-up 局部无头 → AI 强补 | 选完整 framing ref（含头或自然局部）+ prompt 强 "DO NOT add body parts not shown in Image N" |
| 鞋角度偏移 | AI 跨角度脑补（ref 是 90°, 强求 top_down）| 跑该角度必须有对应角度 ref（§2.6.1 #5）|

**Ref 选不对, prompt 怎么写都救不回**. Ref 是源头, prompt 是辅助.

### 下面 6 条铁律按"Ref 权重"排序

### 铁律 1 · Ref 处理 — Crop OK / Resize 拉伸禁止

- ✅ **PIL.crop 切矩形** — 把鞋占画面变大 (从 30% → 80%) OK
- ✅ **改 ratio** — 3:4 ref crop 成 1:1 OK (API 接受任何 ratio)
- ❌ **PIL.resize 改尺寸** — 把 1:1 拉成 3:4 NOT OK (鞋会真变形)

**喂给 AI 的 ref 必须是"从来没有被 resize 拉伸过"的图.** Crop 是允许的, resize 是禁止的.

### 铁律 2 · AI 跟 ref 同角度生成（不能换角度）

- AI 输出角度 **完全等于** ref 角度 — 不是相似, 是 EXACTLY 一致
- 没 high-angle ref → 别跑 high-angle
- 没 90° ref → 别跑 90°
- 没真 overhead ref → **别跑 top_down**（信息缺失必脑补必出错）
- **视角不必恒定** — 按 ref 实际有什么决定生成什么, 不强求 hero 4 视角全套

### 铁律 3 · PDP 用纯鞋 ref / Model 用上脚 ref

| 输出 | Ref 类型 | 原因 |
|---|---|---|
| PDP (纯鞋图) | 纯鞋 ref (鞋摆在地 / 单独展示, 无脚) | AI 学到的角度 = "鞋摆在地" |
| Model (人 + 鞋) | 上脚 ref (鞋穿在脚上) | AI 学到的角度 = "被穿状态" |

**跨类型用 = AI 脑补角度变换 = 鞋中线歪 / 角度拗 / 比例错**（即使没拉伸也是失真）.

### 铁律 4 · 永远不描述鞋

- ❌ Prompt 不写 `sandals` / `shoes` / `mule` / `slingback` 等类型词
- ❌ 不写材质 (`black leather` / `suede` / `patent`)
- ❌ 不写 signature (`Tabi cleft` / `Y-thong` / `2 silver rivets`)
- ❌ 不写跟形 (`kitten heel` / `block heel`)
- ❌ 不写 "⭐ CRITICAL signature elements"
- ✅ 只用 generic 引用：`footwear from Image 2` / `Image 2 content`

**Why**：HM6124 model v7 prompt 写 `"Y-thong + 2 silver rivets"` → AI 跟 prompt 学错 → 鞋型偏移. 删描述 + crop ref → 鞋型一致. AI 视觉学 ref 永远比文字描述准.

### 铁律 5 · 图片 > 语言

AI 看 ref 自动学：材质 / 鞋型 / signature / 颜色 / 切割结构 / 跟形 / 后空带 / 等. **永远不要 prompt 文字解读 ref**, AI 直接读图最准.

### 铁律 6 · ⭐⭐⭐ Ref 决定生死 — 输入 = 输出（鞋角度 + pose 全链路守恒）

**用户原话**（2026-05-15 HM6124 v3 验证后锁定）：
> "事实证明选参考图决定了生死"
> "模特图必须保证输出一个姿势，就换人和环境就行了"

= **Ref 是生死线**. 跑款全程任何输入和输出图里, **鞋的角度 + pose 永远不应该变**.

| 类型 | Input (ref) | Output | AI 唯一可改 |
|---|---|---|---|
| PDP | 纯鞋单色单只 ref（含鞋角度）| 输出鞋 = 同角度 | **背景 + 光线** |
| Model | 上脚 ref（含 pose + 鞋角度）| 输出 = 同 pose + 同鞋角度 | **人脸（face anchor）+ 环境** |

**核心逻辑**：
- AI 绝不"改善"鞋角度 / "调整"pose / "优化"框架
- Pose 不变 → 脚不变 → **鞋角度不变 → 不会变形**（鞋本身被 AI 看到的所有部位都跟 ref 一致, 没有任何脑补空间）
- 任何尝试"换角度" / "新 pose" / "新框架" = AI 必须脑补 ref 看不到的细节 = 必失真

**禁忌清单**：
- ❌ 主对话 prompt 写 `pose_text="contrapposto standing"`（指定 pose = AI 改 ref pose）
- ❌ 主对话 prompt 写 `framing="below-knee"`（指定 framing = AI 改 ref framing）
- ❌ 主对话提前映射 "鞋款 → 服装"（让 AI 看 image 2 学搭配）
- ❌ 主对话写 outfit 具体单品（"灰阔腿 + 黑针织"）

**正确做法**：
- ✅ Image 2 (model ref) 自带 pose + framing + outfit 灵感
- ✅ Prompt 只控 quiet luxury creative brief（palette + banned）+ 强约束 "preserve pose + framing + footwear angle from Image 2"
- ✅ AI 看 image 2 自由搭服装（同 quiet luxury 调性）
- ✅ Pose / 框架 / 鞋角度 100% 跟 image 2 走

**变量化靠选不同 ref 实现** —— 4 张 Model = 4 张不同的上脚 ref（自带 pose / outfit / 环境 / 框架 4 维差异），不靠 prompt 文字变量.

---

## §2 Ref 处理流程（每个目标视角独立处理）

### Step 0 · ⭐⭐⭐ Ref 选择优先级铁律 — **决定生死**（2026-05-15 HM6124 v3 验证）

**用户原话**："事实证明选参考图决定了生死". Ref 选错 = 任何 prompt 调整都救不回. 选 PDP source ref 严格按优先级，**绝不跨级用**：

**优先级 1 · 档口"单色单只完整"图** ⭐ 终极正解
- 单图/ 系列里找：每个 colorway 1 张独立的纯鞋图（**单只 + 单色 + 鞋边缘完整 + 干净 BG**）
- 直接 cp 原图作 ref（go2 原图就是 3:4 不需要 crop）
- 例：HM6124 brown = `单图/3_8__30.jpg` / burgundy = `单图/1_11__03.jpg` / black = `单图/2_9__21.jpg`

**优先级 2 · PIL.crop contact sheet** ⚠️ 风险高
- 只有当优先级 1 没有时才用
- crop 规则：
  - ✅ 必须含**该色 1 双完整（2 只）+ 所有鞋边缘完整**
  - ❌ 不能裁掉另一只鞋的边缘（AI 看不到边缘 → 必脑补 → 变形）
  - ✅ 必须**完全裁掉其他色边角**（残留半只其他色 → AI 内部冲突）

**优先级 3 · 上脚 close-up**（仅 Model 用）
- PDP 绝不用上脚图作 source（裤腿 / 脚踝遮挡 signature）
- Model 必须用上脚图（不能跨用纯鞋图，§1 铁律 3）

### Multi-color PDP 策略（Triple / Dual）

⛔ **不要用 contact sheet 1 张 → AI 学 N 双**（AI 凑对会失控）
✅ **用 N 张单色单只 source（每色 1 张）→ AI 看 N 张组合放一起 plaster BG**
- 每张 ref 角度**可以不同**（AI 自动适应）
- 例：HM6124 triple = `image=[bg, 3_8__30, 1_11__03, 2_9__21]` 让 AI 组合

### Step 0.5 · ⭐⭐⭐ Model Ref 选择优先级（2026-05-15 HM6124 v12 验证 — 用户铁律）

**用户原话**："参考图如果说是有头的，就优先跑有头的. 实在没有有头的，或者只有 2 张有头，剩下才跑没头的".

Model 跑款选 ref 严格按以下优先级（**有头 > 没头**）:

**优先级 1 · 完整含脸全身 ref** ⭐ 最佳（调性最强 + 老婆脸 IP）
- 全身或半身明确含**完整头/脸**的图
- 例: 模特正面 / 侧身 / walking shot 头完整可见
- 配套调用: `image=[wife_face_anchor, plaster_bg, onfoot_ref]` (3 张) → 老婆脸替换 → 输出含脸 model

**优先级 2 · 自然没头 close-up / 半身 / 俯拍** ✅ fallback
- below-knee 上脚 close-up
- 半身坐姿（自然裁掉头部）
- 真俯拍上脚 / 持鞋特写（半身从胸/腰到鞋）
- 配套调用: `image=[plaster_bg, onfoot_ref]` (2 张, **不传 face anchor**) → 输出也没头（不强补）

**优先级 3 · ⛔ 微露头 / 部分头裁切 ref** — **禁用！**
- 头被部分裁切（一点头顶 / 头被裁掉一半）的全身图
- AI 必强行补完整头 → **头身比错**（模特看起来矮 / 被压缩）
- 修复: PIL crop 让头**完全裁出 frame**（变自然 close-up 进入优先级 2），或换其他 ref

### Model 4 张分配策略

| Ref 池现状 | 配置 |
|---|---|
| ≥ 4 张含完整脸 | 4 张全是优先级 1（face anchor + onfoot_ref + bg）|
| 2-3 张含脸 + 几张没头 | 优先级 1 用 face anchor / 优先级 2 不用 face anchor — **混合调用** |
| 0 张含脸（如 HM6124）| 4 张全是优先级 2 close-up / 半身 / 俯拍 → 全部 `image=[bg, onfoot]` 不传 face |

**绝不用优先级 3 微露头 ref** — 用之前必 PIL crop 把头完全裁掉.

### Step 1 · 模型选 ref（不靠脚本）

打开 go2 包 `~/下载/GO2-<档口>-<款号>/<款号>/单图/` 所有源图 → **主对话 Read 看图** → 给每张标实际拍摄角度：

| 角度 | 标签 | 适用 |
|---|---|---|
| pure 90° lateral | (a) | PDP side |
| 3/4 angle | (b) | PDP 3/4 |
| high-angle 30-45° | (c) | PDP high_angle / dual |
| true overhead | (d) | PDP top_down (少见) |
| 上脚 90° / 3/4 / 俯拍 | on-foot | Model 用 |

**目标视角 ↔ source 映射表**给用户审过再 crop.

### Step 2 · PIL.crop 让鞋占画面 80%+

```python
from PIL import Image
img = Image.open(SRC)
W, H = img.size
# 4 边都收紧到鞋边缘 + 扩 10% padding 保环境光
# 注意: crop 是切矩形, 不是 resize 拉伸. 鞋本身比例不变.
cropped = img.crop((x0, y0, x1, y1))
cropped.save(OUT_REF, quality=95)
```

**绝不 rembg 抠图**：用户铁律 "永远不抠图 绝对不真实". rembg 剥离环境光线索 → AI 渲染成"标准展示鞋型"丢失真实软质感. 区分：mask 文件本身需要 silhouette 必须 rembg; ref 输入图绝不抠图.

### Step 3 · Ref 命名约定

```
data/skus/<SKU>/refs/
├── <SKU>_<colorway>_<视角>_raw.jpg     # PDP 纯鞋 ref
├── <SKU>_<colorway>_onfoot_<视角>_raw.jpg  # Model 上脚 ref
```

例：`HM2058_black_pure90_raw.jpg` / `HM2058_brown_onfoot_3q_raw.jpg`

### Step 4 · Ref 完整性 checklist

| 检查 | 标准 |
|---|---|
| 比例 | 等于 API output size 的比例（推荐）或任意（API padding 处理）|
| Resize | ❌ 全程禁止 |
| 鞋占画面 | 80%+ 最理想 / 30%+ 也行 |
| Signature 可见 | 所有 signature 元素至少 1 张 ref 能看到 |
| 暗色 colorway | 加 1 张浅色同款作"视觉信号源"（暗色单跑学不到 thong V-cut）|

---

## §3 API 调用（API易 vip）

### 3.1 密钥 + Base URL

- **Base URL**：`https://api.apiyi.com/v1`
- **Key**：`sk-iAzjrx6nJB8EIKCWD199Da33220348128697FbEf9a87BfF6`
- **Token 类型**：API易控制台「按量优先」令牌（否则 401/403）

### 3.2 模型选择

| 模型 | 价格 | 并发 | 用途 |
|---|---|---|---|
| `gpt-image-2-vip` ⭐ | $0.03/张 | 不限并发 | **默认主力**（速度 + 自动 size 字段精确）|
| `gpt-image-2-all` | $0.03/张 | 不限并发 | 同 vip 但 size 写 prompt（少用）|
| `gpt-image-2` 官转 | low $0.006 / medium $0.053 / high $0.21 | Tier 1 限 5 IPM | quality 精控（main_3x4 medium）|

**默认 vip 不限并发**. 除非要 quality 精控才切官转.

### 3.3 调用方式（OpenAI SDK）

```python
from openai import OpenAI
client = OpenAI(api_key=API_KEY, base_url="https://api.apiyi.com/v1")
result = client.images.edit(
    model="gpt-image-2-vip",
    image=[ref1, ref2, ref3],   # 单数 image 字段 + Python list (最多 16 张)
    prompt=PROMPT,
    size="1024x1536",           # ⭐ Manual 指定, 不要 "auto" (vip 实测 auto 默认 3:4 不靠谱)
)
b64 = result.data[0].b64_json
```

### 3.4 ⭐⭐⭐ size 参数铁律

- **manual 指定** — `size="auto"` 在 vip 不靠谱（实测 1:1 ref + auto → 输出仍 3:4）
- **size 比例最佳匹配 ref 比例**（避免 padding/crop）
- 不匹配 = AI **padding** 或 **cropping**（不是 stretch 拉伸, 不变形, 但浪费 / 丢信息）

跑款脚本里 PIL 自动选 size：

```python
from PIL import Image
w, h = Image.open(ref).size
ratio = w / h
if abs(ratio - 1.0) < 0.05:   size = "1024x1024"      # 1:1
elif ratio < 0.85:             size = "1024x1536"      # 3:4 portrait
else:                          size = "1536x1024"      # 3:2 landscape
```

### 3.5 Supersampling（Model 高清必跑）

vip 不按 size 涨价 → 跑 2048×3072 + Lanczos downscale = 同价 4× 像素：

```python
result = client.images.edit(model="gpt-image-2-vip", ..., size="2048x3072")
Image.open(raw).convert("RGB").resize((1024, 1536), Image.LANCZOS).save(final, "PNG")
```

适用：**所有 Model 图** + 高细节需求 PDP. Simple PDP single side 1024×1536 也够.

### 3.6 size 自定义约束

1. 最大边 ≤ 3840px
2. W / H 都是 16 的倍数
3. 长短比 ≤ 3:1
4. 总像素 655,360 - 8,294,400

### 3.7 常见坑

| 坑 | 修复 |
|---|---|
| `image[]` 字段名 | ✅ `image` 单数 + Python list |
| `input_fidelity` 参数 | ❌ gpt-image-2 不支持, 删 |
| `background="transparent"` | ❌ vip 不支持, 用 opaque |
| `n>1` | ❌ 只能 1, 并发 N 次 |
| 多图不标 role | ✅ "Image 1: ..." "Image 2: ..." |
| character 用多图（同脸 5-6 张） | ❌ 平均失真, 切单图 |

### 3.8 速率 + 重试

| 维度 | 建议 |
|---|---|
| 客户端超时 | 120s (vip) / 240s (官转 medium) |
| 429 重试 | 指数退避 1s → 2s → 4s + jitter，超 3 次切 gpt-image-2-all |
| 5xx 重试 | 最多 2 次 |
| 配额耗光 | 403 立刻停, 让用户充值 |

### 3.9 ⭐⭐⭐ 并发执行铁律（每款 ~6-8min 不是 19min）

vip **不限并发**, 同价 $0.03/张. **跑款全程并发, 不串行**.

#### 时间分布对比

| 阶段 | ❌ 错（串行）19min | ✅ 对（并发）6-8min |
|---|---|---|
| PDP 4 张 | 并发 90s | 同（并发 90s）|
| Self-audit 发现 N 张要 fix | **串行重跑 3min** | **并发重跑 90s** |
| Model 4 张 | **PDP 跑完才跑** ~5min | **跟 PDP 一波并发** ~2-3min（supersampling 慢一点）|
| HTML 改字段 | AI 跑完才动 ~2min | **跟 AI 并行**（主对话 Edit）|
| Segments + 派生 + scp | ~3min | ~3min（必须 AI 完才跑）|
| **总** | **~19min** | **~6-8min** |

#### 正解：8 张一波并发模板

```python
from concurrent.futures import ThreadPoolExecutor, as_completed
from openai import OpenAI

client = OpenAI(api_key=API_KEY, base_url="https://api.apiyi.com/v1")

tasks = [
    # PDP × 4 (1024×1536)
    {"tag": "pdp_black_side",  "image": [bg, ref_black], "size": "1024x1536"},
    {"tag": "pdp_brown_side",  "image": [bg, ref_brown], "size": "1024x1536"},
    {"tag": "pdp_dual",        "image": [bg, ref_dual],  "size": "1024x1536"},
    {"tag": "pdp_high_angle",  "image": [bg, ref_ha],    "size": "1024x1536"},
    # Model × 4 (2048×3072 supersampling)
    {"tag": "model_1",  "image": [wife, onfoot1], "size": "2048x3072"},
    {"tag": "model_2",  "image": [wife, onfoot2], "size": "2048x3072"},
    {"tag": "model_3",  "image": [wife, onfoot3], "size": "2048x3072"},
    {"tag": "model_4",  "image": [wife, onfoot4], "size": "2048x3072"},
]

def run_one(task):
    files = [open(f, "rb") for f in task["image"]]
    try:
        result = client.images.edit(model="gpt-image-2-vip", image=files,
                                     prompt=task["prompt"], size=task["size"])
        # 保存 / supersampling downscale ...
        return f"OK {task['tag']}"
    finally:
        for f in files: f.close()

with ThreadPoolExecutor(max_workers=8) as ex:
    for f in as_completed([ex.submit(run_one, t) for t in tasks]):
        print(f.result())
```

#### 并发铁律

1. ⭐ **PDP + Model 一波并发** — 不分两批（vip 不限并发，8 张同时跑 ~3min 总）
2. ⭐ **Self-audit 失败重跑也并发** — 发现 N 张要 fix → ThreadPool N workers 同时跑
3. ⭐ **HTML 改字段跟 AI 跑并行** — 主对话不要等 AI, 同时 Edit HTML（Edit 工具不阻塞 AI）
4. ⭐ **Segments + 派生 + scp 必须 AI 完后跑**（需要 AI 输出图作输入）
5. ⭐ **ThreadPoolExecutor max_workers ≥ N**（N = 总任务数）

#### 派 subagent 跑款也用并发

§10 subagent prompt 必须强制：
- "PDP + Model 一波 8 张并发，不分批" 写进任务描述
- 提供 ThreadPoolExecutor 模板代码片段
- 报告里要写"实际总时长" + "vip 并发数"

---

## §4 老婆 anchor（Model 必备）

### 4.1 Anchor 资产路径

`anchors/wife/`

| 文件 | 内容 | 用途 |
|---|---|---|
| `final/v5_front.png` ⭐ | 正面 0° medium | **正面大头首选** |
| `final/v5_45.png` | 45° 侧 | 45° 侧 |
| `final/v6_90.png` ⭐ | 90° 纯侧脸 low | **90° 首选（最像老婆）**|
| `07_arm_tattoo_left.jpg` ⭐ | 左臂特写 | 手臂特写镜头 |
| `08_torso_tattoo.jpg` ⭐⭐ | 躯干+双肩+锁骨纹身 master | **半身正面 / V 领 / 锁骨可见必用** |
| `06_body_walking.jpg` | 全身侧拍 + 花臂远景 | 远景商品图 |

### 4.2 选 anchor 速查

| 镜头 | 选 anchor |
|---|---|
| 正面大头 | `final/v5_front.png` |
| 45° 侧脸 | `final/v5_45.png` |
| 90° 侧脸 | `final/v6_90.png` |
| 远景商品图 | `06_body_walking.jpg` |
| 手臂特写 | `07_arm_tattoo_left.jpg` |
| 半身正面 / 锁骨 / V 领 | `08_torso_tattoo.jpg` |

### 4.3 身份变量（不可改）

- **发型**：长发披散，深棕黑 + 微红棕调，自然波纹（不绑/不盘/不扎）
- **妆容**：自然妆 / 裸唇
- **服装基调**：按鞋款匹配（详 [§7 鞋款→服装映射]）
- **纹身**：保留作品牌签名 — 左臂 full sleeve + 双肩 + 锁骨 + 胸前. 商品图 / PDP / 短视频 ✅ 保留；直播自行处理. AI 生图不用文字描述, 用真实照片 anchor.
- **神情**：自然不假笑, subtle half-smile 或中性平静

### 4.4 单图 edit 铁律（character identity）

- 1 张输入 → 1 张输出 — character 一致性场景**永远单图**
- 多图参考是反模式（5-6 张参考图会让 AI 平均失真）
- 脸 anchor 和纹身 anchor 不能同时输入, 按当前任务选一张
- 不写 DNA 文字描述, 让 AI 看真实照片学

### 4.5 服装策略 — AI 看 image 2 自由搭（不要主对话映射）

⛔ **不要 prompt 写具体服装单品**（"linen wide-leg pants + tank top"等）
⛔ **不要主对话提前映射"鞋款 → 服装"表**（映射 = 同质化 + AI 自由发挥被锁死）
⛔ **不要 prompt 写 `pose_text` / `setting_text` / `framing` 文字**（pose / 框架 / 环境 全部从 image 2 学）

✅ **Prompt 只给 creative brief**（aesthetic + palette + banned），AI 看 image 2 (上脚 ref) 自动搭配:

```
OUTFIT (AI freely interprets by reading Image 2 vibe):
- Aesthetic: quiet luxury, Lemaire / Toteme / The Row / Khaite editorial
- Color palette: muted earthy neutrals only (cream, taupe, charcoal, navy, brown, oat, dusty olive)
- Cohesion: outfit naturally pairs with footwear from Image 2
- Banned: bright/saturated colors, logos, prints, streetwear, Y2K, frilly/lace, tight cleavage
```

OpenAI 官方支持 "give creative brief, model interprets". AI 看 image 2 调性自动决定具体单品.

**4 张 Model 的差异化靠选 4 张不同上脚 ref 实现**（自带 pose + outfit + 环境 + framing 4 维差异），不靠 prompt 文字变量.

---

## §5 PDP 主图 Prompt 模板（A 场景纯净版）

### 5.1 极简模板 — "换 BG + 重调光"（用户原话，2026-05-15 v3 锁定）

用户铁律："我们的提示词逻辑其实就是**简单的要求他把这个背景换了，然后按照这个背景去重新调光源**".

**单色 PDP（每色 1 张 ref + BG anchor）**：

```python
PROMPT = """Multi-image edit.

Image 1 = TARGET BACKGROUND: warm cream-beige (#F5F2EC) plaster surface, soft 11 o'clock ambient daylight, low contrast.

Image 2 = THE SHOE (single color, single pair). Photographic ground truth.

Render:
- Use Image 2's shoe exactly as is (silhouette, materials, hardware, colorway, angle).
- REPLACE Image 2's background with Image 1's plaster surface.
- RE-LIGHT the shoe to match Image 1's 11 o'clock daylight direction. Natural soft contact shadow.

3:4 portrait. Shoe occupies ~60-80% of frame, centered.

Aesthetic: quiet luxury editorial.

DO NOT: text, watermark, logo, models, feet, legs, dark wood, ledge, reflections, second pair."""
```

**多色 Triple / Dual PDP（N 张单色 ref + BG anchor）**：

```python
PROMPT = """Multi-image edit.

Image 1 = TARGET BACKGROUND: warm cream-beige (#F5F2EC) plaster surface, soft 11 o'clock ambient daylight, low contrast.

Image 2-N = N pairs in different colorways (one image per colorway). Photographic ground truth.

Render:
- Place all N pairs (one from each Image 2-N) side-by-side on Image 1's plaster surface.
- Use each pair exactly as shown in respective image (silhouette, materials, colorway).
- REPLACE all backgrounds with Image 1's plaster.
- RE-LIGHT all pairs to match Image 1's 11 o'clock daylight direction.

3:4 portrait. All pairs together occupy ~75% of frame width, centered.

Aesthetic: quiet luxury editorial.

DO NOT: text, watermark, logo, models, feet, legs, dark wood, ledge, reflections."""
```

**核心修复**（vs 旧 v2）：
- 删 "Preserve all details from Image 2 exactly" → 这条太笼统让 AI 也保环境
- 改为 "换 BG + 重调光" — 极简清晰
- 多色不用 contact sheet → 用 N 张单色 ref（每色 1 张）

**对照 §2 Ref 选择优先级 1**：必须用"单色单只完整"档口图作 ref，PIL crop contact sheet 是优先级 2 仅备用.

### 5.2 PDP 跑款配置（按 colorway 数）

| Colorway | PDP 张数 | 示例 |
|---|---|---|
| 单色 | 3-4 | 90° side / 3/4 high_angle / top_down (若有 ref) / detail close-up |
| 双色 | 4 | black 90° / brown 90° / dual 90° / dual high_angle |
| 三色 | 5 | 每色 90° × 3 / dual high_angle / top_down (若有 ref) |

### 5.3 BG anchor

| Anchor | 用途 | 路径 |
|---|---|---|
| `bg_plaster_ambient_1024x1536.png` ⭐ **PDP 主图首选** | 暖米 plaster + soft ambient + 无几何 | `anchors/scene/` |
| `bg_double_cream_v2_1024x1536.png` | 几何 BG (墙+地+L角) — 需要时用 | 同上 |
| `bg_top_down_floor_1024x1536.png` | top_down 专用（纯地面, 无墙）| 同上 |

### 5.4 自动 size 选择脚本

```python
def auto_size(ref_path: str) -> str:
    w, h = Image.open(ref_path).size
    ratio = w / h
    if abs(ratio - 1.0) < 0.05:   return "1024x1024"
    if ratio < 0.85:                return "1024x1536"
    return "1536x1024"
```

---

## §6 Model 模特图 Prompt 模板（v7 5-slot Recipe）

### 6.1 调用配置 — 两路径（按 ref 是否含脸 分）

**路径 A · Ref 含完整脸**（优先级 1）— 传 face anchor，输出含老婆脸:

```python
result = client.images.edit(
    model="gpt-image-2-vip",
    image=[
        wife_anchor,        # image 1: 老婆 face anchor
        plaster_bg,         # image 2: plaster BG anchor
        onfoot_ref,         # image 3: 上脚 ref (含完整脸)
    ],
    prompt=PROMPT_FACE,     # 见 §6.2 路径 A 模板
    size="2048x3072",
)
```

**路径 B · Ref 自然没头**（优先级 2）— **不传 face anchor**，输出也没头:

```python
result = client.images.edit(
    model="gpt-image-2-vip",
    image=[
        plaster_bg,         # image 1: plaster BG anchor
        onfoot_ref,         # image 2: 上脚 ref (自然没头 close-up / 半身 / 俯拍)
    ],
    prompt=PROMPT_NOFACE,   # 见 §6.2 路径 B 模板
    size="2048x3072",
)
```

**所有路径**:
- Lanczos downscale: `Image.open(raw).resize((1024, 1536), Image.LANCZOS).save(final)`
- Prompt 完全固定不带 pose/framing/outfit 变量
- 4 张 Model 调 4 次, 每次传不同的 onfoot ref

### 6.2 Prompt 模板 v9 — 两路径（2026-05-15 HM6124 v12 验证锁定）

#### 路径 A · Ref 含完整脸（3 image: face + bg + onfoot_ref）

```
Multi-image edit. 3 reference images.

⭐ Image 1: SUBJECT IDENTITY ANCHOR (face / hair / bone structure ONLY).
EXTRACT ONLY: face, hair, bone structure.
⛔ IGNORE outfit/accessories/background/pose/expression from image 1.

⭐ SKIN TRANSLATION: TRANSLATE her identity into a real candid iPhone snapshot — natural skin texture with visible micro pores. NO smooth/plastic finish.

⭐ Image 2: TARGET BACKGROUND — warm cream-beige (#F5F2EC) plaster surface, soft 11 o'clock daylight. REPLACE Image 3's background with this.

⭐ Image 3: ON-FOOT REFERENCE (model with complete face visible). Photographic ground truth.

⭐⭐⭐ POSE + FRAMING + FOOTWEAR LOCK (mandatory):
- Output's POSE / FRAMING / body angle / leg position / camera distance MUST exactly COPY Image 3.
- Footwear MUST exactly match Image 3 (silhouette / materials / colorway / angle).
- Replace Image 1's identity into Image 3's pose. Replace Image 3's background with Image 2.

[Photography Style]
Photorealistic candid iPhone 15 Pro snapshot, natural skin texture, no plastic.

[Composition]
COPY Image 3's framing/pose/distance EXACTLY. Gaze averted, NEVER smile.

OUTFIT (AI freely designs — quiet luxury):
- Aesthetic: Lemaire / Toteme / The Row / Khaite editorial
- Color palette: muted earthy neutrals (cream, taupe, charcoal, navy, brown, oat, dusty olive)
- Cohesion: pairs naturally with footwear from Image 3
- ⛔ DO NOT copy Image 3's exact outfit (fresh design)
- ⛔ DO NOT copy Image 1's outfit

[Constraints]
PRESERVE EXACTLY: face from Image 1; Image 3's pose/framing/footwear; plaster bg from Image 2.
NO: text, watermark, logo, plastic skin, looking-at-camera, smile.
⛔ DO NOT alter pose/framing/footwear from Image 3.
⛔ DO NOT carry over background from Image 3.
```

#### 路径 B · Ref 自然没头（2 image: bg + onfoot_ref，**不传 face anchor**）

```
Multi-image edit. 2 reference images.

⭐ Image 1: TARGET BACKGROUND — warm cream-beige (#F5F2EC) plaster surface, soft 11 o'clock daylight. USE this as the COMPLETE background.

⭐ Image 2: ON-FOOT REFERENCE — partial body view (no head, e.g. below-knee / seated half body / topdown feet).

⭐⭐⭐ FRAMING LOCK (mandatory — no head, no torso):
- Output's framing MUST exactly match Image 2.
- If Image 2 shows only legs/feet (no head, no torso) → output is ALSO only legs/feet.
- ⛔ DO NOT extend the body upward to add a head, face, or torso.
- ⛔ DO NOT change crop / camera distance.

⭐⭐⭐ POSE + FOOTWEAR LOCK:
- COPY Image 2's pose / leg position / body angle / foot angle exactly.
- Footwear MUST match Image 2 exactly (silhouette / materials / colorway / angle).

⭐⭐⭐ BACKGROUND REPLACE:
- Background → 100% from Image 1 (plaster).
- ⛔ DO NOT carry over Image 2's floor / wall / tiles / concrete / props (handbags / chairs / etc.).

[Photography Style]
Photorealistic candid iPhone 15 Pro snapshot, natural skin texture (on visible skin), no plastic.

[Subject]
A woman's lower body (legs + feet only, matching Image 2's exact crop).

OUTFIT (AI freely designs — quiet luxury):
- Aesthetic: Lemaire / Toteme / The Row / Khaite editorial
- Color palette: muted earthy neutrals (cream, taupe, charcoal, navy, brown, oat, dusty olive)
- Cohesion: pairs naturally with the footwear
- ⛔ DO NOT copy Image 2's exact outfit (fresh design)
- Banned: bright/saturated colors, logos, prints

[Constraints]
PRESERVE EXACTLY: Image 2's framing + pose + footwear + leg position; plaster bg from Image 1.
⛔ DO NOT add a head, face, or torso that's not in Image 2's frame.
⛔ DO NOT extend the body beyond Image 2's crop.
⛔ DO NOT carry over Image 2's background or props.
NO: text, watermark, logo.
```

### 6.2.1 旧 v8 模板（含变量插槽，已废弃）

```
⭐ Image 1: SUBJECT IDENTITY ANCHOR (face / hair / bone structure ONLY).
EXTRACT ONLY: face, hair, bone structure.
⛔ IGNORE outfit/accessories/background/pose/expression from image 1.

⭐ SKIN TRANSLATION: Image 1 may look polished. TRANSLATE her identity into a real candid iPhone snapshot — natural skin texture with visible micro pores, faint specular highlights, subtle uneven tone, real-life imperfection. NO smooth/plastic finish.

⭐ Image 2: ON-FOOT REFERENCE (model wearing the footwear). Photographic ground truth.

⭐⭐⭐ ANGLE & POSE LOCK (mandatory — see SKILL §1 铁律 6):
- Footwear angle in output MUST exactly match Image 2 (do NOT shift / improve / optimize angle).
- Model pose in output MUST naturally match Image 2's pose (legs / feet position / body angle).
- Output framing (full body / half / below-knee / close-up) MUST match Image 2.
- AI does NOT alter ANY of these from Image 2 — angle, pose, framing all 100% preserved.

═══════════════════════════════════════════════════════
[Photography Style]
Photorealistic candid iPhone 15 Pro snapshot — amateur smartphone aesthetic (26mm wide lens, f/1.8, slight handheld micro-blur), natural ambient daylight, real skin texture with visible micro pores and natural specular highlights, faint freckle hints, subtle uneven skin tone. NO professional retouching, NO beauty filter, NO airbrushing, NO plastic skin.

[Composition]
Match Image 2's framing and pose exactly. Eye-level camera. Gaze averted, looking off-frame / down / sideways — NEVER looking at camera, NEVER eye contact, NEVER smiling, lips gently closed (no teeth).

[Subject]
A woman in her late twenties (face identity from Image 1 only; pose / framing / footwear from Image 2).

OUTFIT (creative brief — AI reads Image 2 vibe and freely interprets):
- Aesthetic: quiet luxury, Lemaire / Toteme / The Row / Khaite editorial
- Color palette: muted earthy neutrals only (cream, taupe, charcoal, navy, brown, oat, dusty olive)
- Cohesion: outfit naturally pairs with the footwear shown in Image 2
- Banned: bright/saturated colors, logos, prints, streetwear, Y2K, frilly/lace, tight cleavage tops, AND the specific garment shown in Image 1

[Background]
Warm interior matching Image 2's setting vibe — cream plaster / minimalist neutral / soft concrete floor. Gentle 11 o'clock daylight, low contrast (max 5-8% tonal range). NO bright hotspot, NO dark vignette. NO clutter. ⛔ DO NOT use Image 1's background.

[Constraints]
PRESERVE EXACTLY: face identity from Image 1; footwear + pose + framing + footwear angle from Image 2; averted gaze; calm closed-lip expression.
NEVER: looking at camera / smile / teeth / influencer pose / plastic skin.
NO: text, watermark, logo, brand label.
⛔ DO NOT alter footwear angle, pose, framing from Image 2.
⛔ DO NOT copy outfit/accessories/expression/background from Image 1 — only face identity carries over.
```

**关键变化（vs v7 旧模板）**：
- 删 `{framing}` / `{pose_text}` / `{setting_text}` 变量插槽 → AI 看 Image 2 全部学
- 加 §1 铁律 6 「ANGLE & POSE LOCK」段（强约束 pose / framing / 鞋角度全跟 Image 2）
- 简化 prompt（不写主对话主观映射）

### 6.3 模特图 9 大铁律（v9 — 2026-05-15 HM6124 v12 后定稿）

1. ⭐ **Image (face anchor 时) = face only** — EXTRACT ONLY face/hair/bone, IGNORE outfit/background/pose/expression
2. ⭐ **SKIN TRANSLATION** — 强制翻译 polished → candid iPhone snapshot
3. ⭐ **Supersampling** — 2048×3072 + Lanczos downscale 1024×1536（同价 4× 像素）
4. ⭐ **上脚 ref（不跨用纯鞋 ref）**— PDP 用纯鞋 / Model 必须上脚, 跨用 = 鞋角度被 pose 拗歪
5. ⭐ **Averted gaze** — 永远不看镜头, NEVER smile
6. ⭐⭐⭐ **Prompt 完全不解读 ref** — 不描述鞋 (铆钉/跟形) / 不写 pose_text / 不写 outfit 单品 / 不写 framing
7. ⭐⭐⭐ **ANGLE + POSE + FRAMING LOCK**（§1 铁律 6）— 输出鞋角度 + pose + framing 100% = image 2
8. ⭐⭐⭐ **Ref 含脸 / 没头 → face anchor 配对铁律**（2026-05-15 HM6124 v12 验证 — 用户铁律）:
   - Ref 含完整脸 → 传 face anchor (3 image, 路径 A) → 输出含脸
   - Ref 自然没头 → **不传 face anchor** (2 image, 路径 B) → 输出也没头
   - ⛔ Ref 微露头（部分裁切）禁用 — AI 必强补头 → 头身比错
9. ⭐⭐ **OUTFIT FREESTYLE**（2026-05-15 HM6124 v11 验证）— AI 看 ref vibe **自由设计 fresh outfit**，不复制 ref outfit，不复制 face anchor outfit. Outfit 是 AI 唯一自由发挥的维度.

### 6.4 模特图变量化 — 靠选 4 张不同 ref 实现（不靠 prompt 文字）

⛔ **不在 prompt 写 `pose_text` / `outfit_text` / `framing` / `setting_text`** — 锁死 AI 自由发挥 + 让 ref 多样性失效.

✅ **用户原话**："模特图必须保证输出一个姿势，就换人和环境就行了" — pose 严格 100% = ref，AI 只换人脸（face anchor）+ 环境（plaster BG）.

✅ **变量化靠选不同 ref 实现**：4 张 Model = 4 张不同的上脚 ref，每张 ref 自带 4 维差异：

| 维度 | 怎么实现 |
|---|---|
| **pose** | 选 ref 时挑不同 pose（站姿 / 坐姿 / 撑膝 / below_knee 等）|
| **服装** | 不指定 — AI 看 image 2 的鞋调性自由搭（§4.5 creative brief）|
| **环境** | 跟 ref 走（image 2 背景 vibe 自动延续 + prompt 加 minimal 约束）|
| **框架 framing** | 跟 ref 走（image 2 是 below-knee → 输出就 below-knee）|
| **鞋角度** | 跟 ref 走（§1 铁律 6 ANGLE LOCK）|

**跨款也变量化** — 不要全店所有款的 Model 都用同一组 ref 类型（如全都"站立 90°"）.

### 6.5 Model 跑款配置（按 colorway 数）

| Colorway | Model 张数 |
|---|---|
| 单色 | 3 张（pose × 3 / 服装 × 3 / 环境 × 3）|
| 双色 | 4 张（每色 2，pose / 服装 / 环境内部变量化）|
| 三色 | 6 张（每色 2）|

---

## §7 MAYAGI 调性规范

### 7.1 调性方向

**对标**：The Row / Khaite / Toteme / Bottega Veneta / Loewe / Jil Sander
**风格交集**：小红书 quiet luxury × 老钱 × 法式
**主理人 IP**：Bella Hadid / Cara Delevingne（花臂 + 神秘 + 高级感）
**核心情绪**：克制 / 编辑级 / 35mm 胶片质感 / 自然光

### 7.2 永远不做

- ❌ 红色促销标签 / 划线价
- ❌ 大 logo / 满屏品牌名
- ❌ 饱和色 / 渐变 / 阴影特效
- ❌ 拼接图 / 牛皮癣文字 / 手机随手拍
- ❌ 微软雅黑 / 阿里巴巴普惠体 / 卡通字体
- ❌ 纯白底做首图
- ❌ ChatGPT 典型的"AI 黄调"
- ❌ Influencer pose / duck face / 假笑

### 7.3 永远做

- ✅ 大留白（区块间 80-120px）
- ✅ 图文交替节奏（每 3-4 屏一个视觉高潮）
- ✅ 统一光影方向（同一款所有图保持一致）
- ✅ 材质微距特写（传递可触摸的质感）
- ✅ 文案克制
- ✅ 自然光 / 窗光
- ✅ Subtle half-smile 或中性平静（不露齿不假笑）

### 7.4 视觉系统统一规则

| 维度 | 决策 |
|---|---|
| **底色** | 暖米卡纸 `#F5F2EC`（全店统一）|
| **背景方案** | plaster anchor (noise pattern, 无几何) ⭐ PDP 主图首选 / geometric anchor (墙+地+L角, 需 mask) 备选 |
| **光位** | gentle 11 点光方向 + 低对比度（max 5-8% tonal range）|
| **比例** | 3:4 母版（1024×1536）+ 1:1 PIL 派生（鞋落画面 60% 黄金构图，禁止中心裁切）|
| **色调** | 米白 / 燕麦 / 焦糖 / 灰咖 / 暖灰 / 深棕 / 黑 + 苔绿/灰蓝/暖红极少量 |

### 7.5 Prompt negatives（英文黑名单）

```
- frilly / lace / ruffles / cute bows
- crop top / tight fit / cleavage
- Y2K / metallic / glitter
- bright neon / saturated colors / multi-color
- heavy makeup / fake eyelashes obvious / plastic smooth skin
- cartoonish / anime style / illustration
- influencer pose / duck face / forced smile / teeth showing
- ChatGPT-typical AI yellow tint / orange cast
- watermark / text / logo drift / extra accessories
```

### 7.6 上架图必须自己 AI 生成（品牌铁律）

所有上架到抖店的图（PDP 主图 / 1:1 / 3:4 / 详情页内嵌 / model）**必须自己 AI 生成 + mayagi 调性**.

档口图（go2 Rich1991 / 黑妹）**只作 source reference 输入给 AI** 学.

- ❌ 直接把档口图加 logo 就上架
- ❌ 用档口模特图（模特只能是 `anchors/wife/`）
- ❌ 用档口的场景作 BG

Why：mayagi = quiet luxury 自有品牌, 不是 dropshipping. 模特一致性是品牌信任底线.

---

## §8 抖店图片规范（生图必看）

### 8.1 PDP 主图（3 个独立上传位）

| 位 | 比例 | 尺寸 | 展示位置 |
|---|---|---|---|
| 主图 1:1（必填）| 1:1 | **1024-1536px** 推荐 | 搜索/其他入口 |
| 主图 3:4（选填，加 3% 流量）| **3:4 = 0.75** | **750×1000 / 1024×1365** | 店铺/橱窗 |
| 3:4 导购图（选填）| 3:4 | 600×800+ | 系统自动从 3:4 主图填充 |

⚠️ **关键陷阱**：OpenAI gpt-image-2 默认 `size=1024×1536` 实际是 **2:3 (0.667 Pinterest)**, 不是抖店 3:4 (0.75)！

**修复**：PIL 裁切到真 3:4
- 1024×1536 → **1024×1365** (PDP)
- 2048×3072 → **1536×2048** (Model supersampling)

### 8.2 通用规范

- 文件大小 ≤ 3M
- 格式 jpg / jpeg / png（推荐 JPG q=88）
- 无牛皮癣 / 无文字 / 无水印 / 无拼接 / 无变形拉伸
- 背景实拍（非纯白底, 不抠图）
- 真人模特实拍或全貌商品图

### 8.3 商品标题（≤ 15 字）

- 隐藏内部款号
- 调性优先：「鳄鱼纹尖头猫跟鞋」> 「MAYAGI 百搭大头鞋德训鞋复古低调 GI046」
- 错别字必查（历史踩过 「MAY**T**GI」/「1-3**cm**」该是 mm）

### 8.4 纹身政策

| 场景 | 政策 |
|---|---|
| 商品图 / PDP / 图集 | ✅ 基本没问题 |
| 短视频 | ⚠️ 灰色但宽容 |
| 直播裸露纹身 | ❌ 违规（用户/老婆自处理）|

---

## §9 自审 → 用户审 → 选择性重跑（流程铁律）

### 9.1 一张一张审 vs 批量审（按用户授权选）

**默认 §9.2 批量审**（mayagi-ops [[feedback-no-mvp]] 不走 MVP, 跑款是全套图）.

**例外 §9.3 一张一张审**：用户明说"一张一张审" / BG anchor 校准等高风险场景.

### 9.2 批量自审流程

1. **完整套图跑完 → 主对话/subagent 先自审一遍**（不给用户）
   - 对比每张 raw 跟 source ref 看鞋型是否一致
   - colorway 是否清晰区分
   - signature 元素是否保留
   - model 4 张内部 pose / 服装 / 环境 4 维变量化
   - model averted gaze + 真实 iPhone skin
   - PDP 鞋占画面 + 调性 quiet luxury
   - logo opacity 分级（PDP 0.90 / Model 0.30）正确
2. **自审发现问题 → 立即重跑那张**（不需问用户）
3. **自审通过 → 给用户审**（公网 URL + zip + 简要总结）
4. **用户审有问题 → 用户指哪张哪个问题 → 单张重跑**（不重跑全套）
5. **用户审 OK → 部署 / 发老婆**

### 9.3 一张一张审

每张 AI 生图 = 独立 review gate：跑完一张 → 描述给用户审 → 用户回应（OK / 重跑）才跑下一张.

- ❌ 一个脚本跑完几张接 PIL 后期 + 部署 + 更新文档
- ✅ 一个脚本只跑一张, 或脚本分段
- ✅ PIL 派生（main_1x1）不算 review gate, 但 PIL 前 AI 原图必须审过

Why：BG anchor 错 → 基于它的 hero 也作废 → 已部署 = 公网有问题图 + 回滚成本高.

### 9.4 SendMessage 中途纠正 subagent

subagent 跑款时主对话发现 prompt 错误 → 立即 `SendMessage(to=agent_id, message=...)` → subagent 收到后自主审已跑出的图 → 决定是否重跑.

用法：`SendMessage(to="<agentId>", summary="紧急撤回 X", message="...")` — agentId 从 Agent launch response 拿. 必须等 subagent 完成报告（不能 kill）.

---

## §10 派 subagent 跑款 prompt 标准模板

派 subagent 跑款（一键端到端 PDP + Model）的 prompt 必须包含 7 块：

```markdown
# 0 必做：触发 Skill(sku-generate)
第一件事调用 `Skill(skill="sku-generate")` 加载生图 SSOT（5 条铁律 / API / 模板）.

# 1 SKU brief
- 款号 / 档口 / go2_url / 图包路径
- 鞋型 / Signature / Spec / Colorway / 工作命名

# 2 Ref 选择（§2 流程）
- 主对话已审过的 source 映射表
- PDP 用纯鞋 ref / Model 用上脚 ref
- 没真 overhead 不跑 top_down

# 3 模板路径
- PDP 脚本基线: scripts/<最新 SKU>/run_pdp_v2_clean.py
- Model 脚本基线: scripts/<最新 SKU>/run_models_v9_clean.py

# 4 执行步骤
1. cp + 改脚本 → ⭐ **跑 PDP + Model 一波 8 张并发**（§3.9 — ThreadPoolExecutor max_workers=8，vip 不限并发，~3min 总）
2. 自审（§9.2 流程）→ 发现 N 张要 fix → **并发重跑**（不串行）
3. HTML 改字段跟 AI 跑并行（不阻塞）
4. 报告（含 "实际总时长" + "vip 并发数"）

# 5 必嵌 §1 5 条核心铁律（粘贴原文）
**绝对禁止**: prompt 描述鞋本身. 违反 = 鞋型必偏移 + 浪费 vip 钱.

# 6 边界
- ❌ 不能 ad-hoc 加 prompt 描述鞋（即使 signature 特别）
- ❌ 不主动改命名 — 用工作命名
- ✅ 跑通端到端 + 报告

# 7 报告格式（≤ 500 字）
SKU 跑款报告 / 自审结论 / 张数清单 / 公网 URL / 成本 / 问题清单 / 建议沉淀进 SKILL
```

**关键铁律**（subagent 必明白）：
1. **Skill(sku-generate) 必须触发**
2. **不允许 ad-hoc 加 SIGNATURE 描述**
3. **§1 5 条铁律必须粘贴在 prompt 里**（subagent 不会 read SKILL, 靠 prompt 内嵌）
4. **报告强制 "自审结论"**
5. **允许 subagent 自主发现新铁律并报告**

---

## §11 常见报错与处理

| 报错 | 根因 | 解决 |
|---|---|---|
| `403 insufficient_quota` | API易 quota 耗光 | 让用户充值 |
| `429 rate_limit` | OpenAI Tier 1 5 IPM 限流 | 退避重试 1→2→4s + jitter; 超 3 次切 `gpt-image-2-all` |
| `usage.image_tokens=0` | API易 metadata bug（不影响实际）| 忽略 |
| 脸不像老婆 | character 用多图参考 → AI 平均失真 | 切单图 edit |
| 鞋型变形 | Ref resize 改尺寸 | Ref 用 crop 不用 resize |
| 鞋中线歪 | 纯鞋 ref 跑 model | 换上脚 ref |
| AI 输出角度跟 ref 不一致 | Prompt 没强约束 angle lock | Prompt 加 "Camera angle MUST match Image 2 exactly" |
| 鞋型饱满硬质（像鞋楦撑着）| Refs 用了 rembg paste cream | Refs 改 PIL.crop 原图 |

---

## §12 改进备忘（最近 3 条教训）

> 历史 changelog 全删. 只保留最新跑款发现的非显然事实.

- **2026-05-15** HM 5 款连环踩坑 → 沉淀 §1 5 条核心铁律（图片永远比语言准确）
- **2026-05-15** HM2058 top_down 无 source 硬跑 → 鞋身拉长 → 沉淀 §1 铁律 2（视角不必恒定）
- **2026-05-15** Ref 比例 vs Output size 矛盾解决 → 沉淀 §3.4 size manual 指定 + ref 用 crop 不用 resize

---

## §13 跨 skill 跳转

- 扒 go2 图包 → `Skill(skill="sku-fetch")`
- 写详情页 HTML → `Skill(skill="sku-htmlpage")`
- 派生 / 部署 / 上架 → `Skill(skill="sku-deploy")`
