Skip to content

Switch to Nano Banana 2 Lite images and Gemini Omni Flash GIFs#67

Merged
achimala merged 2 commits into
mainfrom
cursor/gemini-image-gif-models-ff3f
Jul 1, 2026
Merged

Switch to Nano Banana 2 Lite images and Gemini Omni Flash GIFs#67
achimala merged 2 commits into
mainfrom
cursor/gemini-image-gif-models-ff3f

Conversation

@achimala

@achimala achimala commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Static images now use Google's Nano Banana 2 Lite (gemini-3.1-flash-lite-image) via the Gemini Interactions API instead of OpenAI gpt-image-2.
  • Animated GIFs now use Gemini Omni Flash (gemini-omni-flash-preview) to generate a short video, then sample frames with ffmpeg, chroma-key each frame against magenta, and encode to GIF — replacing the old N×N sprite sheet approach.
  • Adds a new GeminiClient, GEMINI_API_KEY config, and wires it through /img, /gif, /gifemoji, /emoji, scrapbook, image-of-day, and the agent generate_image tool.

Changes

  • src/gemini/client.ts — image + video generation via Interactions API, with polling for video completion
  • src/utils/image-processing.tsprocessVideoToGif() replaces processGifEmojiGrid(); updated buildGifPrompt() for video instead of grid layout
  • Removed image generation from OpenAIClient (chat/embeddings unchanged)
  • Updated Discord command descriptions

Setup

Add to your environment:

GEMINI_API_KEY=your-gemini-api-key

Requires ffmpeg/ffprobe on the host for GIF frame extraction (already present in the deployment environment).

Testing

  • pnpm build
  • pnpm lint
  • pnpm test run
Open in Web Open in Cursor 

cursoragent and others added 2 commits July 1, 2026 19:49
… Flash

Replace OpenAI gpt-image-2 with gemini-3.1-flash-lite-image for all static
image generation. Replace the sprite-sheet GIF approach with Gemini Omni Flash
(gemini-omni-flash-preview) video generation, ffmpeg frame extraction, and
per-frame magenta chroma keying into animated GIFs.

Co-authored-by: Anshu Chimala <achimala@gmail.com>
The project previously used GOOGLE_API_KEY for Nano Banana Pro before it was
removed in the Modernize model providers commit.

Co-authored-by: Anshu Chimala <achimala@gmail.com>
@achimala achimala marked this pull request as ready for review July 1, 2026 20:46
@achimala achimala merged commit d8f6d2b into main Jul 1, 2026
@achimala achimala deleted the cursor/gemini-image-gif-models-ff3f branch July 1, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants