Nodes/Artha-Gemini/πŸ”± Gemini Backdrop
ComfyUI Node

πŸ”± Gemini Backdrop

Steal the background from any image, as a reusable prompt

By CyrostarΒ·Created about a year agoΒ·Updated about a year agoΒ· 1
πŸ”± Gemini Backdrop
    • backdrop
    β—„api_keyβ–Ί
    β—„modelgemini-2.5-flashβ–Ί
    β—„max_tokens5000β–Ί
    β—„temperature0.7β–Ί
    β—„imageβ–Ύβ–Ί

    Gemini Backdrop is the pack's background-description node, and it exists to solve a specific, annoying problem: you've got an image with a background you love, and you want to describe it well enough to reuse it. The node uploads your image to Gemini, asks it to "describe the background," and hands you back a clean text description you can drop into any prompt.

    It's part of the Artha-Gemini pack (the πŸ”± Gemini nodes) - the family of cloud-LLM nodes that do their thinking on Google's servers. Backdrop is one of the quieter members: no fancy toggles, no scene graph, just "read the background and tell me about it." Sometimes the simple nodes are the most useful.

    How it works

    Mechanically it's a one-shot vision call. You pick an image from the upload widget, the node converts it, and sends it to Gemini with a bundled "backdrop" agent as the system instruction and the text Describe the background. as the prompt. The agent is tuned to produce a structured, detailed description rather than a vague one-liner. After the call, stray * and # markdown characters get stripped from the result.

    The result is a single backdrop string - and unlike the profile nodes in this pack (Cloth, Compose, and friends), Backdrop's output type is plain STRING. That means it's not locked into the pack's internal wiring; you can feed it into any text input anywhere in ComfyUI. That flexibility is honestly the reason to use it over the typed nodes if you just want a background description to paste into a prompt.

    Inputs and outputs

    • image - an upload widget pointing at a file in ComfyUI's input directory. No IMAGE tensor input here; you select a file directly.
    • api_key, model, max_tokens, temperature - the shared API block, gemini-2.5-flash by default.

    Output: backdrop (STRING). And that's the whole input list - there's no prompt field, no instruction override. If you want to steer the description, this isn't the node; check out Gemini Vision, which lets you supply your own prompt.

    Installing it

    Install the pack via ComfyUI Manager (search Artha-Gemini) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Cyrostar/ComfyUI-Artha-Gemini
    cd ComfyUI-Artha-Gemini
    pip install -r requirements.txt
    

    No model downloads. You need a Gemini API key from Google AI Studio, because this node always makes a live API call - there's no local mode.

    Where people get burned

    Same three gotchas as the rest of the pack, worth repeating. The key: put it in the pack's api.json (gemini_api_key) or the GEMINI_API_KEY env var - the api_key field stores it in plain text inside your workflow. Cost: every run is a billable call, so don't put this in a batch loop without thinking about it. The output contract: when the API fails you get a string starting with Error: and the real message lives in the ComfyUI console.

    One quirk specific to this node: because the input is an upload picker rather than a tensor, the image has to exist as a file in your input directory - a freshly rendered image still sitting in a preview won't feed it directly. Save it to disk first, then pick it. And remember the description is a description, not a spec: it captures what the background is, not how to perfectly reconstruct it, so treat it as a strong starting point for your prompt rather than a recipe.

    CategoryArtha/LLM/GEMINI

    Inputs (5)

    NameTypeDefaultDescription
    api_keySTRINGAPI key will be visible in plain text. Consider adding your api to the api.json located inside this custom node folder.
    modelCOMBOgemini-2.5-flash5 options: gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.0-flash, gemini-2.0-flash-lite
    max_tokensINT50001–8192For Gemini models, a token is equivalent to about 4 characters. 100 tokens is equal to about 60-80 English words.
    temperatureFLOAT0.70–2A temperature of 0 means only the most likely tokens are selected, and there's no randomness. Conversely, a high temperature injects a high degree of randomness into the tokens selected by the model, leading to more unexpected, surprising model responses.
    imageCOMBO1 options: example.png

    Outputs (1)

    NameTypeDescription
    backdropSTRINGβ€”