auto-save 2026-05-14 12:04 (~4)

This commit is contained in:
2026-05-14 12:04:20 +08:00
parent f0c6c5b916
commit 9f3e28d230
4 changed files with 105 additions and 138 deletions

View File

@@ -2919,6 +2919,8 @@ def generate_scene_asset(job_id: str, idx: int, req: GenerateSceneAssetReq) -> J
+ reference_clause
+ user_prompt_clause
+ style_clause + " "
+ TRANSPARENT_HUMAN_POSITIVE_PROMPT + " "
+ TRANSPARENT_HUMAN_NEGATIVE_PROMPT + " "
+ "The frame must feature the same friendly transparent or translucent human character: glass/acrylic/vinyl-like transparent outer body, visible clean white skeleton inside, clean commercial wellness style, non-horror. "
+ "Use the references only to understand character identity, proportions, transparent shell, white bones, pose vocabulary, camera language, and lighting; do not copy watermarks, subtitles, platform UI, logos, or accidental artifacts. "
+ "Do not create a plain background plate. Do not remove the character. Do not include SKG product unless the user prompt explicitly asks for it. "
@@ -3697,12 +3699,12 @@ def create_product_fusion_guide(job_id: str, req: ProductFusionShot) -> dict:
def fallback_product_fusion_descriptions() -> list[str]:
return [
"双手拿起 SKG 颈部按摩仪,准备戴到脖子上,镜头轻微推近产品。",
"把 SKG 按摩仪贴合到肩颈位置,手部轻轻调整两侧机身角度。",
"坐在场景中轻按侧边控制区,产品保持在画框指定区域内清晰可见。",
"闭眼放松,肩颈从紧绷变舒展,产品佩戴位置稳定不漂移。",
"镜头靠近展示 SKG 产品材质、按键和内侧触点,手部不要遮挡产品主体。",
"使用后的放松状态收尾,人自然抬头,产品仍保持白色 U 形外观和真实比例。",
"透明骨架人双手拿起 SKG 颈部按摩仪,准备戴到脖子上,镜头轻微推近产品。",
"透明骨架人把 SKG 按摩仪贴合到肩颈位置,手部轻轻调整两侧机身角度。",
"透明骨架人坐在场景中轻按侧边控制区,产品保持真实比例并清晰可见。",
"透明骨架人闭眼放松,肩颈从紧绷变舒展,产品佩戴位置稳定不漂移。",
"镜头靠近展示 SKG 产品材质、按键和内侧触点,透明骨架人的手部不要遮挡产品主体。",
"使用后的放松状态收尾,透明骨架人自然抬头,产品仍保持白色 U 形外观和真实比例。",
]
@@ -3716,16 +3718,19 @@ def generate_product_fusion_descriptions(job_id: str, req: ProductFusionDescript
return {"descriptions": fallback, "mode": "fallback"}
shot_lines = []
for i, shot in enumerate(shots, start=1):
product = (shot.product_image or {}).get("label") or "SKG 产品图"
person = (shot.person_image or {}).get("label") or "白底人物姿态图"
scene = (shot.scene_image or {}).get("label") or "场景图"
region = shot.product_region
region_text = f"x={region.x:.2f}, y={region.y:.2f}, w={region.w:.2f}, h={region.h:.2f}" if region else "未画区域"
shot_lines.append(f"{i}. 产品={product};人物={person};区域={region_text};场景={scene};已有描述={shot.action_text or ''}")
first = (shot.first_image or {}).get("label") or "首帧未填"
last = (shot.last_image or {}).get("label") or "尾帧未填"
products = [
(ref or {}).get("label") or f"产品角度{idx + 1}未填"
for idx, ref in enumerate((shot.product_images or [])[:3])
]
while len(products) < 3:
products.append(f"产品角度{len(products) + 1}未填")
shot_lines.append(f"{i}. 首帧={first};尾帧={last};产品角度={products[0]} / {products[1]} / {products[2]};已有描述={shot.action_text or ''}")
prompt = (
"你是 SKG 产品短视频分镜导演。请为 6 条产品融合镜头各写一条中文动作描述,"
"每条 20-40 字,必须说明人在做什么、产品如何佩戴/展示、动作如何自然连续"
"产品是 SKG 白色 U 形颈部/肩颈按摩仪,不要写医疗治疗承诺,不要出现竞品。"
"每条 20-45 字,必须说明透明骨架人在做什么、产品如何佩戴/展示、动作如何从首帧自然过渡到尾帧"
"产品是 SKG 白色 U 形颈部/肩颈按摩仪,三张产品角度图是同一产品的身份真源;不要写医疗治疗承诺,不要出现竞品。"
"输出 JSON{\"descriptions\":[\"...\", \"...\"]}。\n\n"
+ "\n".join(shot_lines)
)