Nodes/ComfyUI-My-Nodes/AI图片处理
ComfyUI Node

AI图片处理

Style, inpaint, upscale, de-watermark — all via URL

By Tagbliton·Created 2 years ago·Updated about a year ago· 11
AI图片处理
    • image
    • url
    api_key
    mode
    image_url
    mask_url
    text

    Ten image-editing operations in one node, all of them running on Alibaba's wanx2.1-imageedit model in the cloud. Style an image globally or regionally, edit by instruction, inpaint with a mask, remove a watermark, expand the canvas, upscale 2x, colorize, turn a doodle into art, or use a reference image as a style guide. You pick from the mode dropdown, paste a URL, and get a finished IMAGE back. This is the node that proves the pack's API-first bet: the equivalent local stack - an edit model plus a mask-based inpaint plus an upscaler - is gigabytes of downloads and a GPU workout. Here it's one request.

    The catch is staring you in the face from the inputs: image_url and mask_url are strings, not image tensors. The Wanx API takes public URLs, so an in-graph image has to become a URL first. That's exactly why this pack ships the "图片转URL(OSS)" node - it uploads your IMAGE and MASK to an Alibaba OSS bucket and hands you the URLs this node wants. Wire the two together and you get the full loop: tensor in, edited tensor out, no local model anywhere.

    How it works under the hood: the node submits an async task to DashScope, polls the task endpoint every couple of seconds until it's SUCCEEDED, downloads the result, and converts it back to an IMAGE tensor. Outputs are image (the edited tensor) and url (the result URL, handy if you want to pass it on or inspect it).

    The modes you'll actually reach for:

    • 指令编辑 (instruction edit) - describe the change in text, no mask needed. The modern way to edit, and it usually nails it.
    • 局部重绘 (local repaint) - the one mode that uses mask_url. Remember the README's warning here: if you get InvalidParameter ... payload.input.mask_image_url, the fix is to convert mask_url from a widget into an input (right-click → convert) rather than typing the URL into the box.
    • 图像超分 (super resolution) - 2x upscale, hard-coded to factor 2.
    • 扩图 (expand/outpaint) - stretches the canvas 1.5x in each direction.
    • 去水印 (remove watermark), 图像上色 (colorization), 线稿生图 (doodle to image), 垫图 (style reference) - all one-click.

    Only api_key, mode, and image_url are required; text is a multiline box for the prompt, and mask_url only matters in local-repaint mode.

    Install: ComfyUI Manager → "ComfyUI-My-Nodes", or git clone https://github.com/Tagbliton/ComfyUI-My-Nodes into custom_nodes and restart. Standard pack deps from requirements.txt (dashscope, openai, requests, numpy, pinned urllib3==1.26.20).

    Gotchas. This is an async job, so a run can take 30 seconds to a few minutes depending on the server queue - don't panic if nothing happens instantly. Cost is real and metered per job, so the upscale/expand modes are cheap fun but not free. And the usual key problem: DashScope needs a real-name-verified mainland China account, so Invalid Api-Key out of the gate is likely an account problem. Finally, if the result looks wrong, check that your source image is a public URL - a private or signed URL that expires mid-job is a classic silent failure here.

    Category我的节点

    Inputs (5)

    NameTypeDefaultDescription
    api_keySTRING
    modeCOMBO10 options: 全局风格化, 局部风格化, 指令编辑, 局部重绘, 去水印, 扩图, +4
    image_urlSTRING
    mask_urloptSTRING
    textoptSTRING

    Outputs (2)

    NameTypeDescription
    imageIMAGE
    urlSTRING