Nodes/ikki Pack/Composite Back 🕸️
ComfyUI Node

Composite Back 🕸️

The paste-back step nobody thinks about, until a seam shows

By RedsAnalysis·Created 2 months ago·Updated about a month ago· 0
Composite Back 🕸️
  • original_image
  • refined_crop_image
  • crop_mask
  • crop_data
  • final_image
composite_modemask_blend
blend_feather16

Every automatic detailer is the same four-step loop: detect a region, crop and upscale it, re-render it, then paste it back. The first three steps get all the attention. The fourth one is where a good detail pass turns into a visible rectangular patch that ruins the image anyway. IkkiCompositeBack is the paste step in the Ikki pack's detailer pipeline - the node that takes your refined crop and stitches it back into the original so the seam mostly disappears.

The mechanism is straightforward and worth understanding because it's why this node exists at all. A naively copied rectangle has hard edges; the crop you re-rendered rarely matches the original pixel-for-pixel at the boundary, so you get a visible border and a slight color discontinuity. CompositeBack avoids that by alpha-blending: it reads the crop's position and size from crop_data, and blends the refined pixels in against the original pixels using a mask, with a Gaussian feather on the blend.

Inputs

  • original_image - the full image before the detail pass.
  • refined_crop_image - what your sampler produced for the crop region.
  • crop_mask - the mask from the detailer, used to weight the blend (in mask_blend mode).
  • crop_data - the CROP_DATA tuple from IkkiDetailerProcessor or IkkiMaskEditor. This is what tells the node where in the original the crop belongs; don't try to fake it by hand.
  • composite_mode - mask_blend (default) blends using the mask, so edges that hug the subject blend along the shape. box_blend treats the whole box as a uniform blend - faster, and fine when the mask is loose.
  • blend_feather (16) - the Gaussian sigma for the seam. Zero gives you a hard paste; very high values start smearing the refined region into the surroundings.

The single output is final_image - the composited full image, ready for upscaling or saving.

Where it sits

This is node 5 of the pack's detailer chain: IkkiUltralyticsDetector → IkkiDetailerProcessor → IkkiMaskEditor (optional) → IkkiDetailerKSampler → IkkiCompositeBack. If you're coming from Impact Pack, this plays the role of SEGSPaste - it's the "put the pieces back" node.

Common issues

  • The refined crop lands in the wrong place - your crop_data doesn't match the crop you actually refined. Keep the data flowing straight from the processor to the sampler to this node without rerouting through anything that might transform it.
  • Visible seam - raise blend_feather, and check whether the crop's mask is actually tight to the subject. A bbox-only mask will show rectangular edges no matter the feather; the KB's detailing essay makes the same point about bbox vs segmentation detectors.
  • Color pop at the boundary - the crop was re-rendered under slightly different light. That's a color-matching job (the pack's IkkiColorMatching exists for exactly this), not a blending problem.

One note on the pack itself: the README only documents six nodes and doesn't mention this pipeline at all - the detailer nodes exist in the code and are versioned (2.1.0) but effectively undocumented. If the pack's own workflow examples don't cover the chain, you're learning it from the node names. It works, but budget an evening.

Install the pack through ComfyUI Manager (search "ikki") or clone https://github.com/RedsAnalysis/comfyui-ikki-pack into custom_nodes, then restart. This node itself needs nothing beyond core ComfyUI - no extra pip packages.

CategoryIkki/Detailer Pipeline

Inputs (6)

NameTypeDefaultDescription
original_imageIMAGE
refined_crop_imageIMAGE
crop_maskMASK
crop_dataCROP_DATA
composite_modeCOMBOmask_blend2 options: mask_blend, box_blend
blend_featherINT160–128

Outputs (1)

NameTypeDescription
final_imageIMAGE