AIHub Utils Load Model
The model loader with a string input and a diffusion-model switch
- MODEL
- CLIP
- VAE
AIHubUtilsLoadModel is the workhorse loader of the otavanopisto ComfyUI-aihub-workflow-exposer pack, and its job is to load a model whose name arrives as a string. ComfyUI's built-in CheckpointLoaderSimple is a dropdown frozen at graph-build time; this node takes the model name from a string input, so a client app - or an AIHubExposeStringSelection - can pick the model at runtime. The README's stated reason is the same for all four loaders in this group: dynamic loading from stored files, exposes, or wherever the string comes from.
It also caches. Load a model once and it stays in memory across workflows (the source keeps track of the last file, the loader path used, and the weight dtype). The first run pays the full load cost; subsequent runs reuse the object.
The inputs that matter
- model - the checkpoint or diffusion model filename as a string. Empty means "load nothing" (returns
Noneoutputs, logs "No model specified"). - is_diffusion_model - the switch that decides the loading path. Default is
true, which is the trap:trueloads from themodels/diffusion_modelsfolder via theUNETLoader;falseloads a full checkpoint frommodels/checkpointsviaCheckpointLoaderSimple. If you're used to loading SDXL/Flux checkpoints, flip this tofalseor it will hunt in the wrong folder and come back empty. - diffusion_model_weight_dtype - only used when
is_diffusion_modelis true:default,fp8_e4m3fn,fp8_e4m3fn_fast,fp8_e5m2. This is your quantized-weight lever for diffusion models.
The three outputs mirror a checkpoint loader: MODEL, CLIP, VAE. One caveat from the README: for diffusion models it "will not give clip or vae" - those come from separate loaders (AIHubUtilsLoadCLIP, AIHubUtilsLoadVAE). Checkpoints give you all three.
How it behaves
The source routes three ways: UNETLoader for diffusion models, CheckpointLoaderSimple for checkpoints, and - nice touch - the GGUF loader if the name resolves to a file in the model_gguf folder, so quantized checkpoints load through the right path automatically. Failures raise a clear ValueError: Could not load the model checkpoint. The cache is keyed on file + path type, so switching a model mid-session re-loads instead of handing you a stale object.
Gotchas
The default is_diffusion_model=true is the #1 trip-up - most people reach for this expecting checkpoint behavior. Set it deliberately. Also: an empty model string is not an error, it's a silent None; in a dynamic workflow, guard against the client sending a blank. And remember diffusion models won't hand you a CLIP or VAE, so plan those loaders separately.
Install
Pack-standard, no requirements:
cd ComfyUI/custom_nodes
git clone https://github.com/otavanopisto/ComfyUI-aihub-workflow-exposer
Restart ComfyUI. If your workflow lets the client pick among models (via AIHubExposeStringSelection or a model expose), this is the loader that closes the loop.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model | STRING | The model to load | |
| is_diffusion_model | BOOLEAN | true | If set to true, it will load the model from the diffusion_models folder, if false it will load it from the checkpoints folder |
| diffusion_model_weight_dtype | COMBO | default | The weight dtype to use when loading the diffusion model, this is only used if is_diffusion_model is true |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |
| CLIP | CLIP | — |
| VAE | VAE | — |