Nodes/ComfyUI-Gemini/✨Gemini_API_Vsion_ImgURL_Zho
ComfyUI Node

✨Gemini_API_Vsion_ImgURL_Zho

The URL-vision node when you insist on typing your key in

By ZHO-ZHO-ZHO·Created 3 years ago·Updated 2 years ago· 789
✨Gemini_API_Vsion_ImgURL_Zho
    • text
    promptDescribe this image
    image_url
    model_name
    streamfalse
    api_key

    This is the explicit-key version of ㊙️Gemini_ImgURL_Zho, and the difference is exactly one input: you type your api_key into a widget instead of leaving it in config.json. Everything else - fetch a web image by URL, send it to Gemini's vision model, get text back - is identical.

    So when would you pick this over the ㊙️ twin? Honestly, rarely. The one legitimate case is testing: if you want to sanity-check a brand-new key without editing a config file and restarting, this node lets you paste it and go. There's also a mild appeal to it if you're on a shared machine where you can't write to the pack directory. But those are convenience wins for a real security cost, and you should internalize the cost before you make it a habit.

    The security thing, spelled out

    ComfyUI embeds the whole workflow as metadata in output images. If this node is in the workflow, your API key is in the PNG. Save an image to share it, and anyone who looks at the metadata has your key - and your free-tier quota, and eventually your bill if the key is ever tied to a paid account. The README says it plainly: don't share workflows containing these explicit-key nodes. If the key ends up in the wild, go to Google AI Studio and revoke it.

    How it works and what you set

    Mechanically it's the same as its ㊙️ twin: requests.get(image_url) downloads the image at execution time, then the prompt and image go to Gemini as a two-part call. The URL must be publicly fetchable from your machine - hotlink-protected or expired signed URLs die with a "Failed to load image from URL" error before Gemini is ever involved.

    • image_url - the web address of the image.
    • prompt - default "Describe this image"; make it ask for tags or style.
    • model_name - gemini-pro-vision or gemini-1.5-pro-latest; 1.5 Pro captions noticeably better.
    • api_key - your key, in the workflow.
    • stream - leave off.

    The text output goes to DisplayText_Zho or into a downstream prompt 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
    

    Restart and you're live. The rest of the gotchas match the pack: free-tier rate limits (roughly 2 RPM on 1.5 Pro at launch), hosted-API connectivity requirements, and the general advice that if you're going to run this regularly, switch to the ㊙️ version so your key stops riding along in every saved image.

    CategoryZho模块组/✨Gemini

    Inputs (5)

    NameTypeDefaultDescription
    promptSTRINGDescribe this image
    image_urlSTRING
    model_nameCOMBO2 options: gemini-pro-vision, gemini-1.5-pro-latest
    streamBOOLEANfalse
    api_keySTRING

    Outputs (1)

    NameTypeDescription
    textSTRING