# Dependencies needed to run the test suite; these dependencies # are provided by ComfyUI natively when the node is used within # ComfyUI's environment. pytest>=8.0.0,<9.0.0 torch>=2.1.0
Custom nodes for ComfyUI that target rectified-flow models (for example, Qwen). This pack focuses on inversion and diagnostics; the latent/image/conditioning noise nodes live in Skoogeer-Noise (see ../Skoogeer-Noise).
ComfyUI/custom_nodes/ComfyUI-QwenRectifiedFlowInverter.Skoogeer-Noise into ComfyUI/custom_nodes/Skoogeer-Noise for the forward-diffusion/noise/conditioning helpers.LATENTComfyUI latents are dictionaries containing a "samples" tensor.
samples has shape (B, C, H, W).(B, C, T, H, W).CONDITIONINGComfyUI represents prompt conditioning as a list of [embedding, metadata] entries. This pack reads the embedding tensor from positive[0][0] and uses it as the model context during inversion.
Runs the rectified-flow integration to produce a partially inverted (re-noised) latent. Supports deterministic velocity amplification, seeded stochastic perturbation, and optional output normalization.
Qwen/SamplingLATENT| Field | Type | Default | Notes |
|——|——|———|——|
| model | MODEL | – | Diffusion model / UNet used to predict velocity. |
| latent_image | LATENT | – | Source latent to invert. |
| positive | CONDITIONING | – | Positive prompt conditioning used as context. |
| seed | INT | 0 | Seed for the velocity perturbation noise. |
| steps | INT | 20 | Integration budget; effective steps = int(steps * inversion_strength). |
| inversion_strength | FLOAT | 0.5 | Fraction of the schedule to traverse (0 = no-op). |
| velocity_amplification | FLOAT | 0.0 | Multiplies predicted velocity by (1 + velocity_amplification) each step. |
| velocity_perturb_strength | FLOAT | 0.0 | Adds seeded noise to velocity (scaled by velocity std). |
| internal_precision | enum | bfloat16 | Autocast dtype while running the UNet (force_float32 is most stable). |
| normalize_output | enum | enable | When enabled, normalizes each batch item to mean 0 / std 1 at the end. |
NaN detected at step ..., increase precision (internal_precision = force_float32) and/or reduce velocity_amplification / velocity_perturb_strength.normalize_output = enable is strongly recommended at higher inversion_strength.Runs the inverter and an internal forward-diffusion anchor pass, then blends both latents via spherical interpolation (SLERP).
Qwen/SamplingLATENT| Field | Type | Default | Notes |
|——|——|———|——|
| model | MODEL | – | Model used for both passes. |
| latent_image | LATENT | – | Source latent. |
| positive | CONDITIONING | – | Context used by the inverter pass. |
| steps | INT | 20 | Schedule/integration steps. |
| strength | FLOAT | 0.5 | Target noise level (also used as the forward-diffusion strength). |
| blend_factor | FLOAT | 0.5 | 0 = 100% forward diffusion (stable), 1 = 100% inverter (creative). |
| inverter_seed | INT | 0 | Seed for the inverter’s velocity perturbation. |
| forward_diffusion_seed | INT | 1 | Seed for the forward-diffusion anchor noise. |
| velocity_amplification | FLOAT | 1.0 | Passed through to the inverter node. |
| velocity_perturb_strength | FLOAT | 0.2 | Passed through to the inverter node. |
| internal_precision | enum | bfloat16 | Passed through to the inverter node. |
| normalize_output | enum | enable | Passed through to the inverter node. |
Passes any input through unchanged while printing basic GPU memory statistics to the console.
Qwen/Diagnostics| Field | Type | Default | Notes |
|——|——|———|——|
| data | any | – | Input payload (any ComfyUI type). |
| label | STRING | "" | Optional label included in the printed line. |
| synchronize | enum | enable | When enabled, synchronizes GPU kernels before sampling memory. |
Qwen Rectified Flow Inverter.Skoogeer-Noise, run Forward Diffusion (Add Scheduled Noise) with the same steps and noise_strength but a different seed (this gives an anchor latent samplers expect).Latent Slerp) and sample with denoise matching the strength you used.Latent Hybrid Inverter (Qwen).denoise = strength.Run:
./run_tests.sh
The script creates (or reuses) a .venv folder, installs the dependencies from requirements.txt, and launches pytest.