Latent Hybrid Inverter (Qwen)
Why Not Both? This Node Blends Creative Model-Inversion With a Stable Noise Anchor
- model
- latent_image
- positive
- LATENT
The standalone QwenRectifiedFlowInverter makes you pick a lane: model-guided re-noising that keeps your structure, or the plain Gaussian noise a sampler was literally trained to expect. Latent Hybrid Inverter is the "why not both" answer. It runs the inverter and a forward-diffusion anchor pass, then blends the two latents with SLERP - spherical linear interpolation, the shortest path along the hypersphere. One node, two philosophies of adding noise, and a single slider that slides between them.
It's the node to reach for when you've burned an afternoon chasing the perfect img2img start latent on a flow model and just want a sane default that doesn't fall apart. The README's quickstart is literally three nodes: VAE Encode → this → sample at denoise = strength. No manual sigma matching, no second graph.
How it works
Internally it does two passes with the same model and steps:
- The inverter pass - it instantiates the pack's
QwenRectifiedFlowInverternode and runs it, walking your clean latent up the schedule tostrengthwith velocity amplification and perturbation applied. That's the creative side. - The forward-diffusion anchor - it builds a KSampler for the model, reads the sigma at the step matching
strength, and adds pure Gaussian noise at exactly that sigma, seeded byforward_diffusion_seed. That's the "perfect" anchor: mathematically the starting latent a sampler expects, stable but blind to your image's content.
Then SLERP blends them. blend_factor is the whole game:
0.0→ 100% forward diffusion: stable, predictable, generic.1.0→ 100% inverter: creative, structure-faithful, occasionally off the rails.- in between (default 0.5) → a weighted in-between that borrows the anchor's stability and the inverter's faithfulness.
The defaults tell you a lot about the design. Where the bare inverter ships with velocity_amplification = 0 and velocity_perturb_strength = 0, the hybrid ships 1.0 and 0.2 - it expects the creative pass to be spicy, because the stable anchor keeps the blend from drifting into mush. That's the design philosophy in one line: the creative pass gets to be creative because it's tethered.
The inputs that matter
blend_factor- the knob you'll actually turn. The tooltip is refreshingly honest: "0.0 = 100% Forward Diffusion (Stable), 1.0 = 100% Inverter (Creative)".strength(default 0.5) - the target noise level, used by both passes. Set it to 0 and the whole node short-circuits to passthrough.steps(default 20) - the integration budget for both passes.inverter_seedandforward_diffusion_seed- two independent seeds, one per pass. Same pair of seeds = reproducible blend.internal_precisionandnormalize_output- passed straight through to the inverter stage;force_float32andenableare the safe answers.
Output is one LATENT, and it handles the 4D/5D shape mismatch automatically, so video latents work without you thinking about it.
Install
Identical to its pack-mate. ComfyUI Manager → search "Qwen Rectified Flow Tools" → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/ttulttul/ComfyUI-FlowMatching-Inverter
# then restart ComfyUI
No model downloads, no extra deps, same rule as every node in this pack: feed it a flow-matching checkpoint (Qwen-Image, Flux, Wan, HunyuanVideo), not an SDXL-style epsilon model.
Gotchas
- It costs roughly two passes of the UNet. A hybrid at 20 steps is about twice the work of a single denoise run. On Qwen-Image's 20B transformer that's real wall-clock time - budget for it.
blend_factor = 1.0with the aggressive defaults can drift hard. That's the creative setting working as intended, not a bug. Want faithfulness? Slide toward 0, not toward 1.- NaN? Same fix as the base node:
internal_precision = force_float32, then ease off the amplification/perturbation. - Keep your sampler's
denoiseequal tostrength. The node sets the noise level; the sampler has to meet it there or the blend was pointless.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | UNet model used for both inversion and diffusion passes. | |
| latent_image | LATENT | Latent tensor to invert and re-noise. | |
| positive | CONDITIONING | Positive prompt conditioning that guides both passes. | |
| steps | INT | 201–1000 | Solver steps executed for inversion and forward diffusion. |
| strength | FLOAT | 0.500–1 | Strength for both inversion and forward diffusion. The target noise level. |
| blend_factor | FLOAT | 0.500–1 | 0.0 = 100% Forward Diffusion (Stable), 1.0 = 100% Inverter (Creative) |
| inverter_seed | INT | 00–18446744073709550000 | Seed for the creative, perturbed inversion process. |
| forward_diffusion_seed | INT | 10–18446744073709550000 | Seed for the stable, 'perfect' noise anchor. |
| velocity_amplification | FLOAT | 1.00-0.9–2 | Deterministically scales the predicted velocity each step. |
| velocity_perturb_strength | FLOAT | 0.200–5 | Random velocity noise level for the inverter stage. |
| internal_precision | COMBO | bfloat16 | Precision used for inverter UNet autocast. |
| normalize_output | COMBO | enable | Normalizing the inverter output is highly recommended. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |