ComfyUI Node

HSWQ Checkpoint Loader

For when your INT8 SDXL pack loads as a NaN mess

By ussoewwin·Created 10 months ago·Updated 4 days ago· 22
HSWQ Checkpoint Loader
    • MODEL
    • CLIP
    ◄ckpt_name▾►
    ◄weight_dtype▾►
    ◄devicecpu►

    ConvRot INT8 is the quantization story of 2026, and it's the rare upgrade that helps old cards most: an INT8 encoding that rotates away the outliers which normally make 8-bit lossy, so it beats fp8 on quality while running faster - on 20/30/40/50-series, which matters when your 3090 has no fp8 acceleration at all.

    HSWQ packs aren't stock ConvRot. It's ussoewwin's own quantization line - a separate AGPL-3.0 project, Hybrid-Sensitivity-Weighted-Quantization, with this repo as its ComfyUI face. Feed one of its SDXL packs to the stock Load Checkpoint node and you get NaNs, not images.

    What HSWQ actually does to an SDXL model

    The author calls it reverse hybrid, and it is deliberately not a "keep 40% of the layers" percentage scheme. HSWQ ranks every layer by measured trajectory impact and packs the K lowest-impact layers as full ConvRot INT8, leaving everything else in FP16. The selector is per-layer sensitivity, not a ratio. Published packs come out 29–40% smaller than FP16, and quality is gated by a deterministic 25-seed latent-trajectory comparison (cosine mean ≥ 0.95, 0/25 bifurcated) instead of decoded SSIM, on the argument that SSIM through a VAE masks exactly the drift you're trying to see.

    The pack is mixed precision inside one file, and only models quantized with HSWQ are supported - third-party INT8 packs are explicitly out of scope.

    Why stock Load Checkpoint chokes

    INT8 checkpoints carry comfy_quant metadata, and ComfyUI's MixedPrecisionOps quant-loads Linear, Embedding and MoE layers. SD UNets also store Conv2d weights as int8, and core doesn't handle those - they arrive as raw int8 qdata with the scale dropped (absmax around 127 instead of 1) and the forward pass goes to NaN. The pack's source comments are blunt about the fallout: a base forward that NaNs also poisons borrowed ControlLoRA weights, so your ControlNet output explodes into lineart lock, no colouring, dead strength slider.

    This loader patches the Conv2d quantized path so those layers dequantize and compute properly rather than throwing PyTorch's "Only Tensors of floating point and complex dtype can require gradients", and for SDXL it arms the embedded clip_l/clip_g INT8 metadata so conditioning doesn't collapse. Then it hands the whole denoiser to a CUDA-graph replay executor - that's where the steady-state speedup lives (author's bench: 3.27 → 3.36 it/s at 1024×1024, output bit-equal).

    The inputs that matter

    Three fields, and you'll touch two of them once.

    • ckpt_name - the safetensors file from models/checkpoints, same list as the standard loader.
    • weight_dtype - default, SDXL ConvRot INT8, or SD1.5 ConvRot INT8. default isn't dumb: it probes safetensors metadata for INT8 comfy_quant markers and routes itself. Pick the explicit option anyway - one click, no guesswork.
    • device - optional initial-placement hint for multi-GPU boxes. Leave it alone.

    Outputs are MODEL and CLIP. That's it, no VAE socket, because there's no VAE in these files. Wire a separate VAE Loader with your SDXL VAE or you'll get a black image and spend twenty minutes blaming the quant.

    Installing it

    ComfyUI Manager is the easy path - search the pack title, or "HSWQ". Manual works too:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ussoewwin/ComfyUI-HSWQ-Loader-and-Tools
    

    Restart ComfyUI. The dependency list is chunky: diffusers, transformers, peft, accelerate, timm, insightface, facexlib, onnxruntime, opencv-python - the face/detection ones are for the pack's other nodes, and they're why the install takes five minutes. Its install.py upgrades pip and setuptools first, a deliberate fix for Python 3.12 boxes that die on pkgutil.ImpImporter while building facexlib's filterpy dependency. Let its installer run.

    Then grab an actual pack - the published ones live at ussoewwin/Hybrid-Sensitivity-Weighted-Quantization-SDXL-ConvRot-INT8 and go in models/checkpoints.

    Where people get burned

    The purge node is mandatory. The README is insistent and it's not marketing: every HSWQ workflow needs General Purge VRAM V2 from the author's ComfyUI-DistorchMemoryManager at the end of the graph with its HSWQ toggle on. HSWQ's residual GPU/host memory and CUDA graphs aren't released by ComfyUI's generic unload, so run two fails with quantize_nvfp4, PyCapsule or pooled TC path failed. Skip it and you get one good image per restart.

    Latents above 128. Graph capture stops at a latent side of 128 - 1024×1024. Go bigger and it quietly runs eager: slower, not broken.

    Wrong node for Z Image or Krea2. Those go through the pack's UNet loaders in diffusion_models. This one is SDXL and SD1.5 checkpoints, full stop.

    LoRAs work, but they're a bake. INT8 layers get dequantized, patched, requantized on the fly - slower than FP16 stacking, and the pack patches Conv2d set_weight precisely so LoRA deltas on conv layers don't silently round to zero.

    One honest note on scale: HSWQ barely registers on r/comfyui, so there's no crowd to fall back on when something breaks. The repo's md/ folder ships a technical guide per failure mode - read those instead of guessing.

    Categoryloaders

    Inputs (3)

    NameTypeDefaultDescription
    ckpt_nameCOMBOSDXL or SD1.5 checkpoint to load MODEL and CLIP from (same as standard Load Checkpoint).
    weight_dtypeCOMBO3 options: default, SDXL ConvRot INT8, SD1.5 ConvRot INT8
    deviceoptCOMBOcpu1 options: cpu

    Outputs (2)

    NameTypeDescription
    MODELMODELThe UNet diffusion model from checkpoint.
    CLIPCLIPThe CLIP model from the checkpoint.