feat: Implement Character Memory V1 - VLM analysis and prompt injection
This commit is contained in:
@@ -473,8 +473,35 @@ async def regenerate_frame_image(
|
||||
else:
|
||||
logger.warning(f"[REGEN-IMG] No style anchor found for {storyboard_id}")
|
||||
|
||||
# Apply style prefix to prompt
|
||||
final_prompt = f"{style_prefix}, {prompt}" if style_prefix else prompt
|
||||
# Get character descriptions for prompt injection
|
||||
character_prefix = ""
|
||||
from api.routers.quality import _character_stores
|
||||
if storyboard_id in _character_stores:
|
||||
char_descriptions = []
|
||||
for char_data in _character_stores[storyboard_id].values():
|
||||
appearance = char_data.get("appearance_description", "")
|
||||
clothing = char_data.get("clothing_description", "")
|
||||
name = char_data.get("name", "character")
|
||||
|
||||
if appearance or clothing:
|
||||
parts = [f"{name}:"]
|
||||
if appearance:
|
||||
parts.append(appearance)
|
||||
if clothing:
|
||||
parts.append(f"wearing {clothing}")
|
||||
char_descriptions.append(" ".join(parts))
|
||||
|
||||
if char_descriptions:
|
||||
character_prefix = "Characters: " + "; ".join(char_descriptions) + ". "
|
||||
logger.info(f"[REGEN-IMG] Injecting character descriptions: {character_prefix[:80]}...")
|
||||
|
||||
# Apply style prefix and character descriptions to prompt
|
||||
final_prompt = ""
|
||||
if style_prefix:
|
||||
final_prompt += f"{style_prefix}, "
|
||||
if character_prefix:
|
||||
final_prompt += character_prefix
|
||||
final_prompt += prompt
|
||||
logger.info(f"[REGEN-IMG] Final prompt: {final_prompt[:120]}...")
|
||||
|
||||
# Use MediaService to generate image via RunningHub workflow
|
||||
|
||||
Reference in New Issue
Block a user