FluxMod Sampler Wrapper
Float8 quant support for SamplerCustom graphs
- sampler
- SAMPLER
If KSamplerMod is FluxMod's fix for people using the basic KSampler with an 8-bit quantized model, this node is the same fix for people who aren't. If your graph is built around SamplerCustom, SamplerCustomAdvanced, or any other setup that takes a SAMPLER input rather than swapping the whole sampling node, you can't just wire that SAMPLER straight through when your FluxMod model is loaded in float8_e4m3fn or float8_e5m2 mode - you need to wrap it with this node first. The node's own description spells out the requirement and a wiring rule most people wouldn't guess: "If you are using multiple sampler wrappers, put this node closest to SamplerCustom/SamplerCustomAdvanced/etc." - meaning if you're stacking this alongside other things that wrap the sampler, this one goes last in the chain, right before it feeds into the sampler node itself.
That requirement, same as everywhere else in this pack, only applies to the two float8 quant modes. Loaded your model in bf16, or launched ComfyUI with --fast? Skip this node entirely and wire your SAMPLER through normally.
What it does
Two inputs: sampler (the SAMPLER object you're wrapping - typically from a KSamplerSelect node) and activation_casting, an enum of bf16 / fp16 defaulting to bf16. The tooltip is the same blunt advice as the rest of the pack: "Always use bf16 unless your card does not support it." Output is a single SAMPLER, the same type you fed in, now handling the float8 activation casting correctly - drop it straight into your SamplerCustom's sampler slot in place of the raw one.
How to install it
Via ComfyUI Manager: search "ComfyUI_FluxMod" in Custom Nodes Manager, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/lodestone-rock/ComfyUI_FluxMod.git
Restart ComfyUI and refresh your browser. This node needs nothing of its own - it's downstream tooling for a model already loaded through FluxModDiffusionLoader or FluxModDiffusionLoaderMini in a float8 quant mode.
Common issues & troubleshooting
SamplerCustom output looks broken or noisy in float8 mode. This is exactly the symptom the README calls out for skipping this node - wrap your SAMPLER with it before it reaches SamplerCustom or SamplerCustomAdvanced.
Stacked with other sampler-wrapping nodes, still getting bad output. Check ordering - the pack explicitly says this one belongs closest to the final sampler node when you're chaining multiple wrappers together. Put anything else first, this one last.
Not sure whether you need this or KSamplerMod. They serve the same requirement for two different graph shapes: KSamplerMod replaces a plain KSampler node outright; this one wraps a SAMPLER object for the SamplerCustom/SamplerCustomAdvanced family. Use whichever matches how your graph is already built rather than mixing both into the same pipeline.
Loaded in bf16 and this node seems to do nothing useful. That tracks - the activation-casting fix this node provides is specifically for the float8 quant modes. In bf16 it's not required, so if you added it out of caution, it's safe but unnecessary.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| sampler | SAMPLER | — | |
| activation_casting | COMBO | bf16 | Cast model activation to bf16 or fp16. Always use bf16 unless your card does not support it. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SAMPLER | SAMPLER | — |