Nodes/comfyui-jz/jz OpenRouter Image
ComfyUI Node

jz OpenRouter Image

Pick a Closed Image Model From a Dropdown, Right Inside Your Graph

By j-zhang19·Created 2 months ago·Updated about 23 hours ago· 2
jz OpenRouter Image
  • image
  • images
  • cost
  • usage
◄prompta photo of a cute dog►
◄modelgoogle/gemini-3-pro-image►
◄aspect_ratioauto►
◄resolutionauto►
◄n1►
◄seed0►
◄custom_model►
◄api_key►
◄max_edge2048►

You generate a frame with Nano Banana Pro, it's perfect, and now you have to download it and re-import it to keep working on it. jz OpenRouter Image deletes that round trip. It's an API-wrapper node: no checkpoint, no VRAM, no sampler. Wire in a prompt (and optionally an image), and it calls a closed model through OpenRouter and hands you back an IMAGE batch you can save, upscale, or feed to a video model.

Why this node exists at all

The KB's external-api-nodes.md splits the reasons a workflow leaves your machine into three. This is reason one: the model has no open weights, so local isn't an option at any VRAM. Gemini 3 Pro Image (Nano Banana Pro), GPT Image and the whole Seedream line are API-only; Google has never open-weighted an image generator. If you want those models you call them, or you don't have them. This node calls them from inside a graph where your local masking, upscaling and control already live.

What's actually happening under the hood

OpenRouter runs a separate images API: POST /api/v1/images, not /chat/completions. That's the whole reason the pack ships this as its own node rather than a mode of jz OpenRouter VLM - different endpoint, a prompt/n/aspect_ratio/resolution body, images returned as data[].b64_json, and its own catalogue at /api/v1/images/models that doesn't overlap the chat model list. Results get decoded to RGB and stacked into one batch tensor. A reference IMAGE goes in as input_references, one entry per frame of the batch - that is your img2img and editing path here. Nothing downloads; the node is a small HTTP client with retries on 429/5xx that honors Retry-After.

The one design decision worth understanding: auto omits the field entirely. Parameter support varies sharply per model, so sending a default the provider doesn't expect is a 400 with your money already spent. resolution doesn't exist on gpt-5-image or flux.2-pro, n caps at 1 for most models but 10 for gpt-5-image, and seed is unsupported on gemini-3-pro-image. Leave those on auto unless you know the model takes them.

The inputs and outputs that matter

prompt is the obvious one. model is a dropdown - the pack pins a curated set (gemini-3-pro-image, the flash variants, seedream-5-0 pro/lite, flux.2-pro, gpt-5-image/mini) at the top, appends the live catalogue from a 24-hour cache, and ends with custom, which reaches anything not listed via the custom_model string. The dropdown never blocks ComfyUI startup on a network call.

Then aspect_ratio (24 options, auto first), resolution (512/1K/2K/4K), n, and seed. Optional: image, custom_model, api_key, and max_edge (default 2048) - reference images are downscaled to that long edge before upload, which quietly saves you money on token-billed models.

Outputs are the images batch, plus two strings: cost (formatted like $0.0330) and usage (raw JSON - wire it to jz Display JSON and it renders a tree).

Install

No model files. No heavy dependencies. The pack's pyproject.toml asks for requests, pillow and numpy, all of which ComfyUI already ships, so installation is basically a restart. Via ComfyUI Manager, search the pack title comfyui-jz; manually:

cd ComfyUI/custom_nodes
git clone https://github.com/j-zhang19/comfyui-jz

Then the key. Both OpenRouter nodes share one: OPENROUTER_API_KEY under an [API] section in config.ini at the pack root. It also resolves from the api_key widget, a OPENROUTER_API_KEY env var or a .env file. Leave the widget blank so the key never lands in your workflow JSON.

Where people get burned

Cost. These models bill per output token, not per image, and the per-token figure in OpenRouter's listing looks tiny until it multiplies. A 1024×1024 from gpt-5-image-mini runs roughly 4160 image tokens, about $0.033; the bigger models are around 15× that. Read the cost output.

Unsupported parameters, silently. The most common OpenRouter image complaint in the wild is someone passing size, then image_size, then width/height, and getting a square back from every model with no error. This node normalizes that into aspect_ratio/resolution and sends only what you chose - so if you forced resolution: 2K onto a model without the field, expect a 400, not a bigger picture.

The key. A missing key raises the pack's own "No OpenRouter key" runtime error, which names all four places it looks. model: custom with an empty custom_model also raises. Nothing here silently passes junk downstream.

Filters and privacy. Your prompt and reference images leave the machine by design, and provider moderation applies - there are no weights to strip, so whatever Gemini or OpenAI refuses, this node refuses. And the standing note for any API node: it holds a credential and calls the network by design, the exact shape that made ComfyUI_LLMVISION a federal case. This pack has almost no community footprint yet - read the node before pasting a key into it. It's short, which is the only defense there is.

Categoryjz/api

Inputs (10)

NameTypeDefaultDescription
promptSTRINGa photo of a cute dog—
modelCOMBOgoogle/gemini-3-pro-image9 options: google/gemini-3-pro-image, google/gemini-3.1-flash-image, google/gemini-3.1-flash-lite-image, bytedance-seed/seedream-5-0-pro, bytedance-seed/seedream-5-0-lite, black-forest-labs/flux.2-pro, +3
aspect_ratioCOMBOautoauto omits the field — models support different subsets of these
resolutionCOMBOautoauto omits the field; gpt-5-image and flux have no resolution parameter at all
nINT11–10most models cap this at 1; gpt-5-image allows up to 10
seedINT00–2147483647sent only when non-zero — unsupported on some models
imageoptIMAGEreference images for editing / img2img — every frame of the batch becomes one reference
custom_modeloptSTRING—
api_keyoptSTRING—
max_edgeoptINT204864–8192references are downscaled to this long edge before upload

Outputs (3)

NameTypeDescription
imagesIMAGE—
costSTRING—
usageSTRING—