ComfyUI Node

Dict2Model

Turn a merged weight dictionary back into something you can sample

By CYBERLOOM-INC·Created 3 years ago·Updated 2 years ago· 11
Dict2Model
  • weights
  • MODEL
  • CLIP
  • VAE
config_name

StateDictMerger hands you a merged DICT of weights, and a dictionary is useless for actually generating images. Dict2Model is the step that makes a merged result sampleable again: it takes a weight dict and a config, and instantiates it into a live MODEL, CLIP, and VAE you can plug straight into a KSampler.

Inputs are weights (a DICT - from StateDictLoader, StateDictMerger, or StateDictMergerBlockWeighted) and config_name, a dropdown of architecture YAML files from ComfyUI/models/configs. That dropdown is where beginners trip. The config defines the model architecture the weights get loaded into, so it has to match the weights' architecture: v1-inference.yaml for SD 1.5, v2-inference.yaml for SD 2.x, v1-inpainting-inference.yaml if your weights came from an inpainting checkpoint, and so on (the list also includes clip-skip and fp16 variants). Pick the wrong one and you get shape mismatches or garbage.

How it works is the clever part: the node calls ComfyUI's normal checkpoint loader against the config file, but temporarily replaces its load_torch_file with a hook that returns your in-memory dict instead of reading from disk. So you get the full MODEL, CLIP, VAE trio - everything a checkpoint load gives you - without ever writing a file.

That means the typical flow is: StateDictLoader → merger → Dict2Model → KSampler, all in-memory, no intermediate file on disk. It's also what the pack's StateDictMergerBlockWeightedMulti uses internally to turn multi-merge weight sets into live iterable models for XYZ plotting.

Install 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 extra models or dependencies.

The config mismatch is the failure mode to remember: it fails loudly with shape errors, not subtly, so you'll know. If your weights came from a LoRA-trained or nonstandard checkpoint, a stock v1/v2 config may not reconstruct it - the config list is SD1.5/SD2.x-era, so this tooling is aimed at classic Stable Diffusion checkpoints rather than SDXL or Flux. Keep expectations calibrated: this is an in-memory instantiation, and if you want the merged model to survive across sessions, route it through SaveStateDict to write a checkpoint file. This is the maintained fork of hnmr293's pack - install the CYBERLOOM-INC repo, not the abandoned original.

Categorymodel

Inputs (2)

NameTypeDefaultDescription
weightsDICT
config_nameCOMBO11 options: anything_v3.yaml, v1-inference.yaml, v1-inference_clip_skip_2.yaml, v1-inference_clip_skip_2_fp16.yaml, v1-inference_fp16.yaml, v1-inpainting-inference.yaml, +5

Outputs (3)

NameTypeDescription
MODELMODEL
CLIPCLIP
VAEVAE