import sys
sys.path.insert(0,"/home/zyw/Downloads/dasiwa-h3-research")
import v18_pipeline as p
BASE="/home/zyw/Downloads/dl-hub/100-长安Disco-场景图"

CFG={
 "A2": dict(body="人物参考2/A-白背心短裤-正面.jpg",
   outfit="a white cropped camisole with a small pink bow on the strap, white denim shorts and white flat shoes",
   opening="0.00s-4.20s: she is already in frame from the very first frame, standing on the paving with both hands down, and begins the move at once; no hand is near the camera at the start.",
   move="she shifts her weight onto one hip, turns her head to the lens and lets her long black hair swing across her shoulder",
   ending="4.20s-5.00s: she raises her right hand toward the camera; by 4.90s her palm fills the frame and covers the lens."),
 "D2": dict(body="人物参考2/D-西装-正面.jpg",
   outfit="a dark grey blazer over a white shirt with a matching pencil skirt and black heels",
   opening="0.00s-0.70s: her open palm and sleeve start right against the lens, then she pulls her hand away and lowers it, revealing her full body in the suit.",
   move="she rolls her shoulders back, lifts her chin and looks straight into the lens",
   ending="4.20s-5.00s: she simply holds the pose and looks into the lens; she does not raise her hand toward the camera at the end."),
}

def prompt(k):
    c=CFG[k]
    return f"""subject_definitions:
<Subject 1> is the environment shown in <Picture 1>: a tall red wooden lattice screen on the left with a blue-green landscape painting behind its slats, deep blue night sky opening on the right, soft out-of-focus red lanterns glowing in the background, and a narrow strip of grey stone paving along the bottom.
<Subject 2> is the young woman whose face comes from <Picture 3> and whose body and outfit come from <Picture 2>: long straight black hair, pale skin, dark eyes, and {c['outfit']}. She holds nothing in her hands.

summary:
[reference generation] A five-second vertical fashion clip in which <Subject 2> stands on the paving in front of <Subject 1>; the camera is locked off, her whole body stays inside the frame, and she is the only person on screen.

retention_analysis:
<Subject 1> (appears in [Shot 1]): fully_preserved - the red lattice, the painting, the night sky, the red lantern bokeh and the paving keep their positions, scale and colour.
<Subject 2> (appears in [Shot 1]): fully_preserved - her black hair, face and {c['outfit']} stay identical to the references.

detailed_description:
[Shot 1] 0.00s-5.00s. Locked-off vertical shot at chest height with a 35mm lens, the red lattice and lanterns behind her; her head near the top tenth of the frame, both shoes on the stone. No push-in, no pan, no zoom, no orbit, no handheld shake; she is the only person.
{c['opening']}
{c['move']}, slowly and on the beat.
{c['ending']}

overall_soundscape:
A quiet night walkway: a distant murmur, a faint breeze, the soft scuff of her shoes on stone.

non_diegetic_music:
Mid-tempo disco at about 118 BPM: four-on-the-floor kick, octave-jumping bass, offbeat hi-hats and short string stabs; instrumental, no vocals.
"""

for k in sys.argv[1:]:
    res=p.run_pipeline(
        image_path=f"{BASE}/人物参考/底板-去人.png",
        requirement=f"黑发少女变装短视频 {k}（改开头/结尾动作）",
        prompt_override=prompt(k),
        extra_images=[f"{BASE}/{CFG[k]['body']}", f"{BASE}/人物参考2/脸-正面.jpg"],
        width=768, height=1344, duration=5, seed=707070, steps=8, fps=24.0,
        topic=f"变装5-{k}", variant=k)
    print("SEG",k,res["video_local"],flush=True)
