Turn one topic into a finished Vox-style paper-collage explainer/ad video — automated end to end on Atlas Cloud + ffmpeg. An agent skill.
Python aiai-videoclaude-codeclaude-skillcollage-videodsh-pluginexplainer-videoffmpeggenerative-aillmmotion-graphicspythontext-to-videottsvideovideo-generationvox
croll: anchor one photo into the collage + voice cloning, gilded-deco preset, captions toggle (#4)
kiana-liang987be2f42332
diff --git a/SKILL.md b/SKILL.mdindex e4e7c29..0f2e2b0 100644--- a/SKILL.md+++ b/SKILL.md@@ -9,8 +9,11 @@ description: >a topic / product / person into a punchy narrated collage video — even if they don't saythe word "Vox". Also use when reproducing Stav Zilber / rom1trs / Higgsfield-style collagead workflows, or when the user asks for a motion collage or a scrapbook-style tribute.+ Three input modalities: a topic (B-roll), a talking-head video (A-roll mode), or a single+ photo of a person/product anchored into the collage (C-roll mode).Triggers: "vox video", "collage video", "motion collage", "paper collage- explainer", "make a collage ad", "turn this topic into a collage video".+ explainer", "make a collage ad", "turn this topic into a collage video", "turn my+ photo/this product shot into a collage video".---# Vox Director@@ -110,8 +113,11 @@ This is the default, most-automated path. Every stage is one script, all drivenOne consistent narrator via **xai/tts-v1** + instrumental BGM via **minimax/music-2.6**.**Pick `voice_id` to fit the topic + language** (don't just keep the default) — see`references/voices.md` for the full roster (5 multilingual + ~66 native voices by language,- with gender). Default `leo` (male, documentary). (Do NOT use seed-audio for plain narration- unless you pin a speaker — see gotchas.)+ with gender). Default `leo` (male, documentary). To narrate in a REAL person's own voice+ (the presenter of a C-roll photo, a brand voice), set `voice.clone_ref` to a local audio+ sample — narration switches to seed-audio voice cloning with a pinned-speaker,+ studio-clean template that keeps timing beat-stable (see gotchas: never hand seed-audio+ bare narration without that pin).6. **Assemble.** `python3 scripts/assemble.py out/<project>`ffmpeg: normalize + concat all shots, lay the single narration ducked under the music,@@ -173,6 +179,40 @@ scratch.audio the video model produced) so lip-sync is guaranteed regardless of which modelhandled that beat, normalizes every beat to one canvas, and concats into `final.mp4`.+## C-roll mode (one photo → collage)++The third input modality — "cutout roll". A-roll re-styles a talking-head VIDEO; B-roll+generates everything from a topic; **C-roll takes a single still PHOTO** (a selfie, an+avatar card, a product shot) and anchors it inside the collage world: the subject is cut+out as a PHOTOGRAPHIC sticker — never redrawn — and per-beat posters are generated around+it with an image-EDIT model, then animated through the normal clip stage. Use C-roll when+the user gives you one photo and a topic: a personal explainer fronted by their own face,+or a collage ad built around a real product shot (validated on both, 2026-07-17).++1. **Beat map.** Same as B-roll (`references/beat-layer.md`, same approval gate), plus the+ C-roll fields in beats.json: `"mode": "croll"`, `"anchor_photo"`, `"croll_subject"`+ (`portrait` | `product`), and `subject_wardrobe` (portrait — lock the outfit or the+ paper-doll body drifts) or `subject_desc` (product). Set `"title": false` on shots —+ C-roll posters carry no headline; text belongs to captions. If there is no separate+ script, transcribe/derive narration first and let the audio's ASR timestamps define the+ beats (audio-first, like A-roll — not text-first like B-roll).++2. **Anchored keyframes.** `python3 scripts/croll_keyframes.py <project_dir>`+ Uploads the photo once and generates one anchored poster per shot via+ `google/nano-banana-2/edit` (fallback `openai/gpt-image-2/edit`). Portraits get a+ photographic face + illustrated paper-doll body; products get a pixel-faithful sticker+ with label typography intact. Prompt rules that are baked in (all three cost a re-run to+ learn): poses/expressions go to the BODY only — asking for a wink redraws the face;+ halftone must be scoped to the background or it bleeds onto skin; portrait clothing must+ be locked explicitly. The script also writes `anchor_freeze` into beats.json.++3. **Animate + audio + assemble.** Standard `clips.py` → `audio.py` → `assemble.py`.+ `clips.py` injects the `anchor_freeze` guard into every motion prompt — without it the+ video stage can re-letter a product label (observed: "PARFUM" → "PAREUM") or re-time a+ face. For narration in the subject's own voice, set `voice.clone_ref` (see Voice + music+ above); derive stamp/snap-zoom timing from the narration's ASR word timestamps+ (`asr_beats.py` works on any audio, not just A-roll footage).+## beats.json schema```json@@ -190,10 +230,18 @@ scratch."motion_style": "punchy", // amplitude: calm | punchy | max (theme sets a default)"constraints": "strict", // strict = defect guards on | loose = let AI explore + re-roll"voice": {"voice_id": "leo", "language": "en", "speed": 1.0}, // pick per topic/language — see references/voices.md+ // + optional "clone_ref": "path/to/sample.mp3" (clone that voice via seed-audio)+ // and "persona": "YouTube tutorial creator" (delivery style for cloned VO)"music": "epic cinematic orchestral, instrumental, no vocals","mix": {"music": 0.6, "voice": 1.25}, // audio balance — optional; these are the defaults (BGM ducks under the VO)"caption_style": "white", // white (default: clean white subtitle) | paper (cream cut-out collage look)+ "captions": true, // false = no burned-in captions (deliver clean, subtitle in post)"watermark": "Made with Atlas Cloud",+ "mode": "croll", // C-roll only — plus the four fields below+ "anchor_photo": "path/to/photo.png", // C-roll: the still to anchor (person or product)+ "croll_subject": "portrait", // C-roll: portrait | product+ "subject_wardrobe": "a cream knitted sweater and charcoal trousers", // C-roll portrait: outfit lock+ "subject_desc": "the perfume bottle", // C-roll product: short noun phrase for the sticker"beats": [{"id": 1, "title_cn": "", "title_en": "BEFORE MONEY",diff --git a/references/models-and-gotchas.md b/references/models-and-gotchas.mdindex 60e2d24..926b018 100644--- a/references/models-and-gotchas.md+++ b/references/models-and-gotchas.md@@ -30,13 +30,18 @@ Feeding a recognizable **real celebrity + brand logos** into a video model:- The **local keyframe engine never hits this** (no video model in the loop) — the other waythrough for real-person content.-### Voice: why not seed-audio for plain narration+### Voice: seed-audio needs a pinned speaker (then it's beat-stable)`bytedance/seed-audio-1.0` is a general *audio-scene* model, not a plain TTS. Given barenarration with no pinned voice it adds pauses/SFX and produced wildly inconsistent lengths-(same 3 lines: 22s / 14s / 12s vs xai-tts's clean 8.6 / 10.2 / 9.0s). It *can* do clean VO if-you pin a `speaker` and strip em-dashes (the playbook used it for a Chinese male VO). Default-to `xai/tts-v1` for narration; reach for seed-audio for Chinese-specific voices, voice-cloning (`references`), or SFX like transition whooshes.+(same 3 lines: 22s / 14s / 12s vs xai-tts's clean 8.6 / 10.2 / 9.0s). **But pinned, it is+beat-alignable** — validated 2026-07-17 with the voice-clone template in `audio.py`+(pinned **Speaker A** @audio1 + "clean dry studio vocal only — no background music, no+sound effects, no room noise or reverb"): 62 words rendered in 19.3s, verbatim, one natural+0.5s pause. The earlier "rhythm doesn't match the beats" failures were the bare-narration+usage, not the model. Default to `xai/tts-v1` for narration; reach for seed-audio for+voice cloning (`voice.clone_ref` → `references` payload), Chinese-specific voices, or SFX+like transition whooshes — and always derive final timing from the ACTUAL audio (ASR word+timestamps), never from the script.## API gotchas (Atlas, behind a proxy)diff --git a/references/prompt-guide.md b/references/prompt-guide.mdindex 045227d..def7e2c 100644--- a/references/prompt-guide.md+++ b/references/prompt-guide.md@@ -213,6 +213,42 @@ with an edit model to anchor the face). The catch is *animation*: Google (Omni)---+## 4b. C-roll anchor locks (photo → poster, validated 2026-07-17)++C-roll's whole trick is one photographic sticker that never gets redrawn while the paper+world is generated around it. Three lock templates, each earned by a failed generation+(`croll_keyframes.py` bakes them in — reproduced here for hand-run prompts):++**FACE LOCK (portrait).** "Her/his face and hair from the attached photo are cut out as a+PHOTOGRAPHIC sticker with a torn white paper border — keep the facial identity, features and+the exact expression from the photo pixel-faithful; do not redraw, repaint or stylize the+face; NO halftone dots, print texture or ink treatment on the face or hair. All poses and+gestures are expressed by the body only. From the neck down the body is a hand-drawn+paper-doll illustration jointed like a vintage paper puppet, FULLY CLOTHED in {outfit}."+- *Poses go to the body only*: asking the model for a wink or a smile redraws the face.+- *Scope halftone to the background* or the print dots bleed onto skin.+- *Lock the clothing* or the paper-doll body drifts (one run produced a bare mannequin).++**PRODUCT LOCK.** "{The product} from the attached photo is cut out as a PHOTOGRAPHIC+sticker with a clean scissor-cut edge and a soft real paper drop shadow — keep its exact+shape, materials, surface reflections and every word of its label typography pixel-faithful.+Do not redraw, restyle or repaint the subject or its label. Re-style ONLY the world around+it as printed paper collage."++**ANCHOR FREEZE (the video stage).** Image-edit keeps label typography intact, but the+image-to-video stage can quietly re-letter it (observed: "PARFUM" → "PAREUM") or re-time a+face. Every C-roll motion prompt therefore carries a freeze line — "the photographic+sticker (and every letter of its label) is a frozen layer, pixel-identical to the still for+the entire duration" — written into beats.json as `anchor_freeze` and injected by+`clips.py`. Extract a frame per clip and re-check the letters anyway.++Note the permission split (same spirit as A-roll's face rule): edit models will *carry* a+real face/product verbatim but Omni refuses to *repaint* one — a halftone-textured face was+rejected at the video stage regardless of phrasing, and Kling accepts it but drifts the+identity. Photographic-sticker treatment is the reliable lane.++---+## 5. Theme presets — combine the dimensionsA **theme preset** = one pick from each image dimension (§1) + a motion preset (§2), on top of@@ -230,6 +266,7 @@ hand-writing each prompt. The library (`styles.THEME_PRESETS`):| `chinese-ink` | Chinese woodblock/ink | ink + vermilion | Chinese brush + red seal | rice-paper, seal | calm/punchy | Chinese history/culture || `atomic-age` | 1950s futurism | teal/orange/cream | atomic script | halftone | punchy | science, space, future || `newsprint-editorial` | mid-century front-page news feature | cream/deep red/mustard/charcoal | bold condensed newsprint headline | aged paper, heavy halftone | punchy | news, AI/tech explainers, editorial features |+| `gilded-deco` | 1920s art-deco luxury advertisement | aged cream/champagne gold/charcoal | elegant didone serif, wide tracking | gold foil, fine halftone | calm | luxury goods, perfume, watches, heritage brands |**How to use:** the agent reads the topic → suggests 3–4 fitting presets (or composes a new oneby mixing the banks in §1–§2) → `style_bakeoff.py` renders one beat in each → the user picks. Thediff --git a/references/voices.md b/references/voices.mdindex 4dbc757..f99c709 100644--- a/references/voices.md+++ b/references/voices.md@@ -49,3 +49,11 @@ to the topic** — don't just leave the default.Example: `"voice": {"voice_id": "grace", "language": "en", "speed": 1.0}` → wait, use the id:`"voice": {"voice_id": "f8cf5c2c78d4", "language": "en", "speed": 1.0}` (Grace, native English female).++## Voice cloning (seed-audio)++To narrate in a real person's own voice, set `"voice": {"clone_ref": "path/to/sample.mp3",+"language": "en", "persona": "YouTube tutorial creator"}` — narration switches from xai/tts-v1+to `bytedance/seed-audio-1.0` with the sample pinned as @audio1 (template in `audio.py`;+timing validated beat-stable). A clean 20–60s solo-voice sample works best. `persona` tunes+delivery (e.g. "calm documentary narrator", "luxury brand voice-over").diff --git a/scripts/assemble.py b/scripts/assemble.pyindex 60f3ca0..3d2e0c7 100644--- a/scripts/assemble.py+++ b/scripts/assemble.py@@ -103,38 +103,41 @@ def run(project_dir):ff(["-f", "concat", "-safe", "0", "-i", listf, "-c", "copy", body])# ---- 3) captions (per beat) + watermark PNGs ----+ captions_on = bool(doc.get("captions", True)) # "captions": false -> no burned-in captionscap_pngs = []- for bs in beat_spans:- beat = bs["beat"]- p = os.path.join(tmp, f"cap_{beat['id']}.png")- acc = None- if cap_style == "paper": # only the paper style uses a per-beat keyline- kf = next((s["keyframe_path"] for s in (beat.get("shots") or [beat])- if s.get("keyframe_path") and os.path.exists(s["keyframe_path"])), None)- acc = text_overlay.accent_color(kf) if kf else None- text_overlay.render_caption(beat["narration"], p, W, H, accent=acc, style=cap_style)- cap_pngs.append(p)+ if captions_on:+ for bs in beat_spans:+ beat = bs["beat"]+ p = os.path.join(tmp, f"cap_{beat['id']}.png")+ acc = None+ if cap_style == "paper": # only the paper style uses a per-beat keyline+ kf = next((s["keyframe_path"] for s in (beat.get("shots") or [beat])+ if s.get("keyframe_path") and os.path.exists(s["keyframe_path"])), None)+ acc = text_overlay.accent_color(kf) if kf else None+ text_overlay.render_caption(beat["narration"], p, W, H, accent=acc, style=cap_style)+ cap_pngs.append(p)wm_png = text_overlay.render_watermark(wm_text, os.path.join(tmp, "wm.png"), W, H)# ---- 4) one pass: overlay captions+wm, mix per-beat narration, duck BGM ----nb = len(beat_spans)+ ncap = len(cap_pngs) # 0 when captions are offinputs = ["-i", body] # 0for p in cap_pngs:- inputs += ["-i", p] # 1..nb- inputs += ["-i", wm_png] # nb+1- narr_base = nb + 2+ inputs += ["-i", p] # 1..ncap+ inputs += ["-i", wm_png] # ncap+1+ narr_base = ncap + 2for bs in beat_spans:inputs += ["-i", bs["beat"]["narration_audio"]] # narr inputsbgm_idx = narr_base + nbinputs += ["-i", doc["bgm_path"]]chain, prev = [], "[0:v]"- for i, bs in enumerate(beat_spans):+ for i, bs in enumerate(beat_spans[:ncap]):s, e = bs["start"] + 0.2, bs["start"] + bs["dur"] - 0.1lbl = f"[v{i+1}]"chain.append(f"{prev}[{i+1}:v]overlay=0:0:enable='between(t,{s:.2f},{e:.2f})'{lbl}")prev = lbl- chain.append(f"{prev}[{nb+1}:v]overlay=0:0[v]")+ chain.append(f"{prev}[{ncap+1}:v]overlay=0:0[v]")# per-beat narration delayed to its start, then mixednlabels = []diff --git a/scripts/audio.py b/scripts/audio.pyindex c6f35d2..679d35e 100644--- a/scripts/audio.py+++ b/scripts/audio.py@@ -4,11 +4,19 @@ Audio stage: per-beat narration (one consistent voice) + one instrumental BGM.Narration uses xai/tts-v1 (a real multilingual TTS: named `voice_id` + language),so every beat is spoken in the same voice — this sidesteps Omni's clip-to-clip-voice drift. Seed-Audio was tried and dropped: as a general *sound* model it gave-wildly inconsistent narration lengths unless a speaker is pinned (see VOICE_MODEL).+voice drift.++VOICE CLONING: set `voice.clone_ref` to a local audio sample and narration+switches to bytedance/seed-audio-1.0 with the sample as @audio1. Seed-Audio is a+general *sound* model — bare narration gives it wildly inconsistent lengths —+but with a pinned speaker AND the studio-clean directive baked into+CLONE_TEMPLATE below, timing is stable (validated 2026-07-17: 62 words in+19.3s, verbatim, one natural 0.5s pause). Per-beat generation keeps beat+alignment robust either way.Usage: python3 audio.py <project_dir> (default: out/tang-30s)"""+import base64import jsonimport osimport subprocess@@ -17,11 +25,25 @@ import sysfrom provider import get_provider, run_jobs# xai/tts-v1 is a clean, predictable multilingual TTS (named voices + language-# select). Seed-Audio is a general *sound* model that injects pauses/SFX and-# gave wildly inconsistent narration lengths, so we use a real TTS here.+# select) — the default. Seed-Audio handles voice cloning (see CLONE_TEMPLATE)+# and SFX; never hand it bare narration without a pinned speaker.VOICE_MODEL = "xai/tts-v1"+CLONE_MODEL = "bytedance/seed-audio-1.0"MUSIC_MODEL = "minimax/music-2.6"+# Every clause is load-bearing: the speaker pin + "clean dry studio vocal only"+# block is what makes seed-audio's timing beat-alignable (without it the model+# invents pauses and SFX). `persona` tunes delivery (documentary narrator,+# luxury voice-over, ...); default suits explainers.+CLONE_TEMPLATE = (+ "**Speaker A** @audio1 keeps their own vocal timbre and speaks fluent natural "+ "{language} with a neutral accent, upbeat pace, crisp articulation, friendly and "+ "energetic like a {persona}. Clean dry studio vocal only — no background music, "+ "no sound effects, no room noise or reverb. They say: \"{script}\""+)+LANG_NAMES = {"en": "English", "zh": "Mandarin Chinese", "ja": "Japanese",+ "ko": "Korean", "es": "Spanish", "fr": "French", "de": "German"}+def probe_dur(path: str) -> float:out = subprocess.run(["ffprobe", "-v", "error", "-show_entries", "format=duration",@@ -45,11 +67,25 @@ def run(project_dir: str):language = voice.get("language", doc.get("language", "en"))speed = float(voice.get("speed", 1.0))+ clone_ref = voice.get("clone_ref") # local audio sample -> clone this voice+ persona = voice.get("persona", "YouTube tutorial creator")+ if clone_ref:+ with open(clone_ref, "rb") as f:+ ref_b64 = base64.b64encode(f.read()).decode()+ lang_name = LANG_NAMES.get(language, language)+specs = {}for beat in doc["beats"]:- specs[f"narr_{beat['id']}"] = (lambda t=beat["narration"]: prov.submit_audio(- VOICE_MODEL, text=t, language=language, voice_id=voice_id,- codec="mp3", sample_rate=44100, speed=speed))+ if clone_ref:+ specs[f"narr_{beat['id']}"] = (lambda t=beat["narration"]: prov.submit_audio(+ CLONE_MODEL,+ text=CLONE_TEMPLATE.format(language=lang_name, persona=persona, script=t),+ format="mp3", sample_rate=44100,+ references=[{"audio_data": ref_b64}]))+ else:+ specs[f"narr_{beat['id']}"] = (lambda t=beat["narration"]: prov.submit_audio(+ VOICE_MODEL, text=t, language=language, voice_id=voice_id,+ codec="mp3", sample_rate=44100, speed=speed))# BGM: only generate if we don't already have one (it's slow + costs more).bgm_path = os.path.join(adir, "bgm.mp3")diff --git a/scripts/clips.py b/scripts/clips.pyindex 8042f36..9395e99 100644--- a/scripts/clips.py+++ b/scripts/clips.py@@ -56,10 +56,13 @@ DEFAULT_ELEMENT = ("several cut-out elements move naturally with the scene — tdef collage_prompt(camera, element_motion=None, feel=None, palette=None, amplitude="punchy",- has_title=True, constraints="strict"):+ has_title=True, constraints="strict", anchor_freeze=None):"""Collage motion prompt. `constraints`: 'strict' = defect guards on (flat-2D, one-way,no-morph) for text-heavy explainers; 'loose' = let the model explore (3D/bold moves), keep- only the essentials. Text is hard-protected ONLY when the shot has a headline (has_title)."""+ only the essentials. Text is hard-protected ONLY when the shot has a headline (has_title).+ `anchor_freeze`: C-roll only — a FREEZE sentence protecting the photographic anchor+ sticker (face or product+label); croll_keyframes.py writes it into beats.json. Without it+ the video stage may re-letter a label or re-time a face (both observed in validation)."""cam = CAMERA_VOCAB.get(camera, camera)element = element_motion or DEFAULT_ELEMENTfeel = feel or "tactile, editorial, a page from a scrapbook"@@ -67,6 +70,8 @@ def collage_prompt(camera, element_motion=None, feel=None, palette=None, amplituamp = AMPLITUDE.get(amplitude, AMPLITUDE["punchy"])text_lock = ("Keep the HEADLINE TEXT sharp, legible and stable — do not warp or wobble the ""lettering. " if has_title else "")+ if anchor_freeze:+ text_lock = f"{anchor_freeze} " + text_lockif constraints == "loose":guard = (text_lock + "Keep the paper-collage look (printed cut-outs, not photoreal); ""avoid a subject melting into shapeless goo. Otherwise explore freely.")@@ -146,6 +151,7 @@ def run(project_dir, only=None):if style == "collage":prompt = collage_prompt(camera, element_motion=element, feel=beat.get("feel"),palette=beat.get("bg"), amplitude=motion_style,+ anchor_freeze=doc.get("anchor_freeze"),has_title=shot.get("title", True), constraints=constraints)else:prompt = painterly_prompt(shot.get("motion", camera))diff --git a/scripts/croll_keyframes.py b/scripts/croll_keyframes.pynew file mode 100644index 0000000..fab4307--- /dev/null+++ b/scripts/croll_keyframes.py@@ -0,0 +1,150 @@+#!/usr/bin/env python3+"""+C-roll keyframe stage: anchor ONE still photo (a person or a product shot)+inside generated collage posters — "cutout roll".++Where A-roll re-styles a talking-head VIDEO (performance preserved) and B-roll+generates posters from TEXT alone, C-roll takes a single PHOTO: the subject is+cut out as a PHOTOGRAPHIC sticker (never redrawn) and the collage world is+generated around it per beat, via an image-EDIT model. The posters then animate+through the normal clips.py stage — this script also writes an `anchor_freeze`+guard into beats.json so the motion prompts keep the subject frozen.++Validated 2026-07-17 on two real productions (a product bottle; a portrait →+paper-doll explainer). Three hard-won prompt rules are baked in below:+ 1. Poses/expressions must be expressed by the BODY only — asking the model+ to change the face (a wink, a smile) makes it redraw the face.+ 2. Halftone/print texture bleeds onto the face unless you explicitly scope+ it to the background.+ 3. For portraits, clothing must be locked too, or the paper-doll body drifts.+And one from the product run: label typography survives the edit but can be+re-lettered by the VIDEO stage — hence the LABEL/FACE FREEZE line that this+script hands to clips.py.++beats.json additions (see SKILL.md "C-roll mode"):+ "mode": "croll",+ "anchor_photo": "path/to/photo.png", # local path or URL+ "croll_subject": "portrait" | "product",+ "subject_wardrobe": "her cream knitted sweater and charcoal trousers", # portrait only+ "subject_desc": "the perfume bottle", # product only (short noun phrase)++Usage: python3 croll_keyframes.py <project_dir>+"""+import json+import os+import sys++from provider import get_provider, run_jobs+from styles import compose_collage_prompt, resolve_theme, image_params++EDIT_MODEL = "google/nano-banana-2/edit" # fallback: openai/gpt-image-2/edit++FACE_LOCK = (+ "The person's face and hair from the attached photo are cut out as a PHOTOGRAPHIC "+ "sticker with a torn white paper border — keep the facial identity, features and the "+ "exact expression from the photo pixel-faithful; do not redraw, repaint or stylize the "+ "face; NO halftone dots, print texture or ink treatment on the face or hair — the face "+ "stays a clean photographic print. All poses and gestures are expressed by the body "+ "only. From the neck down the body is a hand-drawn paper-doll illustration jointed "+ "like a vintage paper puppet with visible cut edges, FULLY CLOTHED in {wardrobe}. "+)++PRODUCT_LOCK = (+ "{subject} from the attached photo is cut out as a PHOTOGRAPHIC sticker with a clean "+ "scissor-cut edge and a soft real paper drop shadow — keep its exact shape, materials, "+ "surface reflections and every word of its label typography pixel-faithful. Do not "+ "redraw, restyle or repaint the subject or its label. Re-style ONLY the world around "+ "it as printed paper collage. "+)++# Appended to every C-roll poster prompt. Rules 2+3 from the validated runs.+CROLL_GUARDS = (+ " Halftone dots and print textures live on the BACKGROUND only. Newspaper scraps carry "+ "completely UNREADABLE blurred micro-text. No readable text anywhere in the image."+)++# Written into beats.json for clips.py to inject into every motion prompt.+FREEZE = {+ "portrait": ("FREEZE the photographic face sticker — it is a frozen layer, "+ "pixel-identical to the still for the entire duration; never redraw, warp "+ "or animate the face; the paper-doll body may shift slightly at its joints."),+ "product": ("FREEZE the photographic subject sticker and its label — a frozen layer, "+ "pixel-identical to the still for the entire duration; every letter of the "+ "label stays exactly as in the still; it may only settle gently with its "+ "drop shadow."),+}+++def build_lock(doc):+ kind = doc.get("croll_subject", "portrait")+ if kind == "product":+ return PRODUCT_LOCK.format(subject=doc.get("subject_desc", "The product")), kind+ wardrobe = doc.get("subject_wardrobe", "the same outfit as in the photo")+ return FACE_LOCK.format(wardrobe=wardrobe), kind+++def shots_of(beat):+ if beat.get("shots"):+ for s in beat["shots"]:+ yield s, f"{beat['id']}{s.get('id','')}"+ else:+ yield beat, f"{beat['id']}"+++def run(project_dir):+ bpath = os.path.join(project_dir, "beats.json")+ with open(bpath) as f:+ doc = json.load(f)+ photo = doc["anchor_photo"]+ aspect = doc.get("aspect", "9:16")+ img_model = doc.get("image_model", EDIT_MODEL)+ img_res = doc.get("image_resolution", "2k")+ theme = resolve_theme(doc.get("theme")) or {}+ collage_style = theme.get("idiom") or doc.get("collage_style", "newsprint-editorial")+ lock, kind = build_lock(doc)+ kf_dir = os.path.join(project_dir, "keyframes")+ os.makedirs(kf_dir, exist_ok=True)++ prov = get_provider(doc.get("provider"))+ photo_url = photo if photo.startswith("http") else prov.upload(photo)+ doc["anchor_photo_url"] = photo_url+ doc["anchor_freeze"] = FREEZE[kind]++ specs, by_key = {}, {}+ for beat in doc["beats"]:+ for shot, key in shots_of(beat):+ if shot.get("keyframe_url"):+ continue+ world = compose_collage_prompt(shot["scene"], "", "",+ beat.get("bg", "flat cream paper"), aspect,+ with_title=False, style=collage_style,+ palette=theme.get("palette") or doc.get("palette"),+ type_style=theme.get("type_style") or doc.get("type_style"),+ finish=theme.get("finish") or doc.get("finish"))+ prompt = lock + world + CROLL_GUARDS+ shot["keyframe_prompt"] = prompt+ specs[key] = (lambda p=prompt: prov.submit_image(+ img_model, p, images=[photo_url], **image_params(img_model, aspect, img_res)))+ by_key[key] = shot++ done = run_jobs(prov, specs, poll_s=3, stall_s=90, max_retries=2, deadline_s=420)++ for key, url in done.items():+ if not url:+ continue+ dest = os.path.join(kf_dir, f"kf_{key}.jpg")+ prov.download(url, dest)+ shot = by_key[key]+ shot["keyframe_url"] = url+ shot["keyframe_path"] = dest+ print(f"[{key}] saved {dest}")++ with open(bpath, "w") as f:+ json.dump(doc, f, ensure_ascii=False, indent=2)+ print("updated", bpath)+++if __name__ == "__main__":+ if len(sys.argv) < 2:+ sys.exit("usage: python3 croll_keyframes.py <project_dir>")+ run(os.path.abspath(sys.argv[1]))diff --git a/scripts/styles.py b/scripts/styles.pyindex ebbd7ed..b9ed0f0 100644--- a/scripts/styles.py+++ b/scripts/styles.py@@ -102,6 +102,13 @@ STYLE_LIBRARY = {"misregistration, tactile cinematic editorial energy — reads like a newspaper feature ""spread brought to life, not an ad."),+ "gilded-deco": (+ "Vintage luxury editorial paper collage, 1920s art-deco advertisement mood: aged "+ "cream paper with visible grain, champagne-gold foil paper accents, thin art-deco "+ "geometric line frames and gilded arches, torn French newspaper clippings, halftone "+ "print dots, slight print misregistration. Hushed, opulent, museum-vitrine calm — "+ "reads like a perfume-house press page, not a pop ad."+ ),}DEFAULT_STYLE = "american-retro"@@ -136,6 +143,9 @@ THEME_PRESETS = {"newsprint-editorial": {"idiom": "newsprint-editorial", "palette": "cream white, deep red, mustard yellow, charcoal black","type_style": "bold condensed newsprint headlines, all-caps", "finish": "aged paper, heavy halftone dots, high contrast, slight print misregistration","mood": "energetic, tactile, cinematic editorial", "motion_style": "punchy"},+ "gilded-deco": {"idiom": "gilded-deco", "palette": "aged cream, champagne gold, charcoal black, muted deep gold",+ "type_style": "elegant high-contrast didone serif, wide letter-spacing", "finish": "gold foil, aged paper grain, fine halftone, slight misregistration",+ "mood": "luxurious, calm, vintage editorial", "motion_style": "calm"},}