Nodes/Skoogeer-Noise/Latent Channel Merge
ComfyUI Node

Latent Channel Merge

Surgical Feature Transfer Between Two Latents

By ttulttul·Created 9 months ago·Updated 3 months ago· 14
Latent Channel Merge
  • destination
  • source
  • mask
  • latent
seed0
selection_modeall
selection_fraction1.00
selection_count0
selection_orderhighest
selection_indices
blend_strength1.00

Latent space is a stack of feature channels, and different channels carry different things - some encode broad structure, some carry texture, some carry color. Latent Channel Merge exploits that: it takes a source latent, picks a subset of its channels, and blends those channels into a destination latent. It's feature transfer with a scalpel instead of a sledgehammer, which makes it one of the more interesting latent-editing nodes in the Skoogeer-Noise pack.

Concretely: decode two images, re-encode, and you can give image B's composition the texture channels of image A without collapsing into a generic mix - because you only moved the channels you chose. The selection logic is where the power lives. "top_variance" picks the most active channels, "top_roughness" picks the ones with the most fine detail (texture carriers), "random" and "indices" let you just grab channels, and "all" is the kitchen sink.

How it works

The node measures whatever selection metric you asked for on the source latent, picks the channels, and computes destination + blend_strength * (source - destination) on those channels - a standard blend where 0 keeps the destination, 1 takes the source outright, and values outside [0,1] extrapolate. An optional mask confines the whole operation spatially. The selection metrics are measured on the source, so "top_variance" means the channels where the thing you're importing from is most active.

The inputs that matter

  • destination - what you're blending into.
  • source - where the channels come from.
  • selection_mode - all, random, top_variance, top_roughness, or indices.
  • blend_strength - how hard the selected channels push. 0.3–0.7 is the sweet spot for subtle transfer.
  • seed - only matters in random mode.

Output is a LATENT.

Installing it

Part of Skoogeer-Noise. Manager → search "Skoogeer-Noise", or:

cd ComfyUI/custom_nodes
git clone https://github.com/ttulttul/Skoogeer-Noise

Restart ComfyUI. Deps are the usual torch, numpy>=1.26, einops, pyyaml>=6.0.3; no downloads beyond the pack.

Common gotchas

Batch shapes must line up - the source and destination latents need compatible layouts, or the blend will error. And blend_strength outside [0,1] is genuinely useful but genuinely dangerous: extrapolating past 1 can blow channels out of their normal range and produce latents that decode to garbage until you dial it back. Start conservative, decode a preview, iterate. If you're blending latents at different resolutions, don't - decode, match sizes, re-encode first. This is a "test on stills before you commit to a batch" node.

Categorylatent/channel

Inputs (10)

NameTypeDefaultDescription
destinationLATENTLatent to blend into (destination).
sourceLATENTLatent providing channels to blend (source).
seedINT00–18446744073709550000Seed for deterministic channel selection when selection_mode=random.
selection_modeCOMBOallHow to choose which source channels to blend.
selection_fractionFLOAT1.000–1Fraction of channels to select when selection_count is 0.
selection_countINT00–4096Exact number of channels to select (overrides selection_fraction when >0).
selection_orderCOMBOhighestWhether to pick high or low variance/roughness channels.
selection_indicesSTRINGComma-separated channel indices to select when selection_mode=indices.
blend_strengthFLOAT1.00-4–4Blend strength for selected channels (0=none, 1=full, >1 or <0 allowed).
maskoptMASKOptional mask to limit the merge to masked areas.

Outputs (1)

NameTypeDescription
latentLATENT