Nodes/NIX ComfyUI Plugin/NIX_ImageComposite
ComfyUI Node

NIX_ImageComposite

NIX_ImageComposite puts your sampled crop where it belongs

By J-ChenX·Created 11 months ago·Updated 11 months ago· 2
NIX_ImageComposite
  • sampled_image
  • pipe
  • original_image
  • IMAGE

NIX_ImageComposite is the second half of the trick that makes regional inpainting actually good: crop the part you want to fix, generate on it at full resolution, then paste only the new pixels back onto the untouched original. This node is the "paste" step. It does nothing flashy, but skip it and you'll be hand-wiring coordinate math for an hour.

It's a NIX pack node, which means the simple stuff ships alongside it: install the pack once and you get this, NIX_MaskCrop, NIX_RotateImage, and a pile of utilities (see "Getting it installed" below).

What it does

You give it a sampled_image (the crop you generated on), a pipe (the bookkeeping blob that came out of NIX_MaskCrop), and optionally an original_image. It reads the crop's coordinates, size, and mask out of the pipe, scales your sampled image up to the crop size with Lanczos, and composites it back so only the masked region replaces the original. Everything outside the mask stays byte-for-byte identical - that's the whole point of mask-based editing, and it's the bit most workflows get wrong.

The output is a single IMAGE. Wire it to a preview or a save node and you're done.

The pipe is worth understanding because it's where all the geometry lives. NIX_MaskCrop stuffs original_image, crop_mask, crop_width, crop_height, crop_X, and crop_Y into it. This node reads those exact keys. So the pipe really needs to come from NIX_MaskCrop - a PIPE_LINE from another pack carries different keys and won't line up. If you already have the untouched original, feed it into original_image; otherwise the node falls back to the copy stored in the pipe at crop time.

Where this fits in a workflow

The pattern is the same one Impact Pack made famous: detect a region, crop it, resample at proper resolution, paste it back. A face that's 80×80 pixels in a 1024×1024 frame gets 80×80 worth of model attention and comes out mangled. Crop it, give the crop its own 1024px generation budget, then composite the good pixels back. NIX_MaskCrop → KSampler → NIX_ImageComposite is that loop in three nodes, and it's exactly the "only-masked at full resolution, then composite" move the inpainting scene converged on.

One habit worth keeping: composite after inpainting, always. Uncomposited multi-pass workflows let the VAE encode/decode cycle degrade the whole frame until the image is mush. This node makes the discipline automatic - the unmasked pixels never pass through the sampler at all.

Getting it installed

The pack is small and dependency-light: numpy and Pillow, both already in any ComfyUI install. No models to download.

  • ComfyUI Manager: open Manager → Install Custom Nodes → search "NIX" (or the pack title "NIX ComfyUI Plugin"). If the search comes up empty, use the Git URL tab and paste https://github.com/J-ChenX/ComfyUI-NIX, then install and restart.
  • By hand:
    cd ComfyUI/custom_nodes
    git clone https://github.com/J-ChenX/ComfyUI-NIX
    
    Restart ComfyUI. You'll find all the NIX nodes under the "NIX" category.

Things that will bite you

  • The pipe is NIX-specific. It's a plain dict with NIX's own keys, so treat it as opaque and only pair it with NIX_MaskCrop.
  • Batch counts get reconciled silently. If your sampled crop batch and mask batch disagree, the node repeats the last image or truncates to match. Fine for most loops, confusing if you're debugging a mismatch.
  • No community to lean on. This pack has essentially zero Reddit/forum footprint as of mid-2026, so when something misbehaves, the source is your best friend - it's a single readable Python file. If the composite lands somewhere unexpected, check the crop_X/crop_Y values in the pipe, because negative coordinates are handled by trimming the source rather than shifting the canvas.

If you just want a dead-simple paste-back without the pipe plumbing, the stock ImageCompositeMasked does the same job with a mask input instead of a pipe. NIX's version wins when you're already using NIX_MaskCrop and want the coordinates to just match.

CategoryNIX

Inputs (3)

NameTypeDefaultDescription
sampled_imageIMAGE
pipePIPE_LINE
original_imageoptIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE