A custom node for ComfyUI that integrates Google's Gemini AI models for image analysis and description. This node allows you to send images to Gemini API and get AI-generated descriptions or analysis based on your prompts.
- Support for multiple Gemini models:
- gemini-2.0-flash-exp
- gemini-1.5-flash
- gemini-1.5-pro
- Configurable safety filters
- Streaming response support
- Custom API key configuration
- Image to text generation
- Navigate to your ComfyUI custom nodes directory:
cd ComfyUI/custom_nodes/
- Clone this repository:
git clone https://github.com/AINxtGen/ComfyUI-GeminiAPI.git
- Install the required dependencies:
pip install -r requirements.txt
- Create a
config.json
file in the node directory with your Gemini API key:
{
"GEMINI_API_KEY": "your-api-key-here"
}
- Start ComfyUI
- Find the "Gemini API" node under the "Gemini" category
- Connect an image input to the node
- Configure the following parameters:
prompt
: Your text prompt for image analysismodel_name
: Select the Gemini model to useapi_key
: (Optional) Override the default API keystream
: Enable/disable response streamingsafety_filter
: Enable/disable content safety filters
You can configure the API key in two ways:
- Add it to
config.json
file - Input it directly in the node parameters