Nodes/ComfyUI-nodes-hnmr/StateDictLoader
ComfyUI Node

StateDictLoader

Load a checkpoint as raw weights, not as a model

By CYBERLOOM-INC·Created 3 years ago·Updated 2 years ago· 11
StateDictLoader
    • DICT
    ckpt_name

    Every model-merge workflow in this pack starts here. StateDictLoader takes a checkpoint from your ComfyUI/models/checkpoints folder and loads it as a raw weight dictionary - the DICT output - instead of handing you a ready-to-sample MODEL. It's the difference between opening a spreadsheet to edit the numbers versus just viewing the final chart.

    The only input is ckpt_name, a dropdown of every checkpoint ComfyUI can see. The single DICT output contains the full state dict: model.diffusion_model (the UNet weights), cond_stage_model (the CLIP/text encoder), first_stage_model (the VAE), and all the other tensors that make up a complete checkpoint.

    Mechanically it's a thin wrapper around ComfyUI's own load_torch_file - the same loader the built-in checkpoint node uses internally, just without the model instantiation step. Nothing gets loaded into GPU memory as a model, which is exactly why this is the right entry point for merging: you want the numbers, not a patched model object.

    What you do with the DICT:

    • Merge it with StateDictMerger or StateDictMergerBlockWeighted (weighted sums, add-difference, block-weighted blends).
    • Export it with SaveStateDict after a merge.
    • Re-instantiate it with Dict2Model if you want to actually sample from a merged result.

    So a merge chain looks like: two StateDictLoaders → a merger → Dict2Model → your KSampler. Or → SaveStateDict if you want the merged file on disk to use elsewhere.

    Install the pack via ComfyUI Manager (search "ComfyUI-nodes-hnmr") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/CYBERLOOM-INC/ComfyUI-nodes-hnmr
    

    Restart ComfyUI. No model downloads - it reads whatever checkpoints you already have.

    Two things to watch. Merging isn't training, and the community's hard-won lesson is that blends can lose coherence (the "everything converges to one average model" complaint is real) - so treat merges as experiments, not guarantees. Also, this node loads whatever you pick from disk, so a half-downloaded or corrupt checkpoint shows up as an error at load time; if you get a torch loading error, verify the file first. This is the maintained fork of hnmr293's pack - the original stopped receiving fixes and broke on modern ComfyUI, so install the CYBERLOOM-INC repo specifically.

    Categoryloaders

    Inputs (1)

    NameTypeDefaultDescription
    ckpt_nameCOMBO0 options:

    Outputs (1)

    NameTypeDescription
    DICTDICT