YouTube Shorts Visual Director & Image Generation Skill
This skill guides the agent in generating cohesive, cinematic 9:16 vertical scenes for YouTube Shorts using Antigravity's native generate_image capability.
1. Visual Consistency Framework (Character & World Sync) 👥🌍
When generating 5 to 20 images for a Short, avoiding stylistic or character drift is critical. If a character's face, clothing, or environment shifts randomly between scenes, video immersion breaks.
The 3 Pillars of Scene-to-Scene Synchronization:
-
The Character DNA Blueprint:
- Replicate the exact same 5-part character formula in every scene featuring the character:
[Name + Age/Gender] + [Hair style & color] + [Facial traits] + [Exact clothing items & colors] - Example:
"Maya, a 26-year-old female archaeologist with messy curly dark hair in a ponytail, freckles, wearing an olive linen safari shirt and brass compass necklace" - Never substitute with generic terms like "she looks" or "the woman".
- Replicate the exact same 5-part character formula in every scene featuring the character:
-
The World & Lighting Anchor:
- Define a shared environment statement prepended to all scene prompts:
[Setting] + [Primary light source & color temperature] + [Shadow style] + [Atmosphere] - Example:
"Subterranean ancient Egyptian sandstone tomb, warm amber torchlight casting deep flickering shadows, floating golden dust particles, dark cobalt background."
- Define a shared environment statement prepended to all scene prompts:
-
Visual Reference Chaining (
ImagePathsparameter) 🔗:- Antigravity's
generate_imagetool natively supportsImagePaths(passing previous images as visual conditioning references). - The Workflow:
- Generate Scene 1 (establishing master character and lighting).
- Save
scene_1.jpg. - For Scene 2, 3, 4..., pass
ImagePaths: ["<path_to_scene_1.jpg>"]intogenerate_image. - This feeds Scene 1's visual latent features directly to Imagen 3, anchoring face shape, clothing color, and environmental tones across all subsequent scenes!
- Antigravity's
2. Pre-Flight Validation & User Approval 🛑
CRITICAL REQUIREMENT (Zero Token Wastage):
Before executing any generate_image calls:
- Run the Pre-Flight Storyboard Validator:
.\backend\venv\Scripts\python.exe backend\scripts\storyboard_validator.py --json "path/to/script.json"- Must have 0 blocking errors (e.g., no banned text tokens, valid 9:16 signals, within 60s Shorts ceiling).
- Present the Validated Storyboard & Art Style to the user with the validation stats.
- Ask for explicit user approval:
"The storyboard has passed all pre-flight safety checks (0 errors, ~Xs estimated length). Would you like me to proceed with generating these [N] 9:16 images, or would you like to tweak any scenes or style parameters first?"
- DO NOT generate images until the user gives explicit confirmation.
3. Generating Images with Antigravity generate_image
For each scene in the storyboard (after receiving user approval):
-
Pre-Generation Duplicate / Cache Check 🛑:
- Check if
scene_{X}.jpgorscene_{X}.pngalready exists in the destination folder (backend/output/<job_id>/) and is valid (>10 KB). - If it already exists, skip regeneration to prevent wasted tokens, unless the user explicitly asks to regenerate/re-roll that specific scene.
- Check if
-
Synthesize the Final Prompt (Ensuring Distinct Camera Framing):
[World Anchor] + [Character Anchor] + [Scene Action & DISTINCT Camera Angle] + [Global Art Style Template] + [9:16 Vertical Composition]- Ensure the camera shot (e.g. wide vs macro vs reaction) differs from the preceding scene to avoid generating visually identical stills.
-
Invoke the Tool: Call
generate_imagewith:AspectRatio:"9:16"ImageName:scene_1,scene_2,scene_3, etc. (strictly unique per scene).Prompt: The synthesized prompt.ImagePaths: For scenes 2..N, pass["<path_to_scene_1.jpg>"]for visual conditioning.
-
Batch Generation: Generate scenes sequentially or in groups of scenes (up to 20 per short).
4. Asset Deployment to YTShorts Pipeline
Once images are generated by Antigravity:
-
Antigravity stores generated images in the conversation artifact directory:
C:\Users\<user>\.gemini\antigravity-ide\brain\<conversation-id>\*.png -
Copy or link the images to the YTShorts output/job directory:
d:\WorkSpace\YTShorts\backend\output\<job_id>\Standard naming required by the backend:scene_1.pngscene_2.pngscene_3.png- ...
-
Pair with the storyboard JSON: Save
script.jsonin the same directory:d:\WorkSpace\YTShorts\backend\output\<job_id>\script.json
5. Triggering Video Rendering 🚀
Once the images and script.json are staged in backend/output/<job_id>/, run the standalone assembly tool:
.\backend\venv\Scripts\python.exe backend\scripts\assemble_short.py --job_dir "backend/output/<job_id>" --voice in_female --caption_style tiktok --music lofi --resolution 1080p --transition dynamic
This single command automatically:
- Synthesizes high-definition TTS narration (Edge-TTS / KittenTTS).
- Generates word-level synchronized ASS subtitles via Whisper.
- Renders the final 1080p/4K
.mp4video with optical transitions (xfade), Ken Burns pan/zoom motion, background music with audio ducking, and subtitle burn in one go!
6. Channel Branding & Community Asset Generation 🎨📊
Beyond 9:16 vertical story scenes, the visual director also produces marketing assets using Antigravity's native generate_image tool:
-
Community Tab Image Polls (1:1 Square):
- Generate or center-crop characters to 1024x1024 square cards.
- Stage cards in
backend/output/community_poll_assets/(e.g.poll_1_character.jpg). - Image polls generate 3x–5x more reach on new channels than standard text posts.
-
Channel Avatar Mascot (1:1 Square):
- Generate centered 1024x1024 3D Pixar character portrait with expressive glossy eyes, holding a glowing storybook.
- Save to
backend/output/channel_branding/channel_avatar_1024x1024.jpg.
-
Panoramic Channel Banner (16:9 Landscape):
- Generate 16:9 panoramic cinematic landscape of the channel's recurring world.
- Upscale with Lanczos filter to 2560x1440.
- Save to
backend/output/channel_branding/channel_banner_2560x1440.jpg.
-
Zero External API Mandate:
- Always prioritize Antigravity's native
generate_imagetool. Never fall back to unverified free external image APIs.
- Always prioritize Antigravity's native