Nodes/ComfyUI Layer Style/LayerMask: RemBgUltra
ComfyUI Node Runs on cloud

LayerMask: RemBgUltra

RemBg Ultra (Layer Style)

By chflame163·Created 3 years ago·Updated 5 days ago· 3,113
LayerMask: RemBgUltra
  • image
  • image
  • mask
â—„detail_range8â–º
â—„black_point0.01â–º
â—„white_point0.99â–º
â—„process_detailtrueâ–º

RemBg Ultra is Layer Style's one-click background remover, and the "Ultra" is the part that matters. Plenty of nodes will run a segmentation model and hand you a mask; the frontier of background removal moved years ago from "can it find the subject" to "can it survive hair, fur, and semi-transparent edges," and that's exactly where a raw model mask falls apart. RemBg Ultra bolts an edge-refinement stage onto the segmentation so the cutout keeps its flyaway strands instead of leaving you a helmet-haired blob. If your removed backgrounds look crunchy around the hair, this is the node that fixes it.

Mechanically it's two steps in one. First a segmentation model predicts a rough foreground mask. Then, when process_detail is on, the node runs a matting-style refinement around the mask's edges (the "Ultra" pass - a guided/trimap-free matting step) that recovers fine boundary detail the model painted over. The model file downloads automatically the first time you run the node, so the initial execution stalls while it fetches weights, then caches them for good.

The inputs you'll actually touch:

  • process_detail - the master switch for the Ultra refinement. On (default) gives you the good edges but costs time and VRAM; off gives you the fast, raw model mask. Turn it off for quick previews or batch throughput, on for the final.
  • detail_range - how wide a band around the edge the refinement works on (1–256, default 8). Bump it up for fuzzy subjects (hair, fur); keep it low for clean, hard-edged objects.
  • black_point and white_point - the levels on the mask. Raise black_point to force marginal pixels fully transparent (kills background haze), lower white_point to force near-white pixels fully opaque (fills pinholes in the subject). These are your cleanup dials when the mask is close but not quite.

Two outputs: image (the subject with the background removed) and mask (the alpha). Feed the mask to Image Combine Alpha for a transparent PNG, or composite the image over a new background.

Honest context on where this sits: RemBg Ultra is convenient and its Ultra refinement is genuinely good, but background removal is the most commoditized operation in the ecosystem and it is not a settled race. The Ultra edge pass is the real value here - the underlying segmentation model is one of several the community argues about, and BiRefNet-based nodes or InSPyReNet win specific material. If a cutout matters, it's worth testing more than one remover on your three hardest images; the quality ceiling on plain segmentation hasn't moved much lately, so the refinement stage is doing the heavy lifting. And one thing the whole ecosystem agrees on: do not background-remove your LoRA training set - it teaches the model to generate blank backgrounds. Cutting out photos for compositing is the right job for this node; cleaning a dataset is not.

Install is via the ComfyUI Layer Style pack. ComfyUI Manager: search "ComfyUI Layer Style," install, restart. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/chflame163/ComfyUI_LayerStyle, then pip install -r requirements.txt in the ComfyUI environment and restart. Because this is a model-backed node, expect a model download on first run - if the node hangs or errors the first time, it's usually fetching weights (or failing to reach the host), so check your connection and let the first run finish.

The pack-level gotcha bites hardest on the mask nodes: Layer Style is dependency-heavy, and the mask/model nodes lean on packages like transformers and the matting libraries, so a version conflict is the classic cause of the whole pack showing "import failed" in the Manager - which makes every node, RemBg Ultra included, disappear at once. (The author has moved some of the heavier, model-dependent nodes into a companion pack, so if you rely on those, keep both updated together.) If this node is missing or red, reinstall the pack, use "Try Fix," and reinstall the requirements into ComfyUI's actual Python environment; for a red/import-failed node specifically, a mismatched transformers version is the first thing to check.

Category😺dzNodes/LayerMask

Inputs (5)

NameTypeDefaultDescription
imageIMAGE—
detail_rangeINT81–256—
black_pointFLOAT0.010.01–0.98—
white_pointFLOAT0.990.02–0.99—
process_detailBOOLEANtrue—

Outputs (2)

NameTypeDescription
imageIMAGE—
maskMASK—