K2 Edit Composite
The last, defensive step of a regional edit
- source
- edited
- mask
- image
- mask
K2 Edit Composite is the finishing node of the regional-editing pipeline in the K2 Lab suite of comfyui-FVMtools. It takes the image you edited and composites it back over your original source using a feathered mask - and the detail that makes it worth its own node is that pixels outside the mask are copied byte-exact from the source. A regional edit can never degrade the rest of the image through VAE round-trip loss, because the untouched parts are never touched at all.
That's the masked-inpainting superpower the whole edit-model wave can't match: bit-identical unmasked pixels. K2 Edit Latent does the latent-side editing, and this node does the pixel-side protection that makes the "only the box changed" promise real.
The inputs
source- the original image. Everything outside the mask is copied from here unchanged.edited- the result of the edit pass (typically your sampled + VAE-decoded output).mask- where the edit is allowed. Connect theedit_maskoutput of K2 Edit Latent; that's its intended pairing.composite_feather- the pixel-space blend width (default 48). Narrower than the latent feather on purpose: the latent feather blends during denoising, this one softens the pixel boundary afterward.strength- opacity of the edit, 0..1. 1 is a full edit, 0 returns the source. A strength between is a manual "tone it down" dial, which is occasionally exactly what a too-strong regional change needs.
Outputs: image (the composited result) and mask (the same mask passed through, handy for chaining or inspection).
The full edit chain
IMAGE → K2 Edit Latent → K2 Regional Sampler → VAE Decode → K2 Edit Composite → Save
Start at low denoise, 64 px latent feather, 48 px composite feather. If a seam shows up, the author's guidance is to widen a feather or enlarge the box rather than raise denoise - seams on regional edits are usually a boundary problem, not a strength problem.
Install
Same as the whole pack:
cd ComfyUI/custom_nodes
git clone https://github.com/ping1979ping/comfyui-FVMtools
Restart ComfyUI, find it under FVM Tools/K2. No extra dependencies.
It's a small node with a small job, and it's easy to underrate. Skip it and paste the decoded edit over the source with a generic composite node and you'll see the difference: the generic node blends everything, so the parts you never asked to change come back slightly different. This node exists specifically so that doesn't happen.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| source | IMAGE | Original image — everything outside the mask is copied from here unchanged. | |
| edited | IMAGE | Result of the edit pass. | |
| mask | MASK | Where the edit is allowed (K2 Edit Latent output). | |
| composite_feather | INT | 480–512 | Pixel-space blend width. Narrower than the latent feather on purpose. |
| strength | FLOAT | 1.000–1 | Opacity of the edit. 0 returns the source. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |