Nodes/RUI-Nodes/千问编辑图像生成 / Qwen Edit Image Generation
ComfyUI Node

千问编辑图像生成 / Qwen Edit Image Generation

Alibaba's Qwen image-edit model, called from inside the graph

By rui40000·Created 3 years ago·Updated 13 days ago· 17
千问编辑图像生成 / Qwen Edit Image Generation
  • image1
  • image2
  • image3
  • image4
  • IMAGE
api_key
base_urlhttps://dashscope.aliyuncs.com/api/v1/services/aigc/text2image-generation/generation
seed-1
control_modereference
width1024
height1024

Qwen Edit Image Generation is the node in RUI-Nodes that sends your images to Alibaba's Qwen image-editing API (DashScope) and gets a generated result back. The name makes it sound like a local model loader; it isn't. There is no checkpoint, no weights on disk, no GPU inference in your ComfyUI process - this node is a thin client for a paid cloud API. If that's a dealbreaker, stop here. If you're already in the Alibaba Cloud ecosystem, or you just want to compare what a commercial image-edit model produces against your local stack, this is a remarkably clean way to do it without leaving ComfyUI.

It's one of two API nodes in the pack (the other being the OpenAI-compatible connector), and it's clearly aimed at the pack's Chinese-first audience - DashScope is Alibaba's model platform, and everything about the defaults assumes you're using it. But the base_url is exposed, so a private gateway or proxy can slot in.

How it works

You feed it up to four reference images (image1image4), an API key, and a control_mode, and the node base64-encodes the images and POSTs them to the endpoint with your settings. The server-side model does the heavy lifting; ComfyUI just waits for the response and decodes it back into an IMAGE tensor.

The inputs that matter:

  • api_key - your DashScope key. Required. And here's the trap the author themselves flags in the tooltip: the key is saved into the workflow JSON. Strip it before you share a workflow, or everyone you share with gets a bill on your card.
  • control_mode - how the reference images constrain the result: reference (overall style - the default and the one you'll use most), pose, depth, seg, canny, hed, mlsd, scribble, sketch, normal. The server analyzes the refs and applies the constraint; stronger constraints mean the output composition hugs the reference harder.
  • width / height - output size, 512–2048, step 8. The tooltip warns that a very different aspect ratio from your reference can distort the composition.
  • seed - -1 for random each run, or fix it to reproduce a result.

Output is a single IMAGE.

Installing it

Part of the RUI-Nodes pack ("Rui-Node🐶") - install once, get all the nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/rui40000/RUI-Nodes
cd RUI-Nodes
pip install -r requirements.txt

or via ComfyUI Manager, search "RUI-Nodes", install, restart. It needs requests, which the pack already declares.

Where people get burned

Three things. First, the API key in the workflow JSON - already covered, and it's the one that costs real money. Second, network: you're calling dashscope.aliyuncs.com, so in regions where that's slow or blocked, expect timeouts; this is a cloud call, not local inference, so latency and availability are someone else's infrastructure. Third, cost: every run is billed by Alibaba, and at 1024×1024 defaults you can burn through a key faster than you expect if you're iterating. Treat this as a "compare against local" node or a production plumbing piece, not a free toy.

One more thing worth knowing: unlike local generation there's no negative prompt and no sampler settings - the API model owns all of that. You get the controls this node exposes, and not a slider more. If you want hands-on control, the rest of the pack is waiting.

CategoryRui-Node🐶/AI模型🤖

Inputs (10)

NameTypeDefaultDescription
image1IMAGE参考图 1(主参考)。控制模式决定它以什么方式影响生成, 例如 reference 取整体风格、pose 取人物姿态。
image2IMAGE参考图 2。多张参考会一并提交,用于综合约束生成结果。
image3IMAGE参考图 3。
image4IMAGE参考图 4。
api_keySTRING阿里云百炼(DashScope)的 API Key。 ⚠ 工作流会连同此值一起保存,分享 json 前记得清空。
base_urlSTRINGhttps://dashscope.aliyuncs.com/api/v1/services/aigc/text2image-generation/generation接口地址,一般不用改。 走代理或私有网关时替换成对应地址。
seedINT-1-1–2147483647随机种子。-1 表示每次随机; 填固定值可复现同一结果,便于对比参数改动的影响。
control_modeCOMBOreference参考图的约束方式: reference 整体风格参考(最常用) pose 取人物姿态 / depth 取空间深度 / seg 取区域分割 canny·hed·mlsd·scribble·sketch 取不同粗细的线稿 normal 取法线朝向。约束越强,构图越贴近参考图。
widthINT1024512–2048输出宽度。与高度共同决定画幅比例, 比例与参考图差异过大时构图容易变形。
heightINT1024512–2048输出高度。

Outputs (1)

NameTypeDescription
IMAGEIMAGE