The CLI kit behind the poppi spec.
Prompting in a browser gets you an ad. A brief-driven pipeline gets you repeatable batches, real cost logs, and exact end cards every time.
Swap brief.json, one real pack shot, and one creator portrait, and the same private five-stage kit runs on another product (the only poppi-specific line in the code is one Whisper spelling map: poppy → poppi).
end_card.py · 2.75 s · 0 video creditsFive stages, one batch folder
Prerequisites stay small: the signed-in higgsfield CLI, ffmpeg, local whisper-cli (ggml-small.en.bin), and Python with Pillow. Every command runs from the project root against a batch folder holding brief.json and inputs/.
- Step 1: Stage 1 · brief.json Define the batch Audience beliefs, 3 ads, 16-term banned list, and 3 package hex colors.
- Step 2: Stage 2 · roll.py Submit & log Quotes credits, runs 1080p takes in parallel, snapshots per-take scripts, writes runlog.csv.
- Step 3: Automated gate: Stage 3 · qc_check.py Machine gate Whisper transcript check (≤8% WER), literal banned-word scan, 9:16 + 15s ±1s + audio.
- Step 4: Stage 4 · frames/ Human pick Scans 30-frame contact sheets (2 fps) for brand spelling, hands, realism, and background text.
- Step 5: Stage 5 · finish.py Export 9:16 + 4:5 Script-spelled captions, -15 LUFS spoken leveling, code-animated end card.
What runs what
Four scripts and their exact boundaries
Knowing what the machine checks, and what still requires human eyes, is what keeps the pipeline dependable. Machine QC verifies word error rate, literal banned tokens, aspect ratio, duration, and audio presence. It does not judge visual spelling, hands, implied claims, or resolution. A human owns the contact-sheet selection and final compliance pass.
| File | Job | Key engineering detail |
|---|---|---|
roll.py | Submits takes, downloads, triggers QC, logs quotes | Extracts spoken dialogue strictly from double quotes and snapshots takes/<take>.script.txt per take so later prompt edits never corrupt an older take’s captions. Logs failures and quoted credits, leaving human_verdict blank for manual entry. |
qc_check.py | Fast pass/fail check before a person watches | Runs local Whisper plus edit distance (≤8% WER; D’s extra “I” passed at 3%), case- and phrase-aware banned-word scan, and ffprobe checks (9:16, 15s ±1s, audio track). Includes a single poppy → poppi Whisper normalizer. |
finish.py | Captions, loudness, end card, 9:16 + 4:5 masters | Takes timing from Whisper and spelling from the frozen script, printing a CHECK: line whenever speech drifts. Targets -15 LUFS on the spoken segment after the limiter (finished web files measured -15.37 to -15.90 LUFS overall). |
end_card.py | 2.75 s animated end card | Spring-physics pack entrance, Fraunces word-by-word headline, and pulsing button driven purely by hex colors and copy in brief.json. Zero video-generation credits for the visuals (optional generated can-open SFX cost 1.5 credits once; pass --no-sfx for silent cards). |
# Run from the project root containing kit/ and batch-2-orange-cream/
# 1. Upload the real pack shot & creator portrait once per batch
higgsfield upload create batch-2-orange-cream/inputs/can.png
higgsfield marketing-studio products create --title "poppi Orange Cream" --image "$CAN_UPLOAD_ID"
higgsfield upload create batch-2-orange-cream/inputs/portrait.png
higgsfield marketing-studio avatars create --name "Orange Cream Presenter" --image "$PORTRAIT_UPLOAD_ID"
# Drop the returned product_id and avatar_id into batch-2-orange-cream/brief.json
# 2. Roll one take per ad (or re-roll a single ad by ID after a QC miss)
python3 kit/roll.py batch-2-orange-cream
python3 kit/roll.py batch-2-orange-cream F
# 3. Finish a picked take -> captions, -15 LUFS spoken audio, animated end card, 9:16 + 4:5
python3 kit/finish.py batch-2-orange-cream E batch-2-orange-cream/takes/E-take1.mp4 Real artifacts
One brief in, one honest log out
Everything that changes between brands sits in brief.json. Notice the one strict syntax rule: only spoken words sit inside double quotation marks. That lets roll.py derive the exact expected script without maintaining a duplicate text file.
{
"brand": "poppi",
"flavor": "Orange Cream",
"product_id": "REPLACE_WITH_HIGGSFIELD_PRODUCT_ID",
"product_photo": "inputs/can.png",
"avatar_id": "REPLACE_WITH_HIGGSFIELD_AVATAR_ID",
"avatar_portrait": "inputs/portrait.png",
"audience": {
"who": "A man of 35 to 45 who grew up on orange soda, gave soda up in his thirties, and sees the pastel can in the fridge as his wife's drink.",
"believes_now": "That is a wellness drink. It is not a real soda and it is not for me.",
"must_believe": "It tastes like the orange cream soda I grew up on, and it has 5g of sugar.",
"proof": "A first sip and an honest reaction on camera, and the 5g Sugar badge printed on the can."
},
"banned_words": [
"gut", "digest", "digestion", "digestive", "fiber", "healthy", "health",
"bloat", "bloating", "weight", "detox", "immune", "immunity", "cure",
"probiotic", "doctor"
],
"end_card": {
"headline": "Soda's back.",
"sub": "Orange Cream · 5g sugar",
"button": "find your flavor",
"bg": "#EE8238",
"accent": "#FFE7CF",
"ink": "#A8390A"
},
"highlight": ["five grams of sugar", "Orange cream"],
"ads": [
{
"id": "E",
"name": "i-owe-her-an-apology",
"awareness": "Product aware",
"setting": "Kitchen",
"prompt": "UGC selfie video, vertical, front phone camera propped on the kitchen counter. The man (the avatar) leans on the counter in his home kitchen, soft daylight from the window, holding a cold orange can of poppi Orange Cream, label facing camera. Dry, a little sheepish, like he is admitting something. Exact dialogue: \"My wife keeps buying these and I never touched one. I figured it was a wellness thing. We ran out of everything else.\" He looks at the can, then back at the camera: \"I owe her an apology. Orange cream. Five grams of sugar. It's just good soda.\" Natural skin texture, quiet kitchen ambience, no music, no on-screen text."
},
{
"id": "F",
"name": "went-in-for-milk",
"awareness": "Most aware",
"setting": "Street",
"prompt": "UGC selfie video, vertical, front phone camera held at arm's length. The man (the avatar) walks along a quiet tree-lined residential sidewalk in late-afternoon sun, holding a cold orange can of poppi Orange Cream, label facing camera. Amused at himself, deadpan. Exact dialogue: \"I went in for milk. I came out with this.\" He lifts the can into frame: \"Orange cream. Five grams of sugar. Tastes like the one I grew up on.\" He shrugs: \"And no, I did not get the milk.\" Handheld walking shake, natural skin texture, street ambience, no music, no on-screen text."
}
]
} Edited Batch 2 log excerpt (runlog.csv)
Every roll appends a row immediately, including winners, rejects, and errors, using Higgsfield’s live credit quote. Job UUIDs and empty machine-note columns are trimmed below for readability. See the formatted table and close-up QC frames on the poppi breakdown page.
# Edited excerpt from batch-2-orange-cream/runlog.csv (job IDs and empty check_notes omitted; human verdicts condensed)
when,take,resolution,machine_checks,render_seconds,credits_each,human_verdict
2026-11-19 15:46,D-take1,1080p,PASS,449,195,"PICK. Real-looking can, natural sip, flavor name and 5g badge readable (brand mostly faces away)."
2026-11-19 15:46,E-take1,1080p,PASS,505,195,"PICK. Label correct in every frame, brand readable at end. One fixed camera angle."
2026-11-19 15:46,F-take1,1080p,PASS,381,195,"FAIL. Flavor name garbled; unreadable shop signs behind him."
2026-11-19 15:51,F-take2,1080p,PASS,303,195,"PICK. One change: residential sidewalk instead of storefront. Label clean, no background text."