feat: 试用过程中的细节优化
This commit is contained in:
@@ -98,12 +98,13 @@ def _task_ecommerce_detail(ctx: dict, lang: str) -> str:
|
||||
|
||||
def _task_size_chart(ctx: 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 (
|
||||
"Create a size chart: the unchanged product in clean front and side views on a light background, "
|
||||
"thin measurement annotation lines (arrows) marking length, width and height with values beside "
|
||||
"thin measurement annotation lines (arrows) only for supplied dimensions with values beside "
|
||||
"each line"
|
||||
+ (f" (known specs: {dims})" if dims else "")
|
||||
+ ", small caption row, precise technical-drawing aesthetic."
|
||||
+ f". {annotation} Small caption row, precise technical-drawing aesthetic."
|
||||
)
|
||||
|
||||
def _task_sku_collection(ctx: dict, lang: str) -> str:
|
||||
@@ -128,8 +129,19 @@ _TASK_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:要求块 → 指令 → 主体锁 → 锚定 → 风格 → 文案 → 画质 → 提醒。"""
|
||||
if requirements_exclusive:
|
||||
return "\n\n".join([
|
||||
requirements_block(requirements),
|
||||
"Edit the first image only as required above. Do not add marketing layouts, captions, overlays, "
|
||||
"props, default studio styling, or visible text unless explicitly requested above.",
|
||||
"PROTECTION: preserve the first image exactly unless the strict requirements explicitly request "
|
||||
"a specific change. When they do, make only that requested change and preserve everything else.",
|
||||
"Final check: follow the strict requirements over every default behavior; do not make changes "
|
||||
"that were not explicitly required.",
|
||||
])
|
||||
style = resolve_style(style_set, style_prompt)
|
||||
extra = extra or {}
|
||||
hint = (extra.get("prompt_hint") or "").strip()
|
||||
|
||||
Reference in New Issue
Block a user