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

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
+23 -3
View File
@@ -47,11 +47,31 @@ def list_colors(db_path, spu_code: str) -> List[Dict[str, Any]]:
return [dict(r) for r in rows]
def _norm_name(s: str) -> str:
"""去空格(半角+全角)+ 小写,用于 SKU code 与文件夹名比较。"""
return str(s or "").replace(" ", "").replace(" ", "").strip().lower()
def find_basemap(basemap_root, spu_code: str, sku_code: str) -> Optional[Path]:
"""basemap/<款号>/<SKU.code>/ 下第一张图片;无返回 None。"""
d = Path(basemap_root) / spu_code / sku_code
if not d.exists():
"""basemap/<款号>/<SKU.code>/ 下第一张图片;无返回 None。
SKU code 与文件夹名比较时两边都去空格(兼容 db code 或文件夹名带空格)。
"""
root = Path(basemap_root) / spu_code
if not root.exists():
return None
target = _norm_name(sku_code)
if not target:
return None
d = root / sku_code
if not (d.exists() and d.is_dir()):
d = None
for cand in sorted(root.iterdir()):
if cand.is_dir() and _norm_name(cand.name) == target:
d = cand
break
if d is None:
return None
for f in sorted(d.iterdir()):
if f.is_file() and f.suffix.lower() in IMG_EXTS:
return f