模板导出增强 + 模特性别分组 + 三合一提示词精简

1) 模板导出:识别「基码表-胸围」填 sku.bust(多个胸围列都填);申报价格模糊匹配多列统一按加价后价格填写;详情图文不再拼接 img_url_2;SPU 款式来源统一填「现货款」;商品产地国家简称映射(沙特→沙特阿拉伯)
2) 模特性别分组:model_features 按男女分组,按模板类目含男/女固定取对应性别模特(含 Pinterest 模式 pipeline)
3) 三合一提示词:去掉 DESIGN CONTENT 四要素描述(设计已由设计稿提供)
4) 生图尺寸:全部改为读 config 不再硬编码(设计图 compose.design_size / 合成图 compose.size / 种草图 seed_shot.size)
This commit is contained in:
2026-08-26 18:05:11 +08:00
parent e317547b8b
commit b7f429db89
93 changed files with 2708 additions and 583 deletions
+10 -11
View File
@@ -10,18 +10,17 @@ v3:模板按国家区分(COUNTRY_TEMPLATES),每国有自己的设计风
from typing import Any, Dict, Optional
# —— 通用固定段(所有国家共用,保证结构一致)——
# 尺寸规则:最小约 15×18cm ~ 最大 26×32cm 之间自由选择(防模型默认出满幅大图)
# 尺寸规则:印花必须「小且居中、四周大量留白」,禁止满幅/自带背景(防模型默认出满幅大图)
SIZE_RULE = (
"size: choose freely between a MINIMUM print area of about 15x18 cm "
"and a MAXIMUM of 26x32 cm, any size in this range fits, "
"pick the one that best suits the design, keep proportions, "
"scale naturally to the content, do NOT stretch, "
"do NOT fill the entire canvas, do NOT force full-bleed, "
"leave balanced margins around the artwork"
"size: the print artwork must be SMALL and CENTERED with clearly larger white margins "
"around it, print area between about 15x18 cm and 26x32 cm, keep proportions, "
"scale naturally to the content, do NOT stretch, do NOT fill the entire canvas, "
"do NOT force full-bleed, leave wide balanced white margins around the artwork"
)
# 排除段:无衣服/模特/场景/水印
# 排除段:纯白底/无背景/无衣服/模特/场景/水印
NEG_FIXED = (
"no garment, no shirt, no model, no mannequin, no background scene, no watermark"
"isolated on pure white background, no background, no scene, no texture, no frame, no border, "
"no garment, no shirt, no model, no mannequin, no watermark"
)
# 文字规则(v3):可加可不加、适配印花即可;任何文字严禁敏感内容
# 注意:正向提示词不写敏感词(no politics/no hate/no violence/no sexual…会被图像审核误判),
@@ -71,6 +70,7 @@ DEFAULT_TEMPLATES: Dict[str, str] = {
"studio lighting, e-commerce product photo, no human model"
),
# 复合提示词(三图模特合成):图1=模特 / 图2=纯印花设计稿 / 图3=平铺底图 → 模特穿着成品
# 设计已由图2提供,不再附加 DESIGN CONTENT 四要素描述
"composite_prompt": (
"【图片角色,按提交顺序】图1=模特实拍图(基底);图2=纯印花设计稿;"
"图3=平铺衣服底图(颜色/面料来源)。\n"
@@ -85,8 +85,7 @@ DEFAULT_TEMPLATES: Dict[str, str] = {
"杜绝“贴纸感”与“平面涂色感”。\n"
"5.光影融合:按图1环境光方向调整亮度/对比度,印花受光影响产生明暗变化但色号不偏移。\n"
"6.纯净输出:仅输出一张最终合成图;图1背景/人物/构图/光影100%不变,"
"仅替换衣服印花与底色。\n"
"DESIGN CONTENT: {motif}, {art_style}, {color_palette}, {composition}."
"仅替换衣服印花与底色。"
),
# 复合负向(印图专用)
"composite_negative": (