Nodes/ComfyUI-NanoBanana2/NanoBanana - Network Route
ComfyUI Node

NanoBanana - Network Route

The node that makes your Gemini calls look like they come from the US

By IxMxAMAR·Created 6 months ago·Updated about a month ago· 4
NanoBanana - Network Route
    • network
    • status
    enabledtrue
    proxy_url
    labelUS route
    test_nowfalse
    http_username
    http_password

    Google's AI models are not available everywhere. Nano Banana and friends are famously region-gated, and if you're in a country where a model isn't offered, the API just refuses - the r/StableDiffusion threads about "Sora and Nano Banana in Europe" are full of people discovering this the hard way. This node is the pack's answer: it routes every Google API call through a proxy you configure, so your requests appear to originate from the US (or wherever) without touching any other app on your machine.

    It's a niche tool for a real, annoying problem. You need a proxy - your own VPS running dante or squid, a Mullvad SOCKS5, a residential service - and then this node makes all the NanoBanana nodes tunnel through it.

    How it works

    The node produces a special NB_NETWORK config object that every other NanoBanana node accepts on its network input. Wire the network output of this node into, say, ImageGen's network input, and that node's HTTP client routes through your proxy. Leave a node's network input unconnected and it calls Google directly, exactly as before - so you can route selectively.

    The inputs:

    • enabled - master switch. OFF means recipients call directly even if wired.
    • proxy_url - the proxy. Supports http://, https://, socks4://, socks5://, and socks5h://. The tooltip's advice is worth repeating: use socks5h:// (not socks5://) when you want DNS resolved on the proxy side, which stops your local resolver leaking the original lookup.
    • label - a free-form tag shown in the status text. Cosmetic.
    • test_now - flip to TRUE and the node makes a real GET to ipinfo.io through the proxy, then reports the egress IP, country, and ISP in its status output. This is the killer feature: verify your route actually goes where you think before you wire it into production nodes.
    • http_username / http_password - optional, override any creds embedded in the URL.

    Outputs: network (the NB_NETWORK config) and status (a STRING describing the route, or the probe result).

    Mechanically, it builds an httpx client whose transport is mounted through the proxy. And it's tested the right way - the pack actually fires a request through the proxy to check the egress, rather than assuming the URL parses.

    Installation

    Part of the NanoBanana2 pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/IxMxAMAR/ComfyUI-NanoBanana2
    pip install google-genai
    

    The pack declares httpx[socks] as a dependency specifically to support SOCKS proxies, so socks URLs should just work. ComfyUI Manager: search NanoBanana2. Needs a Gemini API key on the receiving nodes as usual.

    Gotchas

    Do the test_now probe before trusting anything - a proxy URL that parses can still be dead, slow, or resolving DNS locally when you don't want it to. And read the status output, not just the green wires: the pack prints the route status to the console too. If you're in a region where the model is outright blocked, remember the restriction is tied to your account as well as your egress - a US proxy with a non-US account key can still hit walls. And don't route everything through a slow residential proxy out of paranoia; it adds latency to every call, so use it only for the nodes that actually need the region.

    CategoryNanoBanana2/Config

    Inputs (6)

    NameTypeDefaultDescription
    enabledBOOLEANtrueMaster switch. When OFF, recipients call directly even if wired.
    proxy_urlSTRINGFull proxy URL. Examples: http://us-proxy.example.com:3128 http://user:[email protected]:3128 socks5://127.0.0.1:1080 socks5h://user:[email protected]:1080 Use socks5h:// (not socks5://) when you want DNS resolved on the proxy side too — that prevents your local resolver from leaking the original lookup.
    labelSTRINGUS routeFree-form tag shown in the status text. Cosmetic only.
    test_nowBOOLEANfalseToggle to TRUE to probe the proxy: makes a GET to ipinfo.io through the configured proxy and reports the egress IP, country, and ISP. Use this to verify your route works before plugging into production nodes.
    http_usernameoptSTRINGOptional. If set, overrides any user:pass in proxy_url.
    http_passwordoptSTRINGOptional. Paired with http_username.

    Outputs (2)

    NameTypeDescription
    networkNB_NETWORK
    statusSTRING