Nodes/ComfyUI-JNK-Tiny-Nodes/ToonOut Remove BG JNK
ComfyUI Node

ToonOut Remove BG JNK

A BiRefNet fine-tune that cuts out cartoon art

By Aljnk·Created about a year ago·Updated 12 months ago· 3
ToonOut Remove BG JNK
  • image
  • rgba
  • rgb
  • mask
model_name
background_type
custom_color#FFFFFF

If you've ever tried to remove the background from a clean cartoon or toon-style render with a generic rembg node, you know the failure mode: the subject survives but the edges look like a cheap sticker got cut out with shaky scissors. ToonOut Remove BG is the fix for that specific case. It wraps a fine-tuned BiRefNet checkpoint - birefnet_finetuned_toonout.pth, from joelseytre/toonout on HuggingFace - that was trained on exactly the flat-color, hard-edge art style where generic saliency models stumble.

Context worth having: BiRefNet is the model that quietly replaced rembg's u2net as the default cutout in this ecosystem, mostly because it survives hair, fur and fabric mesh that u2net always mangled. It's MIT-licensed, and the fine-tune you're running here inherits that. For toon images with solid backgrounds, this node is usually a one-click win - no fiddling with prompt masking or threshold sliders.

How it works

Under the hood the node loads the base BiRefNet architecture from ZhengPeng7/BiRefNet via HuggingFace transformers (with trust_remote_code), then swaps in the fine-tuned toonout state dict. It resizes your image to 1024x1024 internally, runs the segmentation, and produces a soft mask. From that mask it builds three outputs: the cutout with alpha, the cutout composited onto a background color, and the raw mask.

Inputs and outputs

  • image - anything ComfyUI considers an IMAGE; batch-friendly.
  • model_name - dropdown of .pth/.pt/.bin/.safetensors files under ComfyUI/models/RMBG/.
  • background_type - white, black, or custom.
  • custom_color - hex like #FFFFFF, used when background_type is custom.

Outputs:

  • rgba - the cutout with transparency.
  • rgb - the cutout composited onto your chosen background.
  • mask - the raw alpha mask, if you want it for compositing or inpainting yourself.

Installing it (the model file is the whole ballgame)

Install the pack, then get the weights, because without them the node does nothing useful:

# pack install
cd ComfyUI/custom_nodes/
git clone https://github.com/Aljnk/ComfyUI-JNK-Tiny-Nodes.git

# model file - put it exactly here
# ComfyUI/models/RMBG/ToonOut/birefnet_finetuned_toonout.pth

Download birefnet_finetuned_toonout.pth from the HuggingFace link above and drop it in ComfyUI/models/RMBG/ToonOut/. On first run the node also downloads the base BiRefNet from HuggingFace, so give the first queue a minute. requirements.txt for the pack lists opencv, pygame and google-genai; ToonOut itself leans on transformers and torchvision, which ship with ComfyUI - no extra pip install needed for this node specifically.

Where people get burned

Missing model file = silent-ish failure. If the weights aren't there, the node logs Model not found and returns an empty 64x64 mask plus your original image back - not a hard error, so you might not notice until downstream looks wrong. Check the console after first run.

Fixed 1024 resolution. Everything is resized to 1024x1024 before inference, so a 4K source loses exactly the fine edge detail you were trying to preserve - the same lesson as every BiRefNet variant (the HR and dynamic weights exist precisely because of this). Fine for typical 1024-ish toon renders, wrong tool for poster-size scans.

It's toon-tuned, not general. On photorealistic subjects or fine hair this fine-tune underperforms the general BiRefNet checkpoints. Use it where its name says - toon art - and reach for ComfyUI-RMBG or core background-removal nodes for photos. Community chatter on exactly this use case ("cartoony images with sharp edges") keeps landing on BiRefNet-family local models, and this node is the toon-flavored member of that family.

Category🔧 JNK

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
model_nameCOMBO1 options: birefnet_finetuned_toonout.pth
background_typeCOMBO3 options: white, black, custom
custom_colorSTRING#FFFFFF

Outputs (3)

NameTypeDescription
rgbaIMAGE
rgbIMAGE
maskMASK