Nodes/Binyuan NVFP4 Converter/binyuan Universal Quant Converter (NVFP4/FP8/GGUF)
ComfyUI Node

binyuan Universal Quant Converter (NVFP4/FP8/GGUF)

Quantize any ComfyUI model yourself — NVFP4, FP8, or GGUF, no Hugging Face scavenger hunt

By yjitiu·Created 3 months ago·Updated 3 months ago· 2
binyuan Universal Quant Converter (NVFP4/FP8/GGUF)
    • status
    input_model
    save_to_source_dirtrue
    custom_output_dirF:/custom_models_dir/
    output_filenamemodel_nvfp4
    model_typeAuto (Universal)
    devicecuda
    output_formatNVFP4
    gguf_qtypeQ8_0
    full_precision_mmtrue

    You've got a 24 GB checkpoint and a 16 GB card, the model is too new for anyone to have shipped a quant pack yet, and you're about to go hunt Hugging Face for a conversion that may not exist. Stop. This node is the DIY version of that scavenger hunt: point it at any safetensors sitting in ComfyUI's checkpoints, unet, or diffusion_models folders, pick NVFP4 / FP8 / GGUF, and it writes you a smaller quantized file right next to the source. No uploads, no API, nothing leaves your machine.

    What it actually is

    It's a converter, not a loader - a one-shot utility node living under binyuan/Advanced, named "binyuan Universal Quant Converter (NVFP4/FP8/GGUF)". You run it once, it produces a file, and then you load that file with your normal loader and go back to making images. This is a "do it yourself" tool for the long tail: the big models (Flux, Qwen-Image, Wan) get community quant packs within days, but when Krea2, ERNIE, Ideogram 4.0, or some brand-new architecture drops, a pack often doesn't exist yet. That's the gap this fills - or when you just want a specific qtype nobody bothered to upload.

    How it works

    The trick that makes quantized diffusion models actually load is in the details, and this node handles the parts that usually bite. It converts weights in place but keeps a blacklist of structure-sensitive layers - embeddings, norms, first/last projections, modulation, pad_token - at BF16/F32. That matters because ComfyUI infers model config from the shapes of those first/last projection layers; quantize them and the model instantiates with the wrong channels and dies on load. The remaining 2D weights (attention and FFN projections, the bulk of the bytes) get quantized.

    It also writes comfy_quant markers into the output so ComfyUI recognizes the quantized layers instead of trying to load them as plain weights. If the source is already FP8, it dequantizes through weight_scale first so you don't bake in noise, and it straight-up blocks pointless conversions - like re-quantizing an FP8 file to Q8_0 GGUF, which would come out bigger than what you started with.

    The three formats, and what they cost you

    • NVFP4 (~0.56 bytes/param) - smallest, but the native speedup and VRAM savings are Blackwell-only (RTX 50-series + cu130 + the comfy-kitchen CUDA backend). On older cards it still runs via the full_precision_mm fallback; you just only save disk space.
    • FP8 (1 byte/param) - the safest all-rounder; most newer cards handle it natively.
    • GGUF - the llama.cpp ladder, with Q4_0/Q5_0 landing around 0.56–0.69 bytes/param. Caveat: the pure-Python gguf lib usually only quantizes Q8_0/Q5_0/Q4_0/BF16/F16, so K-series and IQ picks silently fall back to the nearest supported type rather than erroring.

    Inputs that matter

    • input_model - dropdown, auto-scanned from your model folders. The only thing you can't avoid.
    • output_format - NVFP4, FP8 (e4m3fn), or GGUF.
    • model_type - the blacklist strategy. Auto (Universal) works on any architecture and is what you should start with.
    • gguf_qtype - GGUF only; pick Q4_0 or Q5_0 unless you have a reason.
    • full_precision_mm - leave on true unless you're on Blackwell; off is where the real savings live but it'll error on hardware without the CUDA backend.
    • save_to_source_dir / custom_output_dir / output_filename - where the file lands and what it's called.

    Output is a single status string telling you the result or the error.

    Install

    ComfyUI Manager: search "Binyuan NVFP4 Converter". Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/yjitiu/ComfyUI-Binyuan-NVFP4-Converter.git ComfyUI_binyuan_NVFP4_Converter
    

    Then restart ComfyUI. Two extra deps, and they're optional per format: pip install comfy-kitchen for NVFP4/FP8, pip install gguf for GGUF (usually already installed if you have ComfyUI-GGUF). If the node errors with "comfy-kitchen not detected", that's this - the node has zero declared dependencies, so ComfyUI Manager won't install them for you.

    Gotchas

    Where people get burned: picking a K-series GGUF qtype and getting a silently different type; trying NVFP4 with full_precision_mm=false on a non-Blackwell card; and the fake "disk full" error on Windows when your antivirus grabs the half-written multi-GB file - the node already dodges this with a temp-dir + atomic rename, but if it still trips, whitelist your models folder in Defender. Honest take: if a reputable pack already exists for your exact model, downloading it beats converting - but for anything else, this is the fastest road to a smaller model without leaving ComfyUI.

    Categorybinyuan/Advanced

    Inputs (9)

    NameTypeDefaultDescription
    input_modelCOMBO1 options: 没有检测到模型(请确认模型已放入 checkpoints/unet/diffusion_models 文件夹内)
    save_to_source_dirBOOLEANtrue
    custom_output_dirSTRINGF:/custom_models_dir/手动输入保存目录。留空则看 save_to_source_dir:开=存到源模型同目录,关=报错。填了目录就以此为准(save_to_source_dir 被忽略)
    output_filenameSTRINGmodel_nvfp4
    model_typeCOMBOAuto (Universal)NVFP4/FP8 时选择黑名单策略;GGUF 时忽略(用架构自动检测)
    deviceCOMBOcuda2 options: cuda, cpu
    output_formatCOMBONVFP43 options: NVFP4, FP8 (e4m3fn), GGUF
    gguf_qtypeCOMBOQ8_0仅 output_format=GGUF 时生效。⚠️ 本机 gguf 库通常只支持量化到 Q8_0/Q5_0/Q4_0/BF16/F16;K 系列(Q4_K 等)与 IQ 系列在纯 Python gguf 里没实现量化。选了不支持的类型会自动改用同尺寸可用类型(Q4_K→Q4_0、Q5_K→Q5_0、Q6_K→Q8_0…)并打印提示,不会报错。要压 FP8 源推荐直接选 Q4_0(≈0.56) 或 Q5_0(≈0.69)。
    full_precision_mmBOOLEANtrueNVFP4/FP8 推理模式。开=反量化到全精度做矩阵乘(任何GPU都能跑、最稳,但无省显存收益);关=原生量化矩阵乘(真省显存/加速,需Blackwell+cu130+comfy_kitchen CUDA后端,否则可能报错)

    Outputs (1)

    NameTypeDescription
    statusSTRING