Nodes/comfyui-ayang_node/AICG Ayang Image-to-Image
ComfyUI Node

AICG Ayang Image-to-Image

Nano Banana in Your Graph, No GPU — Just an OpenRouter Key

By AICGayang·Created 12 months ago·Updated 12 months ago· 42
AICG Ayang Image-to-Image
  • image
  • image2
  • image3
  • image4
  • image5
  • image
  • status
api_key
prompt
modelgoogle/gemini-2.5-flash-image-preview:free
api_key_1
api_key_2
api_key_3
api_key_4
api_key_5
image_formatjpeg

Despite the "AICG" branding, this node runs nothing locally. It's an API wrapper: you paste an OpenRouter key, drop in a reference image, type a prompt, and it ships the whole thing to a hosted image model, then drops the result back into your graph as a normal IMAGE like nothing ever left the machine. No checkpoints, no VRAM, no model downloads. The name is almost a lie in the opposite direction from most - it calls no "AICG" anything, just OpenRouter's API.

The default model is the interesting part: google/gemini-2.5-flash-image-preview:free. That's Nano Banana (Gemini 2.5 Flash Image) on OpenRouter's free tier. It's a genuinely strong closed model, and the :free suffix means a draft-and-iterate stage can cost nothing and beat running a local model for that one step. The honest tradeoffs, same as every API node: switch off :free and you're paying per call, your images and prompt leave your machine, and Google's content filter applies - Nano Banana refuses what it refuses, and there's no local bypass because there are no weights to patch.

How it works (grounded in the source, a ~750-line __init__.py): the node builds an OpenAI-compatible chat request to https://openrouter.ai/api/v1 using the openai SDK. Your prompt gets wrapped with a "refer to the provided image content and style" instruction, up to five reference images are base64-encoded inline as image_url content, and the model's image response is decoded back to a tensor. Two details make it more useful than a naive wrapper: it appends an explicit "output the final image at exactly WxH" size instruction, and it keeps up to six API keys, rotating through them on retryable HTTP errors (401, 403, 429, 502, 503, 504).

Inputs that matter:

  • api_key (required) - paste from openrouter.ai/settings/keys
  • prompt (required, multiline) - what you want done with the reference
  • model - any OpenRouter model id; the free Nano Banana default is a fine start
  • image (required) - your reference image; add image2image5 for multi-reference
  • api_key_1api_key_5 - fallback keys for rate-limit roulette
  • image_format - jpeg (default) or png; pick png when you need lossless

Outputs: image (the generation) and status (STRING). Wire status to a text preview - this is where errors live. Leave the key or prompt empty and the node returns a white placeholder instead of crashing, so the error text is the only thing that tells you nothing happened. Check it.

Troubleshooting: 429s are the free tier's signature move - that's what the backup keys are for. 401/403 means the key is bad or expired. If the model id isn't exactly what OpenRouter lists (the :free suffix matters), you'll get a model-not-found error in status. And if you get an image back that ignores your requested size, that's the model picking its own aspect - a known Nano Banana behavior, not a node bug.

Installation - same steps as the whole pack, since it's all one repo:

cd ComfyUI/custom_nodes
git clone https://github.com/AICGayang/comfyui-ayang_node
cd comfyui-ayang_node
pip install -r requirements.txt

Restart ComfyUI, or install via ComfyUI Manager by searching "comfyui-ayang_node". Dependencies are light (gradio, Pillow, openpyxl, openai, requests) and the README is in Chinese, so if node names look foreign at first, know the pack ships an English locale you can switch to.

One honest caveat before you commit your key to this: an API node is arbitrary Python that holds a credential and phones home by design - the exact shape of thing this ecosystem has been burned by once (the LLMVISION malware, federal case and all). This pack is tiny: a single author, one commit in September 2025, and effectively no install base. It's Apache-2.0 and fully readable, so the move is to skim the source once rather than trust it blindly. For a zero-GPU way to run Nano Banana inside ComfyUI, it works; just know exactly what you're handing it.

CategoryAICG Ayang

Inputs (14)

NameTypeDefaultDescription
api_keySTRING
promptSTRING
modelSTRINGgoogle/gemini-2.5-flash-image-preview:free
imageIMAGE
image2optIMAGE
image3optIMAGE
image4optIMAGE
image5optIMAGE
api_key_1optSTRING
api_key_2optSTRING
api_key_3optSTRING
api_key_4optSTRING
api_key_5optSTRING
image_formatoptCOMBOjpeg2 options: jpeg, png

Outputs (2)

NameTypeDescription
imageIMAGE
statusSTRING