2025-03-20 23:45:59 +00:00
2025-04-06 01:27:43 +08:00
2025-03-22 12:11:33 +00:00
2025-03-22 11:57:17 +00:00
2025-04-06 01:25:45 +08:00
2025-03-20 23:36:06 +00:00
2025-03-21 10:03:36 +00:00
2025-03-22 11:57:17 +00:00
2025-04-06 01:25:45 +08:00
2025-03-20 23:36:06 +00:00
2025-03-22 05:59:49 -07:00
2025-03-22 05:01:20 -07:00
2025-03-21 10:03:36 +00:00
2025-03-20 23:36:06 +00:00
2025-03-20 23:36:06 +00:00

ComfyUI-IF_Gemini

Enjoy Google Gemini API for ComfyUI generate images, transcribe audio, sumarize videos. Making a separate implemetation of my old IF_AI tools for easy installation

Features

  • Text Generation: Create content, answer questions, and generate creative text formats
  • Image Analysis: Describe, analyze, and extract information from images
  • Image Generation: Generate images with Gemini's image generation capabilities
  • Multi-Modal Input: Combine text and images in your prompts
  • Customizable Parameters: Control temperature, output tokens, and other generation settings
  • Chat Mode: Maintain conversation history for interactive sessions
  • Batch Processing: Generate multiple outputs with a single prompt

Installation

  1. Clone this repository into your ComfyUI custom nodes folder:
cd ComfyUI/custom_nodes
git clone https://github.com/if-ai/ComfyUI-IF_Gemini
  1. Install the required Python packages:
cd ComfyUI-IF_Gemini
pip install -r requirements.txt
  1. Restart ComfyUI to load the new node

Usage

The Gemini node appears in the "ImpactFrames💥🎞️/LLM" category in the ComfyUI node browser.

  1. Restart ComfyUI

  2. Add your Gemini API key using one of these methods:

    • Shell configuration file (recommended for macOS/Linux):

      # In ~/.zshrc, ~/.bashrc, or ~/.bash_profile:
      export GEMINI_API_KEY=your_api_key_here
      

      Then restart your terminal or run source ~/.zshrc (or relevant file)

    • System environment variable:

      export GEMINI_API_KEY=your_api_key
      
    • Directly in the node: Enter your API key in the "external_api_key" field

    • In a .env file in the custom node directory:

      GEMINI_API_KEY=your_api_key
      
  3. Add the "IF LLM Gemini AI" node to your workflow

  4. Verify your API key using the "Verify API Key" button in the node

  5. Configure the node:

    • For text generation, set "operation_mode" to "analysis" or "generate_text"
    • For image generation, set "operation_mode" to "generate_images"
    • Connect reference images (optional) for style-based generation
  6. Set additional parameters as needed:

    • Prompt: Your text instructions
    • Model version: Select appropriate Gemini model
    • Temperature: Controls randomness (0.0-1.0)
    • Seed: For reproducible results

Troubleshooting

  • If you encounter API key errors, use the "Verify API Key" button to check its validity
  • For image safety errors, try modifying your prompt to avoid content that may trigger safety filters
  • Ensure your Gemini API has appropriate quotas for your usage

License

MIT

Support

If you find this tool useful, please consider supporting my work by:

:IFGemini_comfy
S
Description
No description provided
Readme
12 MiB
Languages
Python 91%
JavaScript 8.9%
HTML 0.1%