Light Wrap Composite (Image)
Make a keyed subject actually live in its background
- foreground
- background
- matte
- image
- mask
- light_wrap_info
You know when a subject is composited onto a new background and it just... floats? The giveaway is the edge: there's a hard boundary with no light from the new environment touching the subject. Light Wrap Composite is the MKRShift node that fixes exactly that. It takes your foreground, background, and matte, and wraps a little of the background's light around the subject's edge - the classic compositing trick that makes a keyed person feel lit by the scene they were pasted into rather than pasted onto it.
It's in MKRShift Nodes/VFX/Composite, and it's the pack's answer to one of the most common compositing questions: "I cut this person out and it still doesn't look real." The KB's post-processing doc makes the same point the node implements: a composited element has to sit in the new background's light, and a deterministic edge treatment is the honest way to do it - no re-roll, no diffusing the whole image.
How it works
The matte defines the subject's edge. The node erodes/dilates around that edge (wrap_radius, default 18) and samples the background's color just outside the matte, then composites that sampled background light back onto the edge of the foreground. Four knobs shape the result:
wrap_strength(0.65) - how much of that background light bleeds onto the subject edge.edge_bias(0.55) - whether the wrap favors the inner or outer edge of the matte. This is the "does the light hug the silhouette" control.inside_holdout(0.75) - how much the wrap is kept out of the subject's interior. High values protect the face/body from contamination; lower values let more spill creep inward for a softer, more luminous edge.background_blur(0) - blurs the background first. A real out-of-focus background wrapped sharp looks wrong, so matching your background's defocus is a big deal; this is where you do it in one node.wrap_gamma(1.0) - the tonal curve of the wrap itself.
The result is blended over the foreground with mix, and the optional... actually, note the signature: this node requires foreground, background, and matte - no optional mask input, because the matte is the mask. It's the one node in the x1 finishing family that's a true three-input composite rather than a single-image effect.
Outputs
image is the wrapped composite (the finished shot), mask is the edge region that received the wrap (handy for a sanity check or to composite the wrap separately), and light_wrap_info reports the resolved settings.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes
then restart, or search MKRShift_Nodes in ComfyUI Manager. No models, no pip requirements.
The classic mistake is a featherless, hard matte: light wrap can't save a key that's a pixel-sharp cutout. Feather your matte a bit before it hits this node, keep inside_holdout high so skin doesn't pick up the background's color, and if the edges look "milky," your wrap_strength is past 0.8 - the wrap should read as light on the subject, not a blurry halo around it.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| foreground | IMAGE | — | |
| background | IMAGE | — | |
| matte | MASK | — | |
| settings_json | STRING | {"wrap_radius":18.0,"wrap_strength":0.65,"edge_bias":0.55,"inside_holdout":0.75,"background_blur":0.0,"wrap_gamma":1.0,"mix":1.0} | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |
| light_wrap_info | STRING | — |