Custom ComfyUI nodes for Google Gemini image generation and editing using the Gemini web interface.
Security Warning
This node accesses your browser cookies for authentication. Please be aware:
- Local use only - Do not run on shared computers or public networks
- Cookie extraction - The app scans your browser for Google session cookies
- Plain text storage - Cookies may be stored in memory during session
- No SSL verification - Requests may not verify SSL certificates
Use at your own risk. Only run this on your personal, private machine.
Note: This is released as-is with no active maintenance planned. Pull Requests are welcome if you'd like to fix issues or improve the project!
- Text-to-Image - Generate images from text using Gemini's native image model
- Image-to-Image - Edit/transform images with natural language
- Vision Chat - Chat with Gemini about images
- Multi-Image Input - Support for up to 5 reference images
- Watermark Filter - Choose between watermarked, non-watermarked, or all images
- Auto Authentication - Supports browser cookie auto-detection
- Self-Contained - All dependencies bundled, no external API package needed
cd ComfyUI/custom_nodes
git clone https://github.com/Koko-boya/Comfyui-GeminiWeb.gitOr download and extract to ComfyUI/custom_nodes/Comfyui-GeminiWeb
cd Comfyui-GeminiWeb
pip install -r requirements.txtModern Chrome/Edge (v127+) uses App-Bound Encryption (v20) which requires special handling.
The simplest and most reliable method:
- Login to gemini.google.com
- Press F12 → Application → Cookies → gemini.google.com
- Copy
__Secure-1PSIDand__Secure-1PSIDTSvalues - Paste directly into the node's cookie inputs
Store cookies in a file for reuse:
- Edit
gemini_cookies.txtin the node folder:__Secure-1PSID=your_value_here __Secure-1PSIDTS=your_value_here - Use "cookie_file" in the node
For automatic v20 cookie decryption (Edge only tested):
- Run ComfyUI as Administrator
- Login to gemini.google.com in Edge
- Close the browser completely (important!)
- Make sure the browser is not running in the background
- Check Task Manager and end any Edge/Chrome processes
- Use "auto_cookies" in the node
Why Admin? Chrome/Edge 127+ use App-Bound Encryption (v20) which requires SYSTEM-level access to decrypt. Currently only Edge is tested.
Unified node for all Gemini operations.
| Input | Type | Description |
|---|---|---|
| mode | ENUM | text_to_image, image_to_image, or chat |
| prompt | STRING | Text prompt |
| auth_method | ENUM | auto_cookies, cookie_file, or manual |
| image_1 | IMAGE | Primary input image |
| image_2 | IMAGE | Optional reference image |
| image_3 | IMAGE | Optional reference image |
| image_4 | IMAGE | Optional reference image |
| image_5 | IMAGE | Optional reference image |
| model | ENUM | Gemini model to use |
| timeout | INT | API timeout (30-600 seconds) |
| image_filter | ENUM | all, no_watermark, or watermarked |
| cookie_1PSID | STRING | Cookie (manual mode) |
| cookie_1PSIDTS | STRING | Cookie (optional) |
| Output | Type | Description |
|---|---|---|
| image | IMAGE | Generated/edited image(s) |
| response_text | STRING | Text response from Gemini |
| thinking | STRING | Model thinking/reasoning |
- text_to_image: Generate images from text prompts
- image_to_image: Edit/transform input images using text instructions
- chat: Chat with Gemini (text response, optional image input for vision)
| Filter | Description |
|---|---|
all |
Return all generated images |
no_watermark |
Return only non-watermarked images (JPEG) |
watermarked |
Return only watermarked images (PNG) |
[GeminiWeb (text_to_image)] → [Preview Image]
[Load Image 1] → image_1 ─┐
[Load Image 2] → image_2 ─┼→ [GeminiWeb (image_to_image)] → [Save Image]
[Load Image 3] → image_3 ─┘
[Load Image] → image_1 → [GeminiWeb (chat)] → [Text Output]
| Model | Description |
|---|---|
unspecified |
Default model (uses Gemini's default) |
gemini-3-pro |
Pro model |
gemini-3-thinking |
Thinking model |
gemini-3-flash |
Fast model (default) |
| Issue | Solution |
|---|---|
| "Cookie expired" | Re-login to gemini.google.com and update cookies |
| "v20 App-Bound Encryption" | Use manual method (recommended) or run as Admin with Edge |
| "No browser cookies found" | Use manual or cookie_file method (recommended) |
| "Cookie file not found" | Create gemini_cookies.txt with your cookies |
| "No images generated" | Try adding "generate" to your prompt |
| Import errors | Run pip install -r requirements.txt |
| Region restrictions | Image generation may not be available in all regions |
| v20 not decrypting | Run as Admin + close Edge + PythonForWindows installed |
If you encounter problems, please open an issue with the prompt you used, or enable debug_mode in the node and attach the debug_request.txt file (found in the node's directory under custom_nodes/Comfyui-GeminiWeb/).
⚠️ Do NOT sharedebug_response.txt— it may contain your location and other personal details from Google.
- Based on Gemini-API by HanaokaYuzu (vendored)
- v20 Cookie Decryption based on chrome_v20_decryption by runassu
- ComfyUI Community
This project is licensed under AGPL-3.0 (same as the vendored Gemini-API library).
See LICENSE for details.
The gemini_webapi/ directory contains code from Gemini-API by HanaokaYuzu, licensed under AGPL-3.0.