ComfyUI Node

ModelFP8ConverterNode

Skip the conversion script — fp8 your diffusion model right inside the graph

By Shiba-2-shiba·Created 2 years ago·Updated 7 months ago· 34
ModelFP8ConverterNode
  • model
  • MODEL

The usual way to get an fp8 checkpoint involves a small Python ceremony: load the safetensors, cast model.diffusion_model to torch.float8_e4m3fn, keep CLIP and VAE in fp16, save a new file, drop it in your checkpoint folder. It works, but it's fiddly enough that people keep posting "how do I even do this" threads, and the scripts break on metadata as often as not.

ModelFP8ConverterNode skips the script entirely. It's one node that takes an already-loaded MODEL, casts the diffusion-model weights to fp8 in memory, and hands the same model back. Load your regular fp16 checkpoint, route its MODEL output through this node, and you're effectively running fp8 with zero file conversion. The repo's whole pitch is that you don't need to split unet/clip/vae apart first the way those scripts force you to - you just use the combined safetensors ComfyUI already loads.

Why bother? fp8 is half the bits of fp16 - roughly half the VRAM for the model portion - with quality loss the community basically can't see. The consensus line is "99% identical to fp16, just use it." For big DiT models that don't fit your card at fp16, this is the difference between running and swapping checkpoints mid-thought.

How it works

The node is blunt and honest about it. It reaches into the loaded model, grabs diffusion_model (the UNet or DiT), and casts every parameter to torch.float8_e4m3fn - the E4M3 variant ComfyUI uses everywhere. That's exactly the mixed-precision recipe people script by hand: convert only the diffusion model, leave the text encoder and VAE alone. It mutates the model in place and returns the same patcher, so anything downstream just sees the lighter weights. Note the catch: if the cast throws, the node swallows the exception, prints to the console, and returns your original fp16 model. A silent no-op, not an error on the canvas.

The two ways to use it

  • Inline: Checkpoint Loader → ModelFP8ConverterNode → KSampler. You save VRAM per generation and never write a file. This is the low-commitment way to test whether fp8 looks fine to you before you commit to a converted checkpoint.
  • Save it: the repo's example workflow routes the converted MODEL into ComfyUI's built-in ModelSave and CheckpointSave nodes. That writes a real fp8 .safetensors to ComfyUI/output/checkpoints. This is where beginners get lost - someone tried this pack, saw "no output," and it turned out they just hadn't wired a save node. No save node, no file. The output isn't magic.

The interface is two sockets: model in, MODEL out. There are no widgets, no mode toggles, nothing to tune. It does one thing.

Install

Same as any custom node:

cd ComfyUI/custom_nodes
git clone https://github.com/Shiba-2-shiba/ComfyUI_DiffusionModel_fp8_converter.git

then restart ComfyUI. Or search "ComfyUI_DiffusionModel_fp8_converter" in ComfyUI Manager. There's no requirements.txt and no model download - it only needs torch, which ComfyUI already dragged in. Restart and you'll find the node under the conversion category.

Caveats worth knowing

  • VAE fp8 is not supported, and the author says so plainly. VAE conversion isn't in scope, so your VAE stays fp16 - which is fine, it's not where the memory goes anyway.
  • It's a blanket cast with no scaling. The community-standard script does the same raw .to(float8_e4m3fn), and in practice it's fine for trained weights, but it's not the surgical, per-layer treatment ComfyUI's native fp8 path gives you.
  • Tested on SDXL, AuraFlow, and HunyuanDiT per the README. Notably absent: Flux. It'll probably work there too - fp8 e4m3fn is fp8 - but treat it as unverified.
  • Only reach for this if the model genuinely doesn't fit. If your card already runs the fp16 checkpoint comfortably, converting gains you nothing but a smaller footprint.

The one-line summary: it's the "convert checkpoint to fp8" script, but as a node you can wire up in ten seconds and throw away.

Categoryconversion

Inputs (1)

NameTypeDefaultDescription
modelMODEL

Outputs (1)

NameTypeDescription
MODELMODEL