Nodes/CRT-Nodes/Isolate Output (CRT)
ComfyUI Node

Isolate Output (CRT)

Composite your enhanced subject back onto the original canvas

By PGCRT·Created 2 years ago·Updated a day ago· 132
Isolate Output (CRT)
  • enhanced_images
  • pipe
  • images_batch
  • enhanced_images_masked
smooth_range5
expand_mask32
blur_radius64.0
border_blending0.20
color_match_methodmkl
color_match_strength1.00
resize_back_to_originalfalse

Subject isolation is a two-act play: cut the subject out, enhance it, put it back. CRT's CRT_IsolateInput handles the cutting and gives you a pipe; this node is the putting-back - CRT_IsolateOutput takes your enhanced subject and the original canvas and composites them so the improved subject sits back in the scene without the telltale pasted-on look. If you've ever face-enhancement'd a subject and watched the background go blurry or the seam glow, this is the node that fixes the seam.

The mechanism

It's pure compositing - no SAM inference happens here. The pipe from CRT_IsolateInput carries the pre-computed face masks from the original crop, and this node blends the enhanced_images back through them. The bits that matter:

  • smooth_range (default 5) and blur_radius (default 64) - feather the mask edge so the swap isn't a hard cut.
  • expand_mask (default 32) - grow the masked region so enhancement bleeds a little past the boundary and there's no halo.
  • border_blending (default 0.2) - how much the composited edge mixes with the background.
  • color_match_method - here's where the pack's color-matcher dependency earns its keep: none, mkl, hm, reinhard, mvgd, or the two-pass hm-mkl-hm / hm-mvgd-hm. If your enhanced subject's colors don't match the original lighting, this is the control that fixes it, and color_match_strength (default 1) dials the correction in.
  • resize_back_to_original - default off, and the tooltip tells you why: with it off, the node upscales the original canvas to keep the enhanced crop's detail instead of shrinking your work back down. Leave it off when the enhanced version has more resolution than the source.

Outputs

  • images_batch - the composited result, subject enhanced and back in place.
  • enhanced_images_masked - the enhanced crop with the mask applied, if you want the cut-out alone for inspection or further processing.

What you need to know before wiring it

This is the output half of a specific pair. It expects a CRT_ISOLATE_PIPE from CRT_IsolateInput, and that input node has its own prerequisites: it's SAM 3.1-based, so it needs a recent ComfyUI with comfy.ldm.sam3 support (PR #13408 or later) and the sam3.1_multiplex_fp16.safetensors checkpoint in models/checkpoints/. The good news: that's the hard part, and it's the input node's job. This node just needs the pipe and the enhanced images.

Gotchas

  • Batch sizes must line up. The compositor auto-trims longer inputs to the shortest batch, which is convenient - but if your enhanced pass dropped frames, you'll get mismatched outputs without a warning in the UI.
  • Color match is the quality lever. With none, the seam can look wrong even with perfect masks. Try mkl first; the hm-*-hm variants are there when a single pass isn't enough.
  • resize_back_to_original off is usually right - but it costs VRAM and time if the canvas upscale is large.

Install CRT-Nodes via ComfyUI Manager (CRT-Nodes) or git clone https://github.com/plugcrypt/CRT-Nodes.git into custom_nodes, install requirements.txt, restart, and make sure your ComfyUI build has SAM3 support before relying on the Isolate family.

CategoryCRT/Utils/Isolate

Inputs (9)

NameTypeDefaultDescription
enhanced_imagesIMAGE
pipeCRT_ISOLATE_PIPE
smooth_rangeINT50–32
expand_maskINT320–100
blur_radiusFLOAT64.00–100
border_blendingFLOAT0.200–1
color_match_methodCOMBOmkl7 options: none, mkl, hm, reinhard, mvgd, hm-mkl-hm, +1
color_match_strengthFLOAT1.000–1
resize_back_to_originalBOOLEANfalseIf disabled, upscale the original canvas to keep enhanced crop detail

Outputs (2)

NameTypeDescription
images_batchIMAGE
enhanced_images_maskedIMAGE