ComfyUI Flow Matching Inverter Nodes
Custom nodes for ComfyUI that target rectified-flow models (for example, Qwen). The nodes cover three core tasks:
- integrate the model's velocity field to produce a partially inverted latent,
- add noise using the same schedule as the sampler, and
- perform small latent-domain cleanups or conditioning perturbations.
Each node is available on its own, and the hybrid node chains them together for a single-drop workflow.
Node overview
Qwen Rectified Flow Inverter
Runs the rectified-flow ODE backwards to re-noise an encoded latent. Supports deterministic amplification, seeded stochastic perturbation, optional output normalisation, and shares the same interface as the sampler (steps, conditioning, etc.).
Latent Gaussian Blur
Applies a Gaussian blur directly in latent space. Spatial Only blurs each channel independently; Spatial and Channel performs a joint 3D blur across channels for stronger smoothing.
Add Latent Noise (Seeded)
Adds seeded Gaussian noise scaled by the input latent's standard deviation. Useful whenever a latent needs a controlled bump in noise without touching the schedule.
Conditioning (Add Noise)
Adds seeded Gaussian noise to the CLIP conditioning embeddings (and pooled output when present). Great for introducing gentle prompt variation without rewriting text.
Forward Diffusion (Add Scheduled Noise)
Uses the model's noise schedule (via KSampler) to add the amount of noise that corresponds to a given progress value. This is the "anchor" latent that samplers expect when starting from a given denoise level.
Latent Hybrid Inverter (Qwen)
Convenience node that calls the inverter and forward diffusion nodes internally, then blends their outputs using spherical interpolation. It keeps separate seeds for the creative and anchor paths and exposes the blend weight so you can bias towards either latent.
Example workflows
Manual composition
- Encode an image to a latent.
- Feed the latent into
Qwen Rectified Flow Inverter(pick strength/amplification/perturbation). - Feed the clean latent into
Forward Diffusionwith the same strength but a different seed. - Optionally clean either latent with
Latent Gaussian BlurorAdd Latent Noise. - Blend the creative and anchor latents (e.g.
Latent Slerp) and sample withdenoiseequal to the chosen strength.
Hybrid node quickstart
- Encode an image to a latent.
- Run the latent through
Latent Hybrid Inverterwith your preferred strength and blend factor. - Sample the result with
denoisematching the passed strength.
Installation
- Clone or download this repository into
ComfyUI/custom_nodes/. - Restart ComfyUI to load the nodes (look under
Qwen/SamplingandLatent).