Storyboard Generation
This guide covers creating storyboards from adapted scripts — generating visual frames using diffusion models.
Overview
A Storyboard links a VideoAdUnit to a DiffusionModel (and optional LoRA) to generate one or more images per script row. The process:
Extract visual elements from each script row’s
visual_textOptionally enhance prompts with an LLM
Create
DiffusionJobrecords for each frameQueue jobs for image generation
graph LR
Script["Script Rows"] --> Generator["StoryboardGenerator"]
Generator --> Prompts["Image Prompts"]
Prompts --> Jobs["DiffusionJobs"]
Jobs --> Images["Storyboard Frames<br/>(1280×720)"]
Creating a Storyboard
Navigate to TV Spots > Storyboards > Add Storyboard
Select the Video Ad Unit (must have script rows)
Choose a Diffusion Model for image generation
Optionally select a LoRA Model for style control
Set Images Per Row (default: 1) — generates multiple variations per shot
Save — the
generate_storyboard_taskis automatically queued
Multiple storyboards can be created for the same ad unit with different model and LoRA configurations, allowing visual comparison across styles.
Prompt Generation
The StoryboardGenerator converts script row visual descriptions into diffusion model prompts.
Visual Element Extraction
The generator processes each row’s visual_text:
Remove timing references — strips timecodes like
00:00:05:00and duration markers like(5.0s)Normalize shot types — standardizes shot type prefixes (CU, MCU, MS, WS, ECU, etc.)
Add visual style prefix — prepends the ad unit’s
visual_style_promptfor consistencyAdd quality keywords — appends
cinematic still, professional photography, high quality, detailed
Example transformation:
# Input (visual_text):
Medium shot: Kitchen counter. TALENT opens refrigerator, pulls out
ACME ENERGY DRINK can. Product hero shot with condensation.
# Output (base prompt):
warm cinematic lighting, MS: Kitchen counter. TALENT opens refrigerator,
pulls out ACME ENERGY DRINK can. Product hero shot with condensation.,
cinematic still, professional photography, high quality, detailed
LLM Enhancement
When enhance_prompts=True (the default), the generator uses the HFPromptEnhancer (Qwen2.5-3B-Instruct) to rewrite prompts with richer visual detail:
Style-specific descriptors are added
Scene composition is refined for diffusion model compatibility
A negative prompt is generated to avoid common artifacts
If LLM enhancement fails, the generator falls back to the base prompt.
DiffusionJob Creation
After prompts are generated, create_storyboard_jobs() creates the database records:
For each script row (times images_per_row):
A Prompt record with the enhanced prompt and negative prompt
A DiffusionJob linked to the selected diffusion model and LoRA
A StoryboardImage linking the storyboard, script row, and diffusion job
Job identifiers follow the pattern: {job_id}_{ad_unit_code}_row-{NN}_img-{NN}
All storyboard frames use 1280×720 dimensions (16:9 aspect ratio).
Task Flow
The generate_storyboard_task executes these steps:
Evict pipeline model — clears the adaptation pipeline’s LLM from VRAM
Generate prompts — runs
StoryboardGeneratorfor all script rowsClear GPU cache — frees VRAM after prompt enhancement
Create jobs — creates
Prompt,DiffusionJob, andStoryboardImagerecordsQueue generation — dispatches each
DiffusionJobto thedefaultCelery queueUpdate status — marks the storyboard as
completed
Each queued DiffusionJob is then processed by the image generation worker, which loads the diffusion model (with warm cache), optionally applies the LoRA, and generates the image.
Progress Tracking
The Storyboard model provides three computed properties:
total_jobs— totalDiffusionJobcount in this storyboardcompleted_jobs— count of jobs withstatus="completed"progress_percent— completion percentage (0–100)
Status Lifecycle
Status |
Description |
|---|---|
|
Storyboard created, task not yet started |
|
Prompt generation and job creation in progress |
|
All jobs created and queued (individual image generation may still be running) |
|
Error during prompt generation or job creation |
Note that completed means the storyboard task itself finished — individual DiffusionJob records track their own status as images are generated.
VRAM Management
Storyboard generation involves two GPU-intensive stages that are managed sequentially:
Prompt enhancement — loads the Qwen2.5-3B LLM into VRAM
Image generation — loads the diffusion model into VRAM
The task pipeline ensures these don’t compete:
Before prompt enhancement:
_evict_pipeline_model()clears the adaptation LLMAfter prompt enhancement:
torch.mps.empty_cache()/torch.cuda.empty_cache()frees VRAMImage generation jobs run sequentially via the Celery
solopool
Viewing Storyboard Frames
After image generation completes:
Navigate to the Storyboard detail page
View Storyboard Images as inline entries, each showing:
Script row reference (shot number, order index)
Linked
DiffusionJobwith status and generated imageImage index (for multi-image configurations)
Images are sorted by script row order and image index, providing a sequential visual narrative
Comparing Configurations
Create multiple storyboards for the same ad unit to compare:
Different diffusion models (e.g., Juggernaut XL for photorealism vs. DreamShaper XL for stylized)
Different LoRAs (e.g., pen-and-ink illustration vs. cinematic film)
Different visual style prompts on the ad unit
With and without LLM prompt enhancement