ComfyUI Node

自动抠图

The two-line way to cut a subject out of any image

By MoJIeAIGC·Created about a year ago·Updated 17 days ago· 50
自动抠图
  • image
  • mask
  • output
seed0

The Chinese name on the canvas is 自动抠图, which translates as "auto cutout," and that's the whole job: you feed it an image, it phones home to MojieAI's hosted matting model (auto_koutu_1.0), and hands you back the same image with the background knocked out. No model file to download, no VRAM burned, no rembg import to fight. If you build product shots or composite anything over a new background, this is the step that used to cost you a segmentation model and fifteen minutes of fiddling.

It's worth knowing what you're reaching for, though. This is an API node, which means the actual matting runs on Mojie's servers, not your GPU. The model it calls is proprietary and you can't tune it - no threshold slider, no "hair mode." That's the trade every wrapper in this pack makes, and for background removal specifically it matters, because cutout quality is a solved problem right up until it isn't. The KB's background-removal essay makes the point well: the frontier isn't "can it find the subject," it's hair, fur, and semi-transparent material, and no hosted model is magically past that.

How it works

The node is gloriously thin under the hood. Your image gets base64-encoded, POSTed to https://www.mojieaigc.com/v1/completions with your key, and the returned image URL is downloaded and converted back to a tensor - converted as RGBA, which is the detail that matters. The output carries an alpha channel, so wire it into something that respects transparency (a composite or overlay node) rather than a plain preview that flattens the checkerboard away. If you hand it the optional mask, it's merged in as the alpha so the cutout stays inside the region you drew. The author's own doc is refreshingly blunt: uploads cap at 10MB, and "just use it, no parameters - with a mask it cuts within the mask's range."

The only inputs that exist are image (required), seed (which is basically noise here - you're not diffusing locally), and mask (optional). Output is a single output IMAGE.

Installing it

This node ships inside comfyui-MJAPI-party, MojieAI's all-in-one API pack:

cd ComfyUI/custom_nodes
git clone https://github.com/MoJIeAIGC/comfyui-MJAPI-party.git

Or search "mojieapi_party" in ComfyUI Manager. Then register at mojieaigc.com, copy your API key into config.ini at the pack root (leave BASE_URL alone), and restart ComfyUI. The requirements.txt pulls in requests, aiohttp, toml, and opencv-python - opencv is the one genuinely chunky extra, everything else ComfyUI already has. No model files, period.

Common issues

  • A red image comes out with error text on it. That's the node's error channel: it renders HTTP failures as a red placeholder. A 401 means your key or balance - the 403 message literally says "check balance or token permissions," which is the real gotcha, because these are metered API calls you pay for per use.
  • Edges look rough on hair. This is the eternal background-removal problem, not a bug in the node. If hair quality is what you need, a local BiRefNet is still the community default and beats most hosted matting - you lose the zero-VRAM convenience but gain control.
  • Nothing shows up because the file is over 10MB. Downscale before you throw it in.

One honest caveat that applies to every node in this pack: it's a third-party wrapper that holds your key and sends your images over the network, and that exact shape of node has been weaponized once in this ecosystem (the ComfyUI_LLMVISION incident). Mojie is a small, actively-maintained vendor with a real service behind it - but if you're paranoid, know what the trade is before you paste a key.

Category🎨MJapiparty/Tools_api

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
seedINT0
maskoptMASK

Outputs (1)

NameTypeDescription
outputIMAGE