Nodes/ComfyUI-DD-Nodes/DD Model Optimizer
ComfyUI Node

DD Model Optimizer

FP8 quantization at load time, without the extension dance

By Dontdrunk·Created 2 years ago·Updated 20 days ago· 181
DD Model Optimizer
    • 优化模型
    模型文件
    智能模式false
    加载模式
    优化模式

    DD Model Optimizer is a model loader with FP8 quantization built in, plus a "smart mode" that decides for you whether to quantize based on your VRAM and the model's file size. You point it at a file in your models/diffusion_models folder, pick an optimization level, and out comes a MODEL ready for the KSampler - often at meaningfully lower memory than loading it fp16. It was born in early 2025, before fp8 loading became a mainstream ComfyUI talking point, and it still does the job without any extra extensions.

    How it works

    It loads from diffusion_models (the folder where you drop UNET/DiT weights) via ComfyUI's own loading functions, then applies model_options at load time. The 优化模式 (Optimization Mode) dropdown maps to real torch dtypes, straight from the source:

    • 禁用优化 (Disabled) - plain load, fp16/bf16 as the file dictates. Best quality, most memory.
    • FP8基础内存优化 (FP8 Basic Memory) - casts weights to fp8_e4m3fn. The standard FP8 weight format; halves memory roughly.
    • FP8高速性能优化 (FP8 High-Speed Performance) - fp8_e4m3fn plus fp8_optimizations, enabling optimized kernels where available. Same memory as basic, usually faster.
    • FP8稳定质量优化 (FP8 Stable Quality) - fp8_e5m2. A different FP8 layout; call it "quality-leaning" if you like, but the honest summary is all FP8 modes trade a little quality for a lot of memory.

    The 加载模式 (Load Mode) has two paths. 标准加载 (Standard) loads through ComfyUI's normal path with the dtype applied. 分步加载 (Stepwise) loads the state dict raw, converts every tensor to the target dtype, then builds the model - which is what lets it report progress and keep memory flat on big models. The second one is the "I have an 12GB model and 8GB of VRAM and I want to see it happen" mode.

    智能模式 (Smart Mode) is the headline feature: it reads your RAM and VRAM via psutil, checks the model's file size, and picks load mode and optimization automatically. The rules are roughly: model fits in VRAM → no optimization; model up to 1.5× VRAM → still no optimization; up to RAM → quality FP8; beyond RAM → more aggressive FP8. Sensible defaults, and you can see the decision printed to the console.

    When you'd reach for it

    When you want FP8 weights without installing a separate quantization extension or hunting for pre-quantized GGUF files. Big diffusion models - Flux-class and the heavier Wan video checkpoints - are exactly where shaving weight memory matters. Note the README's framing: it claims support for "all models loaded via UNET nodes," which in practice means diffusion-model files it can load with ComfyUI's own loader.

    Installation

    cd ComfyUI/custom_nodes
    git clone https://github.com/Dontdrunk/ComfyUI-DD-Nodes
    cd ComfyUI-DD-Nodes && pip install -r requirements.txt
    

    Restart, or use ComfyUI Manager → search "ComfyUI-DD-Nodes". No model downloads - the models are your own files in diffusion_models.

    Honest take

    The name oversells a little: this is a loader with FP8 options and an auto-decider, not a general "optimizer." ComfyUI's core has since added its own fp8 handling, so the edge is thinner than it was in 2025 - but as an all-in-one "load this big model smaller" node it still works, and the smart mode genuinely saves you from thinking about VRAM math. Two gotchas: it only sees files in diffusion_models (not the normal checkpoint folder), and FP8 is a real quality tradeoff on some models - if the result looks degraded, drop to Disabled and live with the memory cost. As with the whole pack, labels are Chinese-first with an English locale in ComfyUI settings.

    Category🍺DD系列节点

    Inputs (4)

    NameTypeDefaultDescription
    模型文件COMBO0 options:
    智能模式BOOLEANfalse
    加载模式COMBO2 options: 标准加载, 分步加载
    优化模式COMBO4 options: 禁用优化, FP8基础内存优化, FP8高速性能优化, FP8稳定质量优化

    Outputs (1)

    NameTypeDescription
    优化模型MODEL