Haoran 通义万相图像编辑
Ten image edits on a paid cloud API — no GPU, no local model, just a key
- 图像
- api_config
- 蒙版
- 图像
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.
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| 图像 | IMAGE | — | |
| 功能 | COMBO | 指令编辑 | 10 options: 全局风格化, 局部风格化, 指令编辑, 局部重绘, 去文字水印, 扩图, +4 |
| 提示词 | STRING | — | |
| 生成数量 | INT | 11–4 | — |
| 随机种子 | INT | 00–2147483647 | — |
| 使用随机种子 | BOOLEAN | false | — |
| 添加AI水印 | BOOLEAN | false | — |
| 修改强度 | FLOAT | 0.500–1 | — |
| 上方扩展 | FLOAT | 1.01–2 | — |
| 下方扩展 | FLOAT | 1.01–2 | — |
| 左侧扩展 | FLOAT | 1.01–2 | — |
| 右侧扩展 | FLOAT | 1.01–2 | — |
| 超分倍数 | INT | 21–4 | — |
| 涂鸦模式 | BOOLEAN | false | — |
| 超时秒数 | INT | 18030–600 | — |
| 自动调整尺寸 | BOOLEAN | true | — |
| api_configopt | WANX_API | — | |
| api_keyopt | STRING | — | |
| 蒙版opt | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 图像 | IMAGE | — |