Release Series • Part 2 of 3
Part 2: How Gemini Omni 1.2 Flash Affects Builders — Interactions API, Conversational Editing & SDK Blueprints
1. The Two-Phase Production Loop: Draft Fast, Upscale Smart
High-resolution video synthesis (1080p and 4K) is computationally intensive. In previous workflows, generating full-resolution takes to find a viable candidate wasted significant token budget and wall-clock time.
Omni 1.2 Flash officially formalizes the Two-Phase Pipeline:
- Draft Phase (360p or 720p): Generates in seconds at $0.07/sec (or lower for 360p). The creator or automated evaluation agent verifies camera pacing, physics, and product positioning.
- Conversational Refinement: If adjustments are needed (e.g. "Shift camera to orbital view", "Slow down the rotation by 20%"), the app executes an iterative prompt turn referencing the previous interaction ID.
-
Upscale Phase (1080p or 4K): Once approved, the client invokes the native
upscaleoperation on the finalized video token, producing broadcast-quality output without regenerating the underlying motion.
2. TypeScript SDK Implementation (Node.js & Browser)
Here is the production TypeScript pattern using the official @google/genai (v2.32+) Interactions API with reference images and conversational editing:
import { GoogleGenAI } from '@google/genai';
import * as fs from 'fs';
const ai = new GoogleGenAI();
async function runOmniVideoPipeline() {
console.log('--- Step 1: Ingesting Product Reference Image ---');
const heroImageBase64 = fs.readFileSync('./assets/hero-watch.png', { encoding: 'base64' });
console.log('--- Step 2: Generating 15-Second 720p Draft ---');
const draftInteraction = await ai.interactions.create({
model: 'gemini-omni-1.2-flash',
input: [
{
text: 'A luxury titanium chronograph wristwatch rotating on a volcanic stone pedestal, dramatic volumetric lighting, slow 360 orbital motion, high-end commercial aesthetic.'
},
{
inlineData: {
mimeType: 'image/png',
data: heroImageBase64
}
}
],
generationConfig: {
videoDurationSeconds: 15,
resolution: '720p',
aspectRatio: '16:9'
}
});
const draftVideoUrl = draftInteraction.outputs[0].videoUri;
console.log(`Draft Video Created (15s @ $0.07/s = $1.05): ${draftVideoUrl}`);
console.log('--- Step 3: Conversational Refinement (Changing Atmosphere) ---');
const refinedInteraction = await ai.interactions.create({
model: 'gemini-omni-1.2-flash',
previousInteractionId: draftInteraction.id,
input: [
{
text: 'Keep the exact wristwatch and 360 orbital camera motion, but replace the stone pedestal with an illuminated frosted-glass runway and add subtle atmospheric snow dust.'
}
]
});
console.log(`Refined Video URI: ${refinedInteraction.outputs[0].videoUri}`);
console.log('--- Step 4: Upscaling Final Selection to 4K ---');
const upscaleInteraction = await ai.interactions.create({
model: 'gemini-omni-1.2-flash',
previousInteractionId: refinedInteraction.id,
operation: 'upscale',
targetResolution: '4k'
});
console.log(`Broadcast 4K Master Ready: ${upscaleInteraction.outputs[0].videoUri}`);
}
runOmniVideoPipeline().catch(console.error);
3. Python SDK Blueprint (google-genai v2.34+)
The Python equivalent illustrates batch e-commerce animation with motion reference conditioning:
import os
from google import genai
from google.genai import types
client = genai.Client()
def generate_ecommerce_clip(image_path: str, product_name: str) -> str:
"""Generates a 15-second product video from a single static photograph."""
with open(image_path, "rb") as f:
image_bytes = f.read()
response = client.interactions.create(
model="gemini-omni-1.2-flash",
input=[
types.Part.from_text(
f"Dynamic commercial showcase for {product_name}. "
"Smooth cinematic zoom-out, studio lighting with ambient reflections, "
"photorealistic material rendering, 4k upscalable quality."
),
types.Part.from_bytes(data=image_bytes, mime_type="image/jpeg"),
],
config=types.GenerateVideoConfig(
duration_seconds=15,
resolution="720p",
aspect_ratio="9:16", # Optimized for Reels / Shorts / TikTok
),
)
print(f"Generated 15s commercial in {response.execution_time_ms}ms")
return response.outputs[0].video_uri
if __name__ == "__main__":
video_uri = generate_ecommerce_clip("assets/sneaker-white.jpg", "AeroSwift Runner")
print(f"Asset available at: {video_uri}")
4. Reference Input Guidance & Constraints
To get optimal results with Omni 1.2 Flash, structure your multimodal references according to Google's engineering recommendations:
- Hero Image References: Provide clean PNG or JPEG assets (minimum 1024×1024) with transparent or neutral backgrounds. Omni 1.2 Flash extracts both 2D semantic identity and depth topology.
- Motion Reference Video Clips: You can supply up to 3 seconds of reference video to dictate complex camera trajectories (e.g. drone flythroughs, whip pans, or steadycam tracking). The model extracts the kinematic vector field and maps your prompt onto that trajectory.
-
Multi-Speaker Conditioning: When requesting spoken dialogue in the video, structure the prompt with bracketed speaker cues (e.g.,
[Speaker 1, Warm Baritone]: "Welcome to the future." [Speaker 2, Energetic Alto]: "Let's build it together."). Omni 1.2 Flash synchronizes audio lip flaps to the visible 3D avatar meshes.
Try the Interactive Studio
Simulate multi-turn editing dialogues, evaluate pricing at scale, and export code directly to your editor.