ComfyUI Extension: ComfyUI Qwen Rectified Flow Tools

Authored by ttulttul

Created

Updated

0 stars

This custom node pack for ComfyUI provides a suite of advanced tools for performing 'invert-and-resample' workflows with Rectified Flow models like Qwen-VL. It allows you to take an existing image, convert it to a noisy latent using a guided inversion process, and then use that latent as a starting point to generate creative, high-quality variations.

Custom Nodes (0)

    README

    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

    1. Encode an image to a latent.
    2. Feed the latent into Qwen Rectified Flow Inverter (pick strength/amplification/perturbation).
    3. Feed the clean latent into Forward Diffusion with the same strength but a different seed.
    4. Optionally clean either latent with Latent Gaussian Blur or Add Latent Noise.
    5. Blend the creative and anchor latents (e.g. Latent Slerp) and sample with denoise equal to the chosen strength.

    Hybrid node quickstart

    1. Encode an image to a latent.
    2. Run the latent through Latent Hybrid Inverter with your preferred strength and blend factor.
    3. Sample the result with denoise matching the passed strength.

    Installation

    1. Clone or download this repository into ComfyUI/custom_nodes/.
    2. Restart ComfyUI to load the nodes (look under Qwen/Sampling and Latent).