Nodes/ComfyUI-Ascend-Int8-Test/Load Checkpoint (Ascend INT8)
ComfyUI Node

Load Checkpoint (Ascend INT8)

One checkpoint, three outputs, and an INT8 diet only where it counts

By Aucannot·Created 3 months ago·Updated 3 months ago· 0
Load Checkpoint (Ascend INT8)
    • model
    • clip
    • vae
    • report
    ckpt_name
    backendauto_torch_npu_with_fallback
    scale_modeper_channel
    include_regex.*
    exclude_regex
    min_in_features16
    min_out_features16
    reset_runtime_statstrue

    If you want to take a normal checkpoint from models/checkpoints and run it on a Huawei Ascend NPU with the diffusion part in int8, Load Checkpoint (Ascend INT8) is the node. It's the drop-in replacement for ComfyUI's stock Load Checkpoint in this pack's world: it loads the whole thing and hands you model, clip, and vae like you're used to - with one deliberate difference. It quantizes the diffusion model's Linear weights to int8 at load time, and leaves CLIP and VAE on the normal ComfyUI paths, unquantized.

    That split is the design, not an oversight. On Ascend hardware the INT8 matmul is where the speed lives - roughly 4x the FP16 throughput on Atlas cards - and the diffusion model is where nearly all the compute goes. Text encoders and the VAE run once or twice per image, so quantizing them buys little and risks the quality of your prompt adherence and decode. The README is explicit: CLIP and VAE are left on normal ComfyUI paths, only the diffusion Linear layers get the treatment.

    Mechanically it's the checkpoint twin of the pack's Load Diffusion Model node - same internals, different entry point. It calls ComfyUI's checkpoint loader with the pack's custom operations swapped in, and during state-dict load each eligible Linear layer has its weight transposed, scaled, rounded and clamped to int8, with a float32 scale saved alongside. At forward time the backend mode decides what happens: auto_torch_npu_with_fallback (default) calls the real NPU op and dequantizes only if it fails; torch_npu_strict raises instead of falling back; fallback_dequant_only never calls torch_npu, for NVIDIA smoke tests.

    The inputs you'll actually touch:

    • ckpt_name - the checkpoint from models/checkpoints.
    • backend - pick torch_npu_strict when you're validating a deployment and want a loud failure if the INT8 op isn't there; keep the default for everyday use.
    • scale_mode - per_channel (one scale per output channel, default) vs per_tensor (single scale, slightly cheaper and slightly worse).
    • include_regex / exclude_regex / min_in_features / min_out_features - filter which layers quantize. Defaults quantize everything at or above 16×16 features. exclude_regex is your tool when a specific layer misbehaves.

    Outputs: model, clip, vae wire into your pipeline exactly like the stock loader's, plus a report STRING showing linear_quantized vs linear_skipped, byte savings, and per-layer lists - your proof of what actually got quantized.

    Install is shared across the pack: ComfyUI Manager (search "ComfyUI-Ascend-Int8-Test") or

    cd ComfyUI/custom_nodes
    git clone https://github.com/Aucannot/ComfyUI-Ascend-Int8-Test
    

    then restart. No requirements.txt, no model downloads; just ComfyUI core plus torch_npu (and Huawei's CANN runtime) for the real INT8 path.

    Know the limits before you build a workflow on it: it's a validation plugin, not a production quantizer. Quantization is online at load time, so peak memory isn't optimal. And any LoRA or weight patch drops that layer back to dequantized math for correctness - fine for correctness, but it means an INT8 checkpoint loader plus a stack of LoRAs quietly walks your model back toward fp32 compute. Use it for deployment validation, and keep the report output as your evidence.

    Categoryascend/int8

    Inputs (8)

    NameTypeDefaultDescription
    ckpt_nameCOMBO0 options:
    backendCOMBOauto_torch_npu_with_fallback3 options: auto_torch_npu_with_fallback, torch_npu_strict, fallback_dequant_only
    scale_modeCOMBOper_channel2 options: per_channel, per_tensor
    include_regexSTRING.*
    exclude_regexSTRING
    min_in_featuresINT161–65536
    min_out_featuresINT161–65536
    reset_runtime_statsBOOLEANtrue

    Outputs (4)

    NameTypeDescription
    modelMODEL
    clipCLIP
    vaeVAE
    reportSTRING