feat: 试用过程中的细节优化

This commit is contained in:
2026-09-13 22:19:16 +08:00
parent dbb2bb80bd
commit 897e5585c0
40 changed files with 1156 additions and 257 deletions
+14 -3
View File
@@ -96,12 +96,13 @@ def _prompt_ecommerce_detail(ctx: dict, style: dict, lang: str) -> str:
def _prompt_size_chart(ctx: dict, style: dict, lang: str) -> str:
dims = params_line_for_output(ctx, lang)
annotation = ctx.get("dimension_annotation_instruction") or "Do not invent measurement directions or values."
return (
f"Product size chart infographic for \"{ctx['title']}\": product shown in clean front and side views "
f"on light background, with thin measurement annotation lines (arrows) marking length, width and height, "
f"on light background, with thin measurement annotation lines (arrows) only for supplied dimensions, "
f"measurement values rendered next to each line"
+ (f" (known specs: {dims})" if dims else "")
+ f", small caption row, precise technical drawing aesthetic. {style['tone']}. "
+ f". {annotation} Small caption row, precise technical drawing aesthetic. {style['tone']}. "
f"{TEXT_RENDER[lang]} {QUALITY} {PRODUCT_REF_LOCK}"
)
@@ -136,7 +137,8 @@ _PROMPT_BUILDERS = {
def build_prompt(type_id: str, ctx: dict, style_set: int, lang: str, extra: dict | None = None,
style_prompt: str | None = None, requirements: str | None = None) -> str:
style_prompt: str | None = None, requirements: str | None = None,
requirements_exclusive: bool = False) -> str:
"""构造指定图类型的完整生图 prompt(主体参考语义)。
extra: 方案项信息 {title, detail, prompt_hint}——custom 类型必需,
@@ -145,6 +147,15 @@ def build_prompt(type_id: str, ctx: dict, style_set: int, lang: str, extra: dict
requirements: 生图要求(最高优先级,强制约束),置于 prompt 最前面,
声明覆盖一切冲突指令,用户可在此输入强制要求。
"""
if requirements_exclusive:
return " ".join([
requirements_block(requirements),
"Execute only the strict requirements above. Do not add marketing layouts, captions, overlays, "
"props, default studio styling, or visible text unless explicitly requested.",
"Preserve the reference image exactly unless the strict requirements explicitly request a "
"specific change. When they do, make only that requested change and preserve everything else.",
"Do not make any change that was not explicitly required.",
])
style = resolve_style(style_set, style_prompt)
extra = extra or {}
if type_id == "custom":