Nodes/ComfyUI-OpenRouterImage/Wangsu Image Generator
ComfyUI Node

Wangsu Image Generator

Generate, edit, and variation against Wangsu

By zuojianghua·Created 6 months ago·Updated 2 months ago· 1
Wangsu Image Generator
  • image1
  • image2
  • image3
  • image4
  • image5
  • image6
  • image7
  • image8
  • image9
  • image10
  • image
  • status
modegenerate
modelgpt-image-2
promptA beautiful landscape with mountains and a sunset
n1
size(1:1) 1024x1024
qualityauto
backgroundauto
seed0

The odd one out in this pack. The other two nodes are Gemini-over-chat-API wrappers; ws_image doesn't touch Gemini at all. It drives the OpenAI images.* endpoint shape - generate, edit, and variation - against Wangsu's OpenAI-compatible gateways, with the model dropdown locked to a single entry: gpt-image-2. So instead of one API call, you get three API calls behind one node, switched by a mode dropdown. It's the node you reach for when the job isn't "draw this from scratch" but "change this thing about an existing image" or "give me variants of this."

It earns its keep precisely because edit and variation are things a chat-style prompt node can't easily express. In generate mode it's a plain text-to-image call. In edit mode you wire up to ten reference images and a prompt and the endpoint edits them. In variation mode it takes a single image and returns variations of it. Three different HTTP endpoints, one graph node, no file juggling - reference images go in as in-memory PNGs, so nothing touches your disk.

How it works

Look at the source and the dispatch is explicit: generateclient.images.generate(), editclient.images.edit(), variationclient.images.create_variation(). Each mode reads its own credential pair from the node's .env - so you can point generate, edit, and variation at three separate Wangsu endpoints, which is handy if your provider meters them differently. The response is decoded from b64_json or a URL; URLs are fetched with a curl user-agent because, per the code comment, Wangsu's CDN blocks Python's default urllib UA with a 403 and drops a Chrome UA at the TCP level. That's the kind of detail that tells you this node was written against a real, grumpy production API.

The inputs that matter

  • mode - generate, edit, or variation. Pick this first; it changes what the other inputs mean.
  • prompt - required for generate and edit, ignored in variation.
  • n - 1 to 10 images per call. This one returns a batched IMAGE tensor, so wire it to a Save node that handles multiple frames.
  • size - 25 presets like (1:1) 1024x1024; the node strips the label down to 1024x1024 before sending. auto is also an option.
  • quality (auto/low/medium/high) and background (auto/transparent/opaque) - sent in generate and edit, silently ignored in variation.

The seed field is the trap. It's accepted, logged, and then never sent to the API - OpenAI's images endpoints don't take a seed, and the code says as much: its only job is to bust ComfyUI's cache so two runs with identical settings actually re-call the API instead of replaying. Do not expect seed reproducibility here; it will not happen.

Install

Same pack as the others, so same routine: ComfyUI Manager → search OpenRouterImage, or clone and pip install -r requirements.txt. Then add the credentials you actually use to the node's .env:

cd ComfyUI/custom_nodes/ComfyUI-OpenRouterImage
echo 'WANGSU_IMAGE_GENERATE_URL=<url>' >> .env
echo 'WANGSU_IMAGE_GENERATE_API_KEY=<key>' >> .env
# repeat for _EDIT_ and _VARIATION_ pairs as needed

A mode that has no credentials set returns a 64x64 black placeholder and a status string naming the missing variable - the error lives in the status output, not in a dialog.

Where people get burned

edit mode without any reference image fails fast with a clear error - you need at least one of image1image10. variation mode only uses image1 and ignores the rest, so don't wire ten images expecting a blend. And like every node in this pack, it's completely absent from the README - the .env_example and the source are the documentation. This is a young, niche, reseller-facing node with next to no community track record yet, so treat it as "works, but bring your own Wangsu account and read the code."

Categoryimage_generation

Inputs (18)

NameTypeDefaultDescription
modeCOMBOgenerate3 options: generate, edit, variation
modelCOMBOgpt-image-21 options: gpt-image-2
promptSTRINGA beautiful landscape with mountains and a sunset
nINT11–10
sizeCOMBO(1:1) 1024x102425 options: auto, (1:1) 1024x1024, (3:2) 1536x1024, (2:3) 1024x1536, (4:3) 1216x912, (3:4) 912x1216, +19
qualityCOMBOauto4 options: auto, low, medium, high
backgroundCOMBOauto3 options: auto, transparent, opaque
seedINT00–4294967295
image1optIMAGE
image2optIMAGE
image3optIMAGE
image4optIMAGE
image5optIMAGE
image6optIMAGE
image7optIMAGE
image8optIMAGE
image9optIMAGE
image10optIMAGE

Outputs (2)

NameTypeDescription
imageIMAGE
statusSTRING