Nodes/ComfyUI Qwen Rectified Flow Tools/Latent Hybrid Inverter (Qwen)
ComfyUI Node

Latent Hybrid Inverter (Qwen)

Why Not Both? This Node Blends Creative Model-Inversion With a Stable Noise Anchor

By ttulttul·Created 12 months ago·Updated 9 months ago· 7
Latent Hybrid Inverter (Qwen)
  • model
  • latent_image
  • positive
  • LATENT
steps20
strength0.50
blend_factor0.50
inverter_seed0
forward_diffusion_seed1
velocity_amplification1.00
velocity_perturb_strength0.20
internal_precisionbfloat16
normalize_outputenable

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:

  1. The inverter pass - it instantiates the pack's QwenRectifiedFlowInverter node and runs it, walking your clean latent up the schedule to strength with velocity amplification and perturbation applied. That's the creative side.
  2. 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 by forward_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_seed and forward_diffusion_seed - two independent seeds, one per pass. Same pair of seeds = reproducible blend.
  • internal_precision and normalize_output - passed straight through to the inverter stage; force_float32 and enable are 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.0 with 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 denoise equal to strength. The node sets the noise level; the sampler has to meet it there or the blend was pointless.
CategoryQwen/Sampling

Inputs (12)

NameTypeDefaultDescription
modelMODELUNet model used for both inversion and diffusion passes.
latent_imageLATENTLatent tensor to invert and re-noise.
positiveCONDITIONINGPositive prompt conditioning that guides both passes.
stepsINT201–1000Solver steps executed for inversion and forward diffusion.
strengthFLOAT0.500–1Strength for both inversion and forward diffusion. The target noise level.
blend_factorFLOAT0.500–10.0 = 100% Forward Diffusion (Stable), 1.0 = 100% Inverter (Creative)
inverter_seedINT00–18446744073709550000Seed for the creative, perturbed inversion process.
forward_diffusion_seedINT10–18446744073709550000Seed for the stable, 'perfect' noise anchor.
velocity_amplificationFLOAT1.00-0.9–2Deterministically scales the predicted velocity each step.
velocity_perturb_strengthFLOAT0.200–5Random velocity noise level for the inverter stage.
internal_precisionCOMBObfloat16Precision used for inverter UNet autocast.
normalize_outputCOMBOenableNormalizing the inverter output is highly recommended.

Outputs (1)

NameTypeDescription
LATENTLATENT