# Pipeline — product hypermotion + specs The source format has **no runnable driver**: the pipeline is prose + referenced atoms + inline PIL/ffmpeg. This doc is the step-by-step recipe, naming the atom/tool each step uses. Config lives in `config.example.json`. The demo's reference implementations (`gen_kinetic_v6.py`, `gen_endcard_v10.py`, `assemble_v10.py`) are not vendored here — rebuild them from this doc. Two PAID calls total (Seedance i2v + ElevenLabs Music). Everything else is free PIL/ffmpeg. Guard **both** paid calls with skip-if-exists so a re-run never re-bills. > **Worked example, not the format.** Glowmule values throughout (adventure energy, > mountain campsite ledge, blue-hour amber rim, 124 BPM outdoor anthem, the spec strings, > amber accent) are the demo's build. Energy, environment, lighting and music come from the > recipe's `choices` (`energy`, `environment`, `lighting`, `music`); spec callouts, logo, > colours and CTA come from the brand kit. Keys: none to set. GooseWorks holds every key; the two paid calls go through the media proxy (the `create-video-seedance-2-fal` and `create-music-elevenlabs` atoms). --- ## Phase 0 — Brand asset gathering (autonomous, free) 1. **Hero product PNG.** Scrape the highest-res PDP shot (Shopify: `curl -sL "${product_url}.json" | jq -r '.product.images[0].src'`). Real photo, NOT AI-gen. This is the Seedance start frame. → `assets/product/`. 2. **Brand logo PNG.** Most brand SVGs wrap a base64 PNG — decode it out: ```python import re, base64 svg = open('logo.svg').read() m = re.search(r'data:image?/png;base64,([A-Za-z0-9+/=]+)', svg) open('logo.png', 'wb').write(base64.b64decode(m.group(1))) ``` Pure-vector SVG (rare) → `rsvg-convert -w 2400 logo.svg -o logo.png`. Validated on the demo → a clean, wide real wordmark. → `assets/logo/`. 3. **Palette.** Count `#xxxxxx` in the homepage CSS; map the dominant accent → `accent_color_hex`. 4. **Font.** Download the **static** Space Grotesk Bold (variable TTF renders as Regular in PIL): `curl -sSL -o assets/fonts/SpaceGrotesk-Bold.ttf https://raw.githubusercontent.com/floriankarsten/space-grotesk/master/fonts/ttf/static/SpaceGrotesk-Bold.ttf` 5. Write `config.json` + `brief.md`. **GATE 1** — show the brief + 5-block Seedance prompt + spec callouts (GooseWorks shows the price on the card). --- ## Phase 1 — Hypermotion + music, in parallel [PAID — GATE] Fire both concurrently; each behind a skip-if-exists guard. ### 1a. Seedance i2v hypermotion — atom `create-video-seedance-2-fal` (paid, one 15s call) The prompt MUST carry all **5 blocks** in order (see `config.hypermotion_i2v.prompt_blocks`). The 5th block (ABSOLUTE CONSTRAINTS) is what stops geometry drift — an early demo take run without it morphed the product into a different object mid-clip. Rules for block 4: ONE camera move per beat (Seedance fails on stacked moves), 3–5 beats, first beat high-energy, last beat a settle. ```python import fal_client, os # paid call: the atom routes it through the media proxy prompt = "\n\n".join(cfg["hypermotion_i2v"]["prompt_blocks"].values()) image_url = fal_client.upload_file(cfg["product_image"]) if not os.path.exists("working/hypermotion-raw.mp4"): # skip-if-exists r = fal_client.subscribe("fal-ai/bytedance/seedance/v2/pro/image-to-video", arguments={"prompt": prompt, "image_url": image_url, "duration": "15", "resolution": "1080p", "aspect_ratio": "1:1", "generate_audio": False}) # download r["video"]["url"] -> working/hypermotion-raw.mp4 ``` ### 1b. ElevenLabs Music — atom `create-music-elevenlabs` (paid) `fal-ai/elevenlabs/music`, generate at target length, `output_format: mp3_44100_192`. Bake the sync points into the prompt (kick at 1s for the first cut, build 10–20s, peak + lyric hook at 20s for the CTA, lyric land at ~22s for the end-card inversion flash). Music with a single rallying lyric is a feature here — no VO competes. --- ## Phase 2 — Kinetic-typography cards (autonomous, free) Render each card 1080×1920 via PIL **frame-by-frame** → PNG sequence (`working/kinetic-frames/