Nodes/ComfyUI-HaoranWanxImageEdit/Haoran 通义万相图像编辑
ComfyUI Node

Haoran 通义万相图像编辑

Ten image edits on a paid cloud API — no GPU, no local model, just a key

By GonDesign·Created 8 months ago·Updated 8 months ago· 0
Haoran 通义万相图像编辑
  • 图像
  • api_config
  • 蒙版
  • 图像
功能指令编辑
提示词
生成数量1
随机种子0
使用随机种子false
添加AI水印false
修改强度0.50
上方扩展1.0
下方扩展1.0
左侧扩展1.0
右侧扩展1.0
超分倍数2
涂鸦模式false
超时秒数180
自动调整尺寸true
api_key

The name "Wanx" is a trap. If you saw this pack and assumed it runs Alibaba's open-weight Wan models locally, like the Wan video checkpoints the community adopted - no. HaoranWanxImageEdit is a client for wanx2.1-imageedit, a cloud image-editing API on Alibaba's Model Studio (the Bailian/DashScope platform). No local weights, no VRAM, no multi-GB model download. Your image leaves your machine, gets edited in Alibaba's cloud, and comes back as a fresh tensor.

In exchange you get one node with ten edit operations - global and local style transfer, instruction editing, mask inpainting, watermark removal, outpainting, upscaling, colorization, line-art-to-image, cartoon-avatar generation. The cost is per-image (about ¥0.14, with a 500-image freebie for new accounts), and be honest about privacy: every image you pipe through here is uploaded to Alibaba. Don't feed it client work.

How it works

Mechanically this is a ComfyUI-native wrapper around DashScope's async image-synthesis endpoint. Your IMAGE tensor is converted to a PNG, base64-encoded into a data URL, and POSTed as a task with the function name, prompt, and any function-specific params. The node then polls the task endpoint every 3–5 seconds - faster early, slower later - until it succeeds or you hit the timeout, downloads the result image(s), and packs them back into a ComfyUI IMAGE tensor. There's retry-with-backoff for transient errors, and the whole flow blocks your queue while it waits - expect roughly ten seconds to a couple of minutes per call.

One nice touch: input images outside the API's 512–4096px window get resized automatically if you leave 自动调整尺寸 on (the default). Off, and an out-of-range image is an error instead.

The inputs that matter

The node's labels are all in Chinese - that's just how the pack ships, don't be put off. You'll mostly live on these:

  • 图像 (IMAGE) - your input, e.g. from a Load Image node.
  • 功能 - the 10-way picker that decides everything. 指令编辑 (instruction editing) is the default and the one you'll reach for most.
  • 提示词 - plain-language instruction. Required for most functions; left blank it defaults for watermark-removal, upscaling, and colorization. The README's tip for inpainting (局部重绘) is worth remembering: describe what should appear in the mask area, don't write "delete X".
  • 蒙版 (MASK, optional) - only used by 局部重绘; white is the region being edited. Pick it up from a mask-painting node. Forget it and the node errors out on purpose.
  • 修改强度 (0–1) - the strength dial for global stylization and instruction editing.
  • The four 扩展 sliders (outpainting) and 超分倍数 (1–4) only do anything for their own functions.

Everything else is set-and-forget: 生成数量 (1–4), 随机种子 + 使用随机种子 (the seed only goes out when the toggle is on and the value is above 0), 添加AI水印, 超时秒数 (default 180s, max 600), plus the optional api_key / api_config inputs. Output is a single 图像 (IMAGE) you can wire to a Save Image or Preview Image node.

Installing and the key

No model files, and the dependency list is refreshingly light - just requests, Pillow, and numpy per requirements.txt. Install via ComfyUI Manager (search "ComfyUI-HaoranWanxImageEdit"), or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/GonDesign/ComfyUI-HaoranWanxImageEdit
cd ComfyUI-HaoranWanxImageEdit
pip install -r requirements.txt

Then restart ComfyUI. You'll find the three nodes under the 昊然 category.

The API key is the one genuinely fiddly step. Set the DASHSCOPE_API_KEY environment variable (best), or paste a key into the node. Grab one from the Bailian console - new accounts get 500 free images. Resolution priority in the code: direct api_key field → api_config loader node → environment variable.

Where people get burned

  • DataInspectionFailed - your prompt or input tripped Alibaba's content-safety filter. Change the input, don't fight it.
  • Timeouts - bump 超时秒数, but honestly if it's slow this often means the queue is backed up; the RPS=2 limit makes batch runs crawl.
  • Result URLs expire after 24 hours - the node downloads them immediately, so this only bites if you hack around it.
  • Missing key - the node raises a clear "API Key未配置" style error pointing you at the console. You need a sk- key, and there's no offline mode.

Coming from local diffusion, this is a different trade: instruction editing took over most mask-free edit jobs by 2026, and this API gives you that and a real masked inpainting path - bit-identical unmasked pixels, which edit models can't promise - for the price of an upload. For one-off fixes it's cheaper than your GPU's electricity; for a batch job at 2 RPS, budget your time.

Category昊然

Inputs (19)

NameTypeDefaultDescription
图像IMAGE
功能COMBO指令编辑10 options: 全局风格化, 局部风格化, 指令编辑, 局部重绘, 去文字水印, 扩图, +4
提示词STRING
生成数量INT11–4
随机种子INT00–2147483647
使用随机种子BOOLEANfalse
添加AI水印BOOLEANfalse
修改强度FLOAT0.500–1
上方扩展FLOAT1.01–2
下方扩展FLOAT1.01–2
左侧扩展FLOAT1.01–2
右侧扩展FLOAT1.01–2
超分倍数INT21–4
涂鸦模式BOOLEANfalse
超时秒数INT18030–600
自动调整尺寸BOOLEANtrue
api_configoptWANX_API
api_keyoptSTRING
蒙版optMASK

Outputs (1)

NameTypeDescription
图像IMAGE