Nodes/KJNodes for ComfyUI/CheckpointLoaderKJ
ComfyUI Node Runs on cloud

CheckpointLoaderKJ

Load a checkpoint with the speed hacks built in

By kijai·Created 3 years ago·Updated a day ago· 2,908
CheckpointLoaderKJ
    • MODEL
    • CLIP
    • VAE
    ckpt_name
    weight_dtype
    compute_dtypedefault
    patch_cublaslinearfalse
    sage_attentionfalse
    enable_fp16_accumulationfalse

    This is a checkpoint loader with a control panel bolted on. A normal "Load Checkpoint" just loads the model; this one also lets you cast the weights to a lighter dtype, choose the compute dtype, and flip on a set of speed optimizations right at load time - SageAttention, a cublas Linear patch, fp16 accumulation - instead of hunting for launch flags. It's for people wringing performance out of Flux- and Wan-class models on hardware that's feeling the squeeze. It's also marked experimental, and the description says as much, so treat the toggles as things you turn on deliberately.

    It's part of KJNodes, kijai's utility pack.

    How it works

    The two things you'll actually use are the dtype controls. weight_dtype casts the model weights on load - pick fp8_e4m3fn and you roughly halve VRAM. Per the KB, fp8 is the settled default for large-model inference: near-invisible quality loss at half the memory, and on RTX 40-series and newer the fp8_e4m3fn_fast variant runs the math natively for a speed bump on top. compute_dtype sets the precision the math runs in. The rest - patch_cublaslinear, sage_attention, enable_fp16_accumulation - are optimization switches that trade a fiddlier setup for more speed.

    The inputs and outputs that matter

    • ckpt_name - the checkpoint to load.
    • weight_dtype - default, fp8_e4m3fn, fp8_e4m3fn_fast, fp8_e5m2, fp16, bf16, fp32. fp8_e4m3fn is the go-to for saving VRAM; _fast adds native fp8 compute on recent NVIDIA cards.
    • compute_dtype - default, fp16, bf16, fp32.
    • sage_attention - disabled by default, with several sageattn kernel choices if you have it installed.
    • patch_cublaslinear / enable_fp16_accumulation - experimental speed toggles; leave off until you need them.

    Outputs are the usual MODEL, CLIP, and VAE - same as any checkpoint loader, so it's a clean swap-in.

    Installing it

    ComfyUI Manager → search KJNodes for ComfyUI → install → restart. Or cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, then pip install -r ComfyUI-KJNodes/requirements.txt, and restart. The pack itself is light; the optimizations below are where the real dependencies hide.

    Where people get burned

    • ModuleNotFoundError: No module named 'sageattention'. This is the single most common KJNodes install complaint, and it comes from turning on a Sage path without the sageattention library actually installed. SageAttention needs a separate install (and Triton, which is notoriously painful on Windows). If you're not set up for it, leave sage_attention on disabled - you don't need it to use this loader.
    • fp8 on an older GPU. You can load fp8 weights on almost anything and get the VRAM saving, but native fp8 compute (the _fast speedup) only exists on RTX 40-series and newer. On older cards the weights load in fp8 and compute happens in higher precision - still worth it for the memory, just don't expect the speed bonus.
    • Experimental means experimental. The cublas and fp16-accumulation patches can misbehave with some models or ComfyUI versions. If a generation breaks the moment you enable them, turn them back off - the loader works fine as a plain fp8 loader without any of the extras.
    CategoryKJNodes/model_loaders

    Inputs (6)

    NameTypeDefaultDescription
    ckpt_nameCOMBOThe name of the checkpoint (model) to load.
    weight_dtypeCOMBO7 options: default, fp8_e4m3fn, fp8_e4m3fn_fast, fp8_e5m2, fp16, bf16, +1
    compute_dtypeCOMBOdefaultThe compute dtype to use for the model.
    patch_cublaslinearBOOLEANfalseEnable or disable the cublas_ops arg
    sage_attentionCOMBOfalsePatch comfy attention to use sageattn.
    enable_fp16_accumulationBOOLEANfalseEnable torch.backends.cuda.matmul.allow_fp16_accumulation, required minimum pytorch version 2.7.1

    Outputs (3)

    NameTypeDescription
    MODELMODEL
    CLIPCLIP
    VAEVAE