RALUSamplerCore
The three-stage mixed-resolution sampler, unpacked
- model
- conditioning
- latent
- noise_state
- negative_conditioning
- vae
- latent
- upscaled_preview_latent
- noised_preview_latent
- debug_info
This is the heart of the pack. RALUSamplerCore is the custom sampler that actually implements RALU - the training-free mixed-resolution latent upsampling idea from the 2025 research line that denoises diffusion models mostly at low resolution and only spends expensive high-res compute where the image needs it. RALU's pitch is speed without the quality cliff: most of a 1024×1024 image doesn't need full-res denoising for most of the schedule, so it doesn't get it.
It's a research sampler, so temper expectations: this is the author's standalone export of their FLUX/SD3 experiments, not a polished product. But if you want to see what RALU does under the hood, this node is the honest way to watch.
How the FLUX RALU path works
The ralu scheduler mode runs the three-stage flow (all of it is in ralu_flux_runtime / the family adapters):
- Stage 1 (coarse): the latent is downsampled 2× (a quarter of the tokens) and denoised with a shift-aware schedule built from the stage's parameters.
- Stage 2 (select & refine): the sampler scores which low-res tokens carry the most detail - if you wired a
vae, it decodes the prediction and runs Canny edge detection to score patches; without one it falls back to a latent-space energy/gradient scorer - then upscales the topup_ratiofraction of tokens to full res, injects Cholesky-correlated noise, and denoises at mixed resolution. - Stage 3 (finish): everything is upsampled to full res, more correlated noise is added, and the final denoise pass runs.
The level input picks the preset: 4 (default) uses N=[5,6,7] steps across the three stages with up_ratio 0.3 and is the closer-to-full-quality option; 7 uses N=[2,3,5] with up_ratio 0.1 for a faster, coarser pass. Only 4 and 7 exist - anything else raises an error.
The inputs that matter
family- must befluxorsd3.genericandsdxllook selectable but throw "not implemented yet" if you try to actually run them.scheduler_mode-placeholder(auto-promotes toraluwhen family=flux and the noise iscorrelated_ralu),normal(falls back to plain ComfyUI Euler sampling with yourcfg_scale), orralu(the real thing).use_ralu_default-truelocks you to the preset level parameters;falserequiresN_jsonande_json(JSON arrays of 3 ints / 3 floats) and runs a scipy Jensen–Shannon optimizer to derive the schedule. The defaults are the ones to use until you know what you're doing.noise_state- feed itRALUNoiseSourceincorrelated_ralumode; that's what trips the RALU path.cfg_scale- 1.0 by default (FLUX is guidance-free); only meaningful innormalmode with anegative_conditioning.
Outputs: latent (decode it with your VAE), upscaled_preview_latent and noised_preview_latent (mid-flow previews), and debug_info - a JSON string that tells you the effective stage counts, whether the node was actually implemented, and latent statistics. If you're not sure a run is really doing RALU, read that string.
Installing
cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/Milkyawaway/comfyui-ralu-sampling.git
cd /path/to/ComfyUI
python -m pip install opencv-python numpy typing-extensions
python main.py
ComfyUI Manager: search "comfyui-ralu-sampling", install, restart. You'll need the actual models in the standard folders - flux1-dev.safetensors plus clip_l, clip_g, t5xxl_fp16, and ae.safetensors for the FLUX examples, or sd3.5_large.safetensors for SD3.
Common issues
- "Unknown RALU family" or "not implemented yet" - you picked a family that can't run. Stick to flux/sd3.
- "Invalid level" - only 4 and 7 are defined.
N_json/e_jsonerrors whenuse_ralu_defaultis off - they must be valid JSON arrays of exactly 3 values. And that path imports scipy; if the optimizer errors,pip install scipy(ComfyUI usually has it).- Nothing in the palette - the pack registers via the modern
comfy_api.latestAPI; an outdated ComfyUI won't load it.
Honest recommendation: the RALUFluxWorkflowBridge is the friendlier entry point if you just want a working FLUX RALU run - it sets up the model, conditioning, latent, and noise for you. Use RALUSamplerCore when you want to control the pieces yourself, or you're poking at what the algorithm is actually doing.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| conditioning | CONDITIONING | — | |
| latent | LATENT | — | |
| noise_state | NOISE | — | |
| steps | INT | 251–10000 | — |
| scheduler_mode | COMBO | placeholder | 3 options: placeholder, normal, ralu |
| sampler_name | COMBO | placeholder | 3 options: placeholder, euler, custom |
| family | COMBO | flux | 4 options: generic, flux, sdxl, sd3 |
| use_ralu_default | BOOLEAN | true | — |
| level | INT | 44–7 | — |
| up_ratio | FLOAT | 0.300–1 | — |
| N_json | STRING | — | |
| e_json | STRING | — | |
| debug_save_intermediates | BOOLEAN | false | — |
| cfg_scale | FLOAT | 1.000–100 | — |
| negative_conditioningopt | CONDITIONING | — | |
| vaeopt | VAE | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |
| upscaled_preview_latent | LATENT | — |
| noised_preview_latent | LATENT | — |
| debug_info | STRING | — |