Home / Market / gemini omni flash api

gemini omni flash api

Use this skill for generative video editing, text-to-video, image-referenced video generation, and first-frame-to-video transition animations using the official google-genai SDK.

skill★ 508380 dlgithubCC-BY-4.0 content; MIT code; upstream exceptions applyInstall in CosmosUpstream Source

Documentation & Preview

--- name: gemini-omni-flash-api description: "Use this skill for generative video editing, text-to-video, image-referenced video generation, and first-frame-to-video transition animations using the official google-genai SDK." risk: critical source: https://github.com/google-gemini/gemini-skills/tree/main/skills/gemini-omni-flash-api source_repo: google-gemini/gemini-skills source_type: official date_added: 2026-07-01 license: Apache-2.0 license_source: https://github.com/google-gemini/gemini-skills/blob/main/LICENSE

---

Gemini Omni Flash Skill

When to Use

Use this skill when you need use this skill for generative video editing, text-to-video, image-referenced video generation, and first-frame-to-video transition animations using the official google-genai SDK. Includes workflows for pre-processing/optimizing high-resolution or long source videos with ffmpeg,...

This skill uses the Gemini Omni Flash model (gemini-omni-flash-preview) to perform text to video generation, image to video generation and video editing.

> [!WARNING] > Important Regional Restrictions: Uploading videos to use for video edits is NOT available in the EEA, Switzerland, the United Kingdom, and some US states. If a video-to-video edit completes quickly with empty outputs (total_output_tokens: 0 or no video content), it is likely due to this restriction.

Core capabilities

  1. Video editing and refinement: Editing existing videos (maximum duration 10 seconds), applying stylistic changes, or performing inpainting/outpainting.
  2. Text to video: Generating videos from a text prompt.
  3. First-frame to video: Generating videos from a single input image.
  4. Image-referenced generation: Using style, character, or object references from images to guide video generation.

Workflow

  1. Analyze request: Determine the target task (e.g., first-frame-to-video, reference-guided editing) and identify any input media assets.
  2. Run SDK scripts:
  1. Retrieve and process output: Outputs are saved to the local filesystem (e.g. media/). Report back the completed media path to the user.

Reference Documentation

Dependencies and Prerequisites

  pip install -U google-genai

Available scripts

Use the following Python scripts to upload media with the Files API, prepare input videos with ffmpeg, and generate video outputs using the Interactions API.

  1. upload_file.py: Uploads local media (images and videos) to the Files API and polls until ACTIVE. If uploading a video larger than 25MB, it prints an informative warning/tip highlighting that Gemini Omni Flash is optimized for editing 10s videos at 720p/24fps, and recommends pre-processing with prep_video.py first to speed up the upload.
   ./scripts/upload_file.py path/to/image.png
  1. generate_video.py: Performs end-to-end video generation and downloads the output video. It detects and uploads local media references (images or videos) before calling the Interactions API. Large video assets (>25MB) will trigger informative pre-processing recommendations without blocking the upload.
     ./scripts/video/generate_video.py "A close-up of a cat drinking tea" --output media/cat_tea.mp4
     ./scripts/video/generate_video.py "The waves crash against the shore." --image reference.png --output media/waves.mp4

Provide exactly two images as keyframes to generate a transition video between them:

     ./scripts/video/generate_video.py "A smooth timelapse from sunrise to sunset" --image start.png --image end.png --output media/interpolation.mp4
     ./scripts/video/generate_video.py "Transform the style to Japanese anime" --video input.mp4 --output media/anime_style.mp4
     ./scripts/video/generate_video.py "Transform the style to Japanese anime" --video input.mp4 --strip-audio --output media/anime_style_new_audio.mp4

Edit a prior video generation without re-uploading assets by passing the interaction ID:

     ./scripts/video/generate_video.py "Change the setting to a snowy winter wonderland." --previous-interaction-id "abc123xyz..." --output media/winter_wonderland.mp4
     ./scripts/video/generate_video.py --prompts-file prompts.txt --concurrency 3
     ./scripts/video/generate_video.py --batch jobs.json --concurrency 3

*Example jobs.json:*

     [
       {
         "prompt": "Transform the style to Japanese anime.",
         "video": "input.mp4",
         "output": "media/anime_style.mp4",
         "strip_audio": false,
         "aspect_ratio": "16:9"
       },
       {
         "prompt": "A smooth timelapse from sunrise to sunset.",
         "image": ["start.png", "end.png"],
         "output": "media/interpolation.mp4"
       }
     ]
  1. inspect_video.py: Inspects a local video file (using ffprobe) to check its duration, resolution, frame rate (FPS), audio stream presence, and format details.
   ./scripts/video/inspect_video.py media/output.mp4
     ./scripts/video/inspect_video.py media/output.mp4 --json
     ./scripts/video/inspect_video.py media/output.mp4 --raw
  1. prep_video.py: Normalizes, trims, and formats any video file to fit standard Gemini Omni Flash generation and editing limits. It handles timecode-based trimming, optional frame rate conversion, and proportional scaling of large videos (max 1280x720 for landscape, 720x1280 for portrait) to optimize upload times without stretching. If the video is longer than 10 seconds and the script is run interactively (in a TTY), it prompts the user to select the first 10s, last 10s, or enter a custom timecode (defaulting to the first 10s).
     ./scripts/video/prep_video.py path/to/source.mp4

or explicitly specify the start and duration:

     ./scripts/video/prep_video.py path/to/source.mp4 --start 0 --duration 10
     ./scripts/video/prep_video.py path/to/source.mp4 --start last
     ./scripts/video/prep_video.py path/to/source.mp4 --start 00:03 --output media/custom.mp4
     ./scripts/video/prep_video.py path/to/source.mp4 --fps 30 --resolution 1920x1080
     ./scripts/video/prep_video.py path/to/source.mp4 --strip-audio --output media/video_with_no_audio.mp4

Using tags in prompts to set image roles

You can use tags in your prompt to make it clear whether each uploaded media is an initial frame or a reference.

1. Simple tags (recommended)

For simple cases where image roles are clear from the prompt, you can bind images to roles directly:

An example with 6 reference images:

[0-3s] A studio fashion sequence. Starting with woman <IMAGE_REF_0>, she is holding <IMAGE_REF_1>
[3-6s] Then we see the man <IMAGE_REF_2> holding <IMAGE_REF_3>
[6-10s] And finally another woman <IMAGE_REF_4> who is holding <IMAGE_REF_5> while walking.

2. Explicitly declare sources and references

For more complex cases with multiple images and multiple roles, you can use explicit prefix tags paired with natural language instruction suffixes.

  [# Sources <FIRST_FRAME>@Image1] [# References <IMAGE_REF_0>@Image2] a woman <IMAGE_REF_0> is walking. Use Image1 as the starting frame. Use Image2 as a reference for the video generation.

Audio handling in video editing

When editing a source video that contains audio, you must choose between keeping the original audio or regenerating all audio from scratch.