ComfyUI Node

HSWQ Sampler

A KSampler that resurrects RES4LYF's 100+ samplers in vanilla ComfyUI

By ussoewwin·Created 9 months ago·Updated a day ago· 17
HSWQ Sampler
  • model
  • positive
  • negative
  • latent_image
  • LATENT
seed0
steps20
cfg8.0
sampler_name
scheduler
denoise1.00
clip_perfect_offload (Krea2 only)false
tensor_boostfalse

Here's a weird-but-real ComfyUI ecosystem story: RES4LYF is the sampler pack that replaced DPM++ 2M Karras for flow-matching models - its solvers and the beta57 schedule show up in workflow shares everywhere - but its ComfyUI version can't actually show you most of its own samplers. In Forge, RES4LYF's beta/__init__.py dynamically generates wrapper functions for 100+ Runge-Kutta samplers and registers them into extra_samplers. The ComfyUI port never shipped that logic, so from the stock KSampler's dropdown those samplers simply don't exist. This node is the fix: a KSampler-equivalent that reproduces the Forge logic and re-injects the whole RK family into vanilla ComfyUI.

How it works

It's a thin wrapper over ComfyUI's own common_ksampler, so every input and the LATENT output behave exactly like stock. The magic happens at node-creation time. It scans sys.modules for RES4LYF (handling both the RES4LYF and custom_nodes.RES4LYF module names, with a partial-match fallback so load order doesn't matter), pulls the pack's extra_samplers, then generates sample_fn / sample_ode_fn closures that call sample_rk_beta for every RK sampler name - excluding the implicit solvers like gauss-legendre, radau and lobatto. Each gets registered into both KSampler.SAMPLERS (so it's UI-selectable) and comfy.k_diffusion.sampling (so it actually runs), with a guard against RES4LYF's importlib.reload() wiping the references. The scheduler list is also merged with ComfyUI's SCHEDULER_HANDLERS.

Translation: with RES4LYF installed, this node's sampler_name dropdown suddenly contains the whole RK family that Forge users take for granted. Without RES4LYF installed, it degrades gracefully to a plain, perfectly normal KSampler - the RES4LYF discovery is optional, not a hard dependency.

The inputs that matter

The main set is stock KSampler: model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise. Two optional toggles ride on top, and they're worth understanding before you touch them:

  • clip_perfect_offload (Krea2 only) - off by default. For a Krea2 diffusion model, once the prompt is encoded it unloads the Krea2 text encoder before sampling, freeing the VRAM that the DiT needs on tight cards. It's deliberately narrow: it only ever touches a Krea2 model and a Krea2 text encoder, identified by module identity rather than class-name guessing, and it's ignored for every other architecture. So on Z Image, Flux, SDXL - it does nothing.
  • tensor_boost - off by default. Enables Per-Weight CUDA Graph acceleration inside the pack's NVFP4 stack for SDXL ConvRot NVFP4 on Blackwell (RTX 50-series and up). On, it's faster for fixed-resolution sampling and costs several GB of VRAM in CUDA Graph arenas. Off, it clears graphs and runs Eager Pooled.

Honest take

If you don't run RES4LYF samplers and don't run Krea2 or NVFP4-on-Blackwell, this node buys you nothing over the stock KSampler - it's literally the same backend. Its whole job is being the place where this pack can intercept sampling for HSWQ's quantized-inference paths without patching ComfyUI core, plus resurrecting those RK samplers. The README recommends 16 GB VRAM or more, which is a reasonable floor for the workflows it's aimed at, not a hard requirement for basic use.

Install is the standard pack route - ComfyUI Manager, or git clone https://github.com/ussoewwin/ComfyUI-HSWQ-Loader-and-Tools into custom_nodes - and then restart. If you came here because a workflow references rk_beta samplers, note you still need the RES4LYF pack installed separately; this node surfaces its samplers, it doesn't ship them.

Categorysampling

Inputs (12)

NameTypeDefaultDescription
modelMODEL
seedINT00–18446744073709550000
stepsINT201–10000
cfgFLOAT8.00–100
sampler_nameCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
positiveCONDITIONING
negativeCONDITIONING
latent_imageLATENT
denoiseFLOAT1.000–1
clip_perfect_offload (Krea2 only)optBOOLEANfalseKrea2 only. Frees the Krea2 text encoder before sampling. Ignored for every other architecture.
tensor_boostoptBOOLEANfalseEnable Blackwell Per-Weight CUDA Graph Tensor Boost during sampling. ON raises VRAM by several GB (CUDA Graph arenas).

Outputs (1)

NameTypeDescription
LATENTLATENT