A SillyTavern extension that adds Gemini-powered image generation with character context and avatar references.
Fork notice — This is a fork of elouannd/context-image-generation by Elouann. It was forked to add LinkAPI provider support (routing image generation through LinkAPI's Gemini-compatible endpoint) without changing your active SillyTavern Chat Completion profile. All credit for the original extension goes to Elouann; the original is released into the public domain under The Unlicense.
- Lighter gallery - Gallery images are now stored as files (only paths are
kept in settings), instead of full-resolution base64 embedded in
settings.json. This dramatically shrinks the settings file and speeds up saves and startup. Existing base64 gallery items keep displaying; new ones use files. Inline chat images are unaffected (they already used files). Prompt text in the gallery is now safely escaped.
- Separate avatar reference toggles - "Use avatar references" is now split into two independent options: Use character avatar and Use your (persona) avatar. Send either, both, or neither as reference images. (Existing users who had avatars on keep both enabled.)
- Regenerate on image swipe (opt-in) - Swipe right past the last generated image on a message to create a fresh variation, without re-opening the panel.
- ChatGPT image models - Generate images with OpenAI
gpt-imagemodels (e.g.gpt-image-2-c) through your LinkAPI account. Text-prompt only (character/user descriptions are included; avatar image references are not supported for these models). Optional "Fetch models" button lists thegpt-image*/dall-e*models available on your key.
- LinkAPI Provider - Added LinkAPI as a provider option. Enter a LinkAPI key (used only for image generation) and requests are routed through
https://api.linkapi.aiwithout touching your active Chat Completion proxy settings.
- Auto Generate - Automatically generate images when messages are received (Off, Bot messages, or All messages)
- Thinking Level - Control how much the model "thinks" before generating (Auto, Minimal, Low, Medium, High) — Flash 2 only
- Google Search - Let the model search the web for reference images and information before generating — Flash 2 only (may not work on OpenRouter)
- Updated System Prompt - Default prompt now mentions internet search capabilities
- Expanded Image Sizes - Added support for 512px to 4K resolutions for Nano Banana 2 (Flash)
- Nano Banana 2 (Flash) - Added
gemini-3.1-flash-image-previewas a new model option
- Provider Selection - Choose between Google AI Studio or OpenRouter
- 4K Image Support - Generate 4K images with Gemini 3 Pro
- Dynamic Model List - Models update automatically based on selected provider
- Message Depth - Include 1-10 previous messages as story context for better scene understanding
- Previous Image Reference - Use last generated image as style reference for consistency
- File-Based Storage - Images saved to files instead of base64 in chat logs
- Message Generation Button - Wand icon in the dropdown menu on each message to generate an image from that message's content
- Character Context - Automatically includes character and user descriptions in prompts
- Avatar References - Uses character and user avatars as visual references for consistent art
- Slash Command -
/proimagine <prompt>for quick generation
⚠️ Important: A Paid Tier of AiStudio or OpenRouter credits is needed to generate pictures. Free version will not work.
- SillyTavern (latest staging branch)
- Google AI Studio API key OR OpenRouter API key configured in SillyTavern, OR a LinkAPI key entered in this extension's settings
- A Gemini model with image generation capability:
Nano Banana 🍌(Flash) - Faster, cheaper (~$0.04/image)Nano Banana 2 🍌(Flash) - Gemini 3.1 FlashNano Banana Pro 🍌(Pro) - Higher quality, 4K support (~$0.14/image)
- Navigate to your SillyTavern in the Extensions.
- Click on Install Extension Button and paste this repo link
- Configure your API key in Chat Completion settings
- Profit!
- Open a chat with a character
- Click the "..." menu on any message
- Click the wand icon (✨) to generate an image from that message
- Select your provider (Google AI Studio or OpenRouter)
- Choose model, aspect ratio, and image size
- Toggle avatar references and character descriptions
- Customize the system instruction
- View and manage gallery
/proimagine a beautiful sunset over mountains
Aliases: /proimg, /geminiimg
| Setting | Description |
|---|---|
| Provider | Google AI Studio, LinkAPI, or OpenRouter |
| LinkAPI Key | Required when Provider is LinkAPI; used only for image generation |
| Model | Flash ( |
| Aspect Ratio | 1:1, 3:4, 4:3, 9:16, or 16:9 |
| Image Size | Pro: Default, 1K, 2K, 4K Flash 2: Default, 512px, 1K, 2K, 4K |
| Thinking Level | Flash 2 only: Auto, Minimal, Low, Medium, High |
| Google Search | Flash 2 only: Enable web search for references |
| Auto Generate | Off, Bot messages, or All messages |
| Message Depth | Number of messages to include as context (1-10) |
| Use Character Avatar | Include the character avatar as a visual reference |
| Use Persona Avatar | Include your persona avatar as a visual reference |
| Regenerate on Image Swipe | Opt-in: swipe right past the last generated image to make a new variation |
| Include Descriptions | Add character descriptions to the prompt |
| Use Previous Image | Use last generated image as style reference |
| System Instruction | Customize instructions for the image model |
- Swiping a picture will result in an error.
[ ] Add Support for other Image generation services like Z-ai and Flux
This project is released into the public domain under The Unlicense. You are free to use, modify, and distribute this code for any purpose, with or without attribution.
- Original extension by Elouann — elouannd/context-image-generation.
- LinkAPI provider support added in this fork by BlueOwler.
- Created for use with SillyTavern.