7 Modalities.
One Pipeline.
Video, speech, text, embeddings, image, spatial vision, and music — orchestrated by one coding agent.
Christopher Brox · Google DeepMind, Antigravity
One creator clip. One product photo.
Turn a raw creator video and a static product PNG into a context-matched CTV ad pod stream.
Skills kill SDK hallucinations.
Checking .agents/skills/ into the repo gives the agent verified scripts and current google-genai model IDs.
Find the ad break. Tag every brand.
Why: Pinpoint natural SCTE-35 splice timestamps and log every brand & visual swap in a single pass.
from pydantic import BaseModel
from google import genai
from google.genai import types
class VideoEvent(BaseModel):
start_time: str # MM:SS
end_time: str # MM:SS
event: str
visual_details: str
client = genai.Client()
video_bytes = open("demo/assets/00_source/omni_source.mp4", "rb").read()
response = client.models.generate_content(
model="gemini-3.8-flash",
contents=[
types.Part.from_bytes(data=video_bytes, mime_type="video/mp4"),
"Extract every visual edit, brand logo, and natural ad-break timestamp (MM:SS).",
],
config=types.GenerateContentConfig(
response_mime_type="application/json",
response_schema=list[VideoEvent],
),
)
Words, timestamps, and vocal tone.
Why: Extract verbatim transcripts and SDH captions tagged with vocal delivery and emotion.
from pydantic import BaseModel
from google import genai
from google.genai import types
class CaptionSegment(BaseModel):
speaker: str
start_time: str # MM:SS
end_time: str # MM:SS
text: str
tone: str
client = genai.Client()
audio_bytes = open("demo/assets/00_source/omni_audio.mp3", "rb").read()
verbatim = client.models.generate_content(
model="gemini-3.5-transcribe",
contents=[types.Part.from_bytes(data=audio_bytes, mime_type="audio/mp3"), "Transcribe verbatim."],
)
sdh = client.models.generate_content(
model="gemini-3.8-flash",
contents=[types.Part.from_bytes(data=audio_bytes, mime_type="audio/mp3"), "Transcribe with MM:SS and tone."],
config=types.GenerateContentConfig(
response_mime_type="application/json",
response_schema=list[CaptionSegment],
),
)
Match the clip to the advertiser brief.
Why: Score semantic vector similarity and synthesize a schema-locked JSON ad insertion plan.
from pydantic import BaseModel
from google import genai
from google.genai import types
class AdDecision(BaseModel):
matched_campaign_id: str
brand: str
scte35_insertion_point_mm_ss: str
dynamic_ctv_video_prompt: str
dynamic_voiceover_script: str
client = genai.Client()
emb = client.models.embed_content(
model="gemini-embedding-2",
contents="Host holds a BROX COFFEE cup in a wood-slat podcast studio.",
)
decision = client.models.generate_content(
model="gemini-4-argon",
contents="Match this clip to the Brox Coffee brief and output a CTV ad plan.",
config=types.GenerateContentConfig(
response_mime_type="application/json",
response_schema=AdDecision,
),
)
One frame. Two cohort thumbnails.
Why: Conversationally restyle lighting, background, and typography while locking character & product identity.
from google import genai
from google.genai import types
client = genai.Client()
keyframe_bytes = open("demo/assets/04_image_gen/raw_keyframe.png", "rb").read()
response = client.models.generate_content(
model="gemini-nano-banana-2.1",
contents=[
types.Part.from_bytes(data=keyframe_bytes, mime_type="image/png"),
"Transform this frame into a high-contrast 16:9 CTV thumbnail: keep the host and "
"BROX COFFEE cup identical, add cyan rim lighting, a stormy ocean vortex outside "
"a studio window behind him, and bold white text 'THE OMNI SHIFT' in the upper right.",
],
config=types.GenerateContentConfig(
response_modalities=["TEXT", "IMAGE"],
),
)
Pause-ad safe zones.
Why: Detect 2D bounding boxes ([ymin, xmin, ymax, xmax]) so CTV overlays never collide with faces or props.
from pydantic import BaseModel
from google import genai
from google.genai import types
class BoundingBox(BaseModel):
label: str
box_2d: list[int] # [ymin, xmin, ymax, xmax] normalized 0..1000
client = genai.Client()
keyframe_bytes = open("demo/assets/04_image_gen/raw_keyframe.png", "rb").read()
response = client.models.generate_content(
model="gemini-3.8-flash",
contents=[
types.Part.from_bytes(data=keyframe_bytes, mime_type="image/png"),
"Detect host face, BROX COFFEE cup, podcast microphone, and tropical plant. "
"Return 2D bounding boxes as [ymin, xmin, ymax, xmax] scaled 0 to 1000.",
],
config=types.GenerateContentConfig(
response_mime_type="application/json",
response_schema=list[BoundingBox],
),
)
Product photo to studio-matched video ad.
Why: Animate a static product PNG into 16:9 video, then conversationally edit the scene to match the show’s set.
import base64
from google import genai
client = genai.Client(vertexai=True, project="ckbrox13", location="global")
img_b64 = base64.b64encode(open("demo/assets/00_source/advertiser_espresso_can.png", "rb").read()).decode()
# 1. Create 16:9 CTV Video Ad from Static Product Photo
v1 = client.interactions.create(
model="gemini-omni-1.1-flash-preview",
input=[
{"type": "image", "data": img_b64, "mime_type": "image/png"},
{"type": "text", "text": "BROX COFFEE cup and cold-brew can rotating slowly with rising steam."},
],
response_format={"type": "video", "aspect_ratio": "16:9", "resolution": "720p"},
)
# 2. Conversationally Edit Video Background into the Host's Wood-Slat Studio
v2 = client.interactions.create(
model="gemini-omni-1.1-flash-preview",
previous_interaction_id=v1.id,
input="Place the BROX COFFEE cup and can in a modern wood-slat podcast studio next to a Shure SM7B mic.",
response_format={"type": "video", "aspect_ratio": "16:9", "resolution": "720p"},
)
Voiceover, backing beat, and stream splice.
Why: Synthesize expressive voiceover with acting cues, score custom backing music, sidechain-duck, and splice at 00:25.
from google import genai
from google.genai import types
client = genai.Client(vertexai=True, project="ckbrox13", location="global")
# 1. Expressive TTS Voiceover with Acting Cues (gemini-3.8-flash-tts)
tts_res = client.models.generate_content(
model="gemini-3.8-flash-tts",
contents=(
"From Blue Bottle to Starbucks to Brox Coffee—when you are building the future of AI, "
"only one roast keeps up. <sigh> Brox Coffee. Freshly roasted in San Francisco and New York."
),
config=types.GenerateContentConfig(
response_modalities=["AUDIO"],
speech_config={"voice_config": {"prebuilt_voice_config": {"voice_name": "Aoede"}}},
),
)
# 2. Backing Music Generation (lyria-3-clip-preview)
music_res = genai.Client().interactions.create(
model="lyria-3-clip-preview",
input="Upbeat minimal electronic creator podcast beat, 114 BPM. Instrumental only, no vocals.",
)