feat: select subject views for endpoint frames

This commit is contained in:
2026-05-18 13:58:45 +08:00
parent c7c7301c13
commit b5b1e43624
3 changed files with 157 additions and 28 deletions

View File

@@ -3975,12 +3975,10 @@ def generate_scene_asset(job_id: str, idx: int, req: GenerateSceneAssetReq) -> J
else "Remove the main foreground subject from the frame if present. "
)
identity_clause = (
f"Use the generated subject asset references as the primary character identity lock ({len(subject_ref_paths)} image(s)); keep the same transparent body shell, clean visible skeleton, proportions, material, and ad-friendly non-horror identity. "
f"Use the generated subject asset references as the primary character identity lock ({len(subject_ref_paths)} image(s)); preserve the subject type, material, proportions, style, age/gender presentation, pose vocabulary, and ad-friendly identity exactly as shown in those selected views. "
if subject_ref_paths
else (
"Known character identity cues: " + ", ".join(confirmed_subjects) + ". "
if confirmed_subjects
else "Infer one consistent friendly transparent human character identity from the provided references. "
"No generated subject reference was provided for this endpoint. Do not add a main character unless the user scene direction explicitly asks for one. "
)
)
mode_clause = {
@@ -4026,6 +4024,15 @@ def generate_scene_asset(job_id: str, idx: int, req: GenerateSceneAssetReq) -> J
if product_ref_paths
else "Do not invent a random product. Only include an SKG product if the user prompt explicitly asks for it. "
)
subject_asset_clause = (
TRANSPARENT_HUMAN_POSITIVE_PROMPT + " "
+ TRANSPARENT_HUMAN_NEGATIVE_PROMPT + " "
+ "If the selected subject references are transparent humanoid assets, keep 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. "
+ "If the selected subject references are normal actor assets, keep them as a normal believable commercial actor and do not convert them into a transparent skeleton. "
+ "Use the selected subject views only to understand identity, proportions, material, pose vocabulary, camera language, and lighting; do not copy watermarks, subtitles, platform UI, logos, or accidental artifacts. "
if subject_ref_paths
else "No main character should be generated unless the user scene direction explicitly requires one; product-only and environment-only frames should stay product-only or scene-only. "
)
if req.asset_role == "scene":
prompt = (
"Create one clean high-definition scene/background reference image from this frame. "
@@ -4052,11 +4059,8 @@ def generate_scene_asset(job_id: str, idx: int, req: GenerateSceneAssetReq) -> J
+ user_prompt_clause
+ style_clause + " "
+ product_asset_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. "
+ subject_asset_clause
+ "Do not create a plain background plate. Do not include SKG product unless the user prompt explicitly asks for it. "
+ "The output should be ready as a first/last frame for Seedance video generation, with stable composition, believable perspective, clear subject, no text, no watermark, no gore, no medical surgery imagery."
)
models = [GPT_IMAGE_MODEL]