v110-v112 自定义模式完善 + 模板导出增强 + 多模态兼容优化
- 自定义模式:分析模型输出 delta 唯一改动指令,生图模板 custom_image_prompt.md({delta} 占位符),不再使用负向提示词;generate_design 按 custom_mode 分支,Pinterest 模式保留原创化指令,两模式互不影响
- 多模态分析 response_format 三级回退(json_schema → json_object → none),兼容 DeepSeek
- 模板导出:details 扩展列(细节1/2/3)、target_audience 扩展列(适用人群1)、固定值风格1=休闲/风格2=运动
- 童装特征库更新 + 标题模板外部化 + 图源映射增强
This commit is contained in:
+10
-2
@@ -84,7 +84,15 @@ def upload_to_oss(cfg: dict, local_path: str, object_key: str) -> Optional[str]:
|
||||
return None
|
||||
|
||||
|
||||
def build_oss_key(country: str, timestamp: str, code: str, rand4: str, ext: str = ".jpg") -> str:
|
||||
"""对象 key:{国家}/{时间戳}/{货号}_{4位随机}.jpg(如 GB/20260820150945/DG000_Ab3x.jpg)。"""
|
||||
def build_oss_key(country: str, timestamp: str, code: str, rand4: str,
|
||||
ext: str = "", local: Optional[str] = None) -> str:
|
||||
"""对象 key:{国家}/{时间戳}/{货号}_{4位随机}.jpg(如 GB/20260820150945/DG000_Ab3x.jpg)。
|
||||
|
||||
ext 未显式指定时,优先从 local(实际待上传文件)的真实后缀推导——
|
||||
文件可能是 png/jpg 而非固定 jpg;local 也未提供时回退 ".jpg"。
|
||||
"""
|
||||
if not ext.strip() and local:
|
||||
ext = Path(local).suffix if Path(local).suffix else ".jpg"
|
||||
ext = ext.strip() or ".jpg"
|
||||
safe = lambda s: "".join(c for c in (s or "") if c.isalnum() or c in "-_").strip()
|
||||
return f"{safe(country)}/{safe(timestamp)}/{safe(code)}_{safe(rand4)}{ext}"
|
||||
|
||||
Reference in New Issue
Block a user