㊙️Gemini_ImgURL_Zho
Feed Gemini a web image by URL instead of a local file
- text
Most Gemini vision nodes want a ComfyUI image tensor - something you've loaded locally. ㊙️Gemini_ImgURL_Zho is the one that takes a web URL instead. You paste a link, the node fetches the image at run time, and Gemini's vision model describes it, tags it, or answers questions about it. If your image lives on the internet - a scraped reference, a dataset entry, an image someone linked in a chat - this saves you the whole download-and-load dance.
The name is a mouthful (the S means secret/implicit key, read from config.json), but the workflow is simple: image_url in, caption out. The author built this for the use case where the image never touches your disk at all, which also makes it handy for chaining through URL lists in batch captioning - feed one URL per run and collect the text.
How it works
Under the hood it uses requests.get(image_url) to download the image into memory, converts it to a PIL image, and sends it to Gemini alongside your prompt as a two-part generate_content call. Key detail: the fetch happens on your machine at execution time. That means the URL has to be publicly reachable from wherever ComfyUI is running - a localhost URL, an authenticated/hotlink-protected link, or a signed S3 URL that's expired will all fail before Gemini is ever called.
Inputs
- image_url - the web address of the image. This is the one you set.
- prompt - default "Describe this image"; ask for tags, style analysis, whatever.
- model_name -
gemini-pro-visionorgemini-1.5-pro-latest(1.5 Pro is the better captioner). - stream - leave off.
The text output feeds DisplayText_Zho so you can see it, or goes straight into a tag-sorting pipeline.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/ZHO-ZHO-ZHO/ComfyUI-Gemini.git
cd ComfyUI-Gemini
pip install -r requirements.txt
Add your key to custom_nodes/ComfyUI-Gemini/config.json, restart ComfyUI, done.
Where it goes wrong
- "Failed to load image from URL" - the status code wasn't 200. Dead link, hotlink protection, an expired signed URL, or the site blocking bots. Try the URL in a browser first.
- Rate limits - same free-tier reality as every node here (roughly 2 RPM on 1.5 Pro at launch). A URL-list tagging job will trip this; pace your queue.
- Model choice matters -
gemini-pro-visionis the older model and noticeably weaker at fine detail than 1.5 Pro. If the captions feel dumb, you're probably on vision. - Connectivity to Google - the whole pack is a hosted API. If you can't reach Google's services, the author's own advice is to run on Colab or Kaggle.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Describe this image | — |
| image_url | STRING | — | |
| model_name | COMBO | 2 options: gemini-pro-vision, gemini-1.5-pro-latest | |
| stream | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |