Flow Matching Stage Merge
The tiny node that puts your custom-sampled latent back on the flow path
- skip_latent
- sampled_latent
- latent
FlowMatchingStageMerge is the last piece of the pack's modular upscale workflow, and it's barely a node at all - one blend operation, three inputs, one output. But it's the piece that makes the modular path work, so it's worth knowing what it's actually doing.
Here's the setup. In the full FlowMatchingStage node, the flow goes: upscale, re-noise, sample, then blend the freshly sampled result back toward the pre-sampler latent so you don't lose composition. When you split that apart for ComfyUI's Custom Sampler nodes, FlowMatchingStagePrep gives you skip_latent (the upscaled latent before sampling) and presampler_latent (upscaled plus re-noised). You sample the presampler latent yourself, and then you have two latents in hand: what you started from and what your sampler produced. Merge is the reconciliation step.
skip_blend is the entire decision: 0 = all sampled latent, 1 = all skip latent. The pack's guidance for a stage ladder is high early (lean on the pre-sampler latent to hold structure) and low late (let the sampled result take over) - the same exponential taper the all-in-one node automates with skip_blend_start/skip_blend_end. Set it to taste; 0.5 is the neutral default.
Inputs:
skip_latent- fromFlowMatchingStagePrep(the upscaled latent before sampling).sampled_latent- from ComfyUI'sSamplerCustom/SamplerCustomAdvanced.skip_blend- the blend weight.
Output. A single latent, ready for the next stage's Prep, a VAE Decode, or anything else downstream. That's it. No model, no conditioning, no sampler settings - it can't do anything to your prompt or your seed, and that's the point. It's the "merge" in a "Prep → sample → Merge" chain, and it keeps the modular path's cache-friendly behavior: unchanged earlier stages short-circuit on re-runs.
Install. Part of ttulttul/ComfyUI-FlowMatching-Upscaler. ComfyUI Manager, search "ComfyUI-FlowMatching-Upscaler", install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/ttulttul/ComfyUI-FlowMatching-Upscaler
Deps are numpy, torch, einops, aiohttp - all already in ComfyUI, no model downloads. Registers under latent/upscaling.
Gotchas. It's easy to feed it the wrong latent: sampled_latent has to be your Custom Sampler's output, and skip_latent has to come from Prep - swap them and your blend will silently be a weighted average of two latents that never belonged together (and if resolutions disagree, expect a shape error from the sample tensor check). Also remember the modular path drops the LOW_VRAM fallback and dilated refinement that the integrated FlowMatchingStage keeps. If this is your first go at the modular route, wire Prep's seed into your Custom Sampler's noise seed before you start blaming Merge for non-determinism.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| skip_latent | LATENT | Skip latent from FlowMatchingStagePrep (upscaled latent before sampling). | |
| sampled_latent | LATENT | Sampled latent output from ComfyUI's Custom Sampler nodes. | |
| skip_blend | FLOAT | 0.500–1 | Skip blend weight (0 = all sampled, 1 = all skip latent). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |