Nodes/api_yi_nano_banana_node/APIYI Text to Image
ComfyUI Node

APIYI Text to Image

Nano Banana in ComfyUI without a GPU — via an API key, not a checkpoint

By JerrIsTheBesta·Created 4 months ago·Updated 4 months ago· 1
APIYI Text to Image
    • image
    • filename
    api_keysk-your-api-key
    model_name
    prompt一只可爱的橘猫,电影感打光,超清细节
    aspect_ratio
    resolution

    This node is a thin HTTP client dressed up as a ComfyUI node. It doesn't run anything locally - no checkpoint, no VRAM pressure, no model download. You paste in an API key from a service called APIYI, it phones home to api.apiyi.com, and a Gemini image model generates the picture on Google's servers before sending the PNG back. The name is a little cheeky: "nano_banana" is what the community calls Gemini's image models, and that's exactly what's behind the curtain here.

    Why would you want that inside a ComfyUI graph? Nano Banana is one of the best text-to-image models around and it is closed - you can't download weights for it. The only official doors in are the Gemini API or ImageFX. APIYI is a reseller sitting in the middle, and this node just wraps its endpoint. The win: your workflow stays in ComfyUI. The node spits out a proper IMAGE tensor, so you can wire it straight into a Save Image node, upscale it, or feed it downstream to a video model. The costs: every image is paid, and there's a stranger between you and Google.

    Install

    ComfyUI Manager (search api_yi_nano_banana_node), or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/JerrIsTheBesta/api_yi_nano_banana_node
    

    Then restart ComfyUI. If the console throws import errors, the README's fix is pip install requests pillow numpy - torch already ships with ComfyUI, and there are zero model files to fetch. One install gets you both nodes in this pack.

    The inputs that actually matter

    • api_key - your sk-... key from APIYI. The README is blunt about this: don't paste your master key. Create a dedicated key with a spend cap, because a runaway workflow can quietly rack up a bill.
    • model_name - two choices: gemini-3-pro-image-preview (Nano Banana Pro, the flagship: 4K native output, strong text rendering, up to 14 reference images) and gemini-3.1-flash-image-preview (Nano Banana 2, the speed/quality hybrid).
    • prompt - multiline, plain text. The default is a Chinese cat prompt; replace it.
    • aspect_ratio - ten options: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 5:4, 4:5.
    • resolution - 2K or 4K. Pick 2K for experiments; 4K is the pricey tier (roughly $0.04–$0.24 per image depending on resolution, and this pack's parent is a reseller, so expect that ballpark or worse).

    Outputs are image (a ComfyUI IMAGE tensor - plug it into PreviewImage or SaveImage) and filename (a string like apiyi_20260820_123456.png; it's an identifier, not an actual file on disk).

    Where people get burned

    The node blocks. A 2K request can take up to 300 seconds, 4K up to 360 seconds, and it runs synchronously - your queue will sit there looking frozen while the API grinds. That's not a crash; that's the model thinking.

    Also worth knowing before you invest: the censorship is Google's, not yours. Nano Banana ships with heavy image-safety filtering, famous-IP and celebrity restrictions, and an invisible SynthID watermark baked into every output. If your prompt is on the edgy side, expect refusals, and don't expect a local-model escape hatch.

    Troubleshooting

    • "API Key 不能为空" - the api_key field is empty. Fill it in.
    • Non-200 status codes - check the key, your account's permission, the model name, and your network (the README's own list).
    • Long stalls - normal; the timeout is deliberately set to match resolution (300s for 2K, 360s for 4K).

    Bottom line: if you want Nano Banana results and you're fine paying per image, this is the lowest-friction way to get them inside a ComfyUI graph. Just treat it as a paid API call with a UI, not a local generator.

    CategoryAPIYI/Image

    Inputs (5)

    NameTypeDefaultDescription
    api_keySTRINGsk-your-api-key
    model_nameCOMBO2 options: gemini-3-pro-image-preview, gemini-3.1-flash-image-preview
    promptSTRING一只可爱的橘猫,电影感打光,超清细节
    aspect_ratioCOMBO10 options: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, +4
    resolutionCOMBO2 options: 2K, 4K

    Outputs (2)

    NameTypeDescription
    imageIMAGE
    filenameSTRING