Load Diffusion Model Index (NH)
Pick a diffusion model by index — or hand the choice to a boolean
- model
- filename
- index
If you test checkpoints for a living, you've rebuilt the same node over and over: one model dropdown you keep changing between runs. Load Diffusion Model Index (NH) is that pattern formalized. It lists up to 64 diffusion models in a single node, and you select one with a 1-based index - which means the selection can be driven by a Counter (NH), a random node, or any integer your graph produces. Batch-test five checkpoints by queuing five times, never touching a dropdown.
It's the same DNA as the pack's Load Clip Index (NH) and LoRA index loaders: a big configuration surface, one number that chooses.
How it works
It reads everything in ComfyUI's models/diffusion_models folder and lays it out as diffusion_model_1 through diffusion_model_64. The controls:
- select_mode -
indexpicks by theindexwidget;booleanignores the number and picks the firstenable_Nbox you've ticked. Boolean mode is nice for humans ("this run, use the one I flipped on"), index mode is nice for automation. - model_count - how many of the 64 slots are active. Set it to the number you actually populate so empty slots don't clutter the dropdown.
- weight_dtype - weight loading precision:
default,fp8_e4m3fn,fp8_e4m3fn_fast, orfp8_e5m2. The twoe4m3fnvariants are the standard fp8 formats;_fastalso enables fp8 optimizations (faster inference where supported, at a small quality cost). If you're on a VRAM-limited card, fp8 is how you fit bigger models; on a beefy card,defaultkeeps full precision. This is the same dtype knob you'd find on ComfyUI's native diffusion model loader, just exposed here.
The loader goes through ComfyUI's standard load_diffusion_model path, so anything you could load with the built-in Load Diffusion Model node loads here - including fp8 variants of SDXL and newer architectures.
Outputs
- model - the loaded MODEL, ready for a KSampler or model patching.
- filename - the file that loaded, for logging and output captions.
- index - which slot won, passed back so downstream logic knows.
Empty or out-of-range slots return a blocked output rather than a crash - the sampler downstream simply doesn't run. Safe-fail behavior while you're still filling slots.
Where it earns its keep
The killer workflow is a sweep: Counter (NH) → this loader → sample → save, queue it N times, and you've tested N models with zero manual intervention. The filename output makes it easy to label each result with the checkpoint that produced it. The cost is the upfront slot assignment, and it only pays off if you genuinely rotate models. For one-model-per-workflow setups, the built-in loader is simpler - don't over-engineer.
Installing
cd ComfyUI/custom_nodes
git clone https://github.com/jetthuangai/NH-Nodes.git
cd NH-Nodes
pip install -r requirements.txt
Or install NH-Nodes via ComfyUI Manager and restart. No extra downloads - the node reads models you already own. First run shows empty dropdowns until you assign files, which trips people up for about ten seconds.
Inputs (132)
| Name | Type | Default | Description |
|---|---|---|---|
| select_mode | COMBO | index | 2 options: index, boolean |
| index | INT | 11–64 | — |
| model_count | INT | 51–64 | — |
| weight_dtype | COMBO | 4 options: default, fp8_e4m3fn, fp8_e4m3fn_fast, fp8_e5m2 | |
| diffusion_model_1opt | COMBO | 1 options: | |
| enable_1opt | BOOLEAN | false | — |
| diffusion_model_2opt | COMBO | 1 options: | |
| enable_2opt | BOOLEAN | false | — |
| diffusion_model_3opt | COMBO | 1 options: | |
| enable_3opt | BOOLEAN | false | — |
| diffusion_model_4opt | COMBO | 1 options: | |
| enable_4opt | BOOLEAN | false | — |
| diffusion_model_5opt | COMBO | 1 options: | |
| enable_5opt | BOOLEAN | false | — |
| diffusion_model_6opt | COMBO | 1 options: | |
| enable_6opt | BOOLEAN | false | — |
| diffusion_model_7opt | COMBO | 1 options: | |
| enable_7opt | BOOLEAN | false | — |
| diffusion_model_8opt | COMBO | 1 options: | |
| enable_8opt | BOOLEAN | false | — |
| diffusion_model_9opt | COMBO | 1 options: | |
| enable_9opt | BOOLEAN | false | — |
| diffusion_model_10opt | COMBO | 1 options: | |
| enable_10opt | BOOLEAN | false | — |
| diffusion_model_11opt | COMBO | 1 options: | |
| enable_11opt | BOOLEAN | false | — |
| diffusion_model_12opt | COMBO | 1 options: | |
| enable_12opt | BOOLEAN | false | — |
| diffusion_model_13opt | COMBO | 1 options: | |
| enable_13opt | BOOLEAN | false | — |
| diffusion_model_14opt | COMBO | 1 options: | |
| enable_14opt | BOOLEAN | false | — |
| diffusion_model_15opt | COMBO | 1 options: | |
| enable_15opt | BOOLEAN | false | — |
| diffusion_model_16opt | COMBO | 1 options: | |
| enable_16opt | BOOLEAN | false | — |
| diffusion_model_17opt | COMBO | 1 options: | |
| enable_17opt | BOOLEAN | false | — |
| diffusion_model_18opt | COMBO | 1 options: | |
| enable_18opt | BOOLEAN | false | — |
| diffusion_model_19opt | COMBO | 1 options: | |
| enable_19opt | BOOLEAN | false | — |
| diffusion_model_20opt | COMBO | 1 options: | |
| enable_20opt | BOOLEAN | false | — |
| diffusion_model_21opt | COMBO | 1 options: | |
| enable_21opt | BOOLEAN | false | — |
| diffusion_model_22opt | COMBO | 1 options: | |
| enable_22opt | BOOLEAN | false | — |
| diffusion_model_23opt | COMBO | 1 options: | |
| enable_23opt | BOOLEAN | false | — |
| diffusion_model_24opt | COMBO | 1 options: | |
| enable_24opt | BOOLEAN | false | — |
| diffusion_model_25opt | COMBO | 1 options: | |
| enable_25opt | BOOLEAN | false | — |
| diffusion_model_26opt | COMBO | 1 options: | |
| enable_26opt | BOOLEAN | false | — |
| diffusion_model_27opt | COMBO | 1 options: | |
| enable_27opt | BOOLEAN | false | — |
| diffusion_model_28opt | COMBO | 1 options: | |
| enable_28opt | BOOLEAN | false | — |
| diffusion_model_29opt | COMBO | 1 options: | |
| enable_29opt | BOOLEAN | false | — |
| diffusion_model_30opt | COMBO | 1 options: | |
| enable_30opt | BOOLEAN | false | — |
| diffusion_model_31opt | COMBO | 1 options: | |
| enable_31opt | BOOLEAN | false | — |
| diffusion_model_32opt | COMBO | 1 options: | |
| enable_32opt | BOOLEAN | false | — |
| diffusion_model_33opt | COMBO | 1 options: | |
| enable_33opt | BOOLEAN | false | — |
| diffusion_model_34opt | COMBO | 1 options: | |
| enable_34opt | BOOLEAN | false | — |
| diffusion_model_35opt | COMBO | 1 options: | |
| enable_35opt | BOOLEAN | false | — |
| diffusion_model_36opt | COMBO | 1 options: | |
| enable_36opt | BOOLEAN | false | — |
| diffusion_model_37opt | COMBO | 1 options: | |
| enable_37opt | BOOLEAN | false | — |
| diffusion_model_38opt | COMBO | 1 options: | |
| enable_38opt | BOOLEAN | false | — |
| diffusion_model_39opt | COMBO | 1 options: | |
| enable_39opt | BOOLEAN | false | — |
| diffusion_model_40opt | COMBO | 1 options: | |
| enable_40opt | BOOLEAN | false | — |
| diffusion_model_41opt | COMBO | 1 options: | |
| enable_41opt | BOOLEAN | false | — |
| diffusion_model_42opt | COMBO | 1 options: | |
| enable_42opt | BOOLEAN | false | — |
| diffusion_model_43opt | COMBO | 1 options: | |
| enable_43opt | BOOLEAN | false | — |
| diffusion_model_44opt | COMBO | 1 options: | |
| enable_44opt | BOOLEAN | false | — |
| diffusion_model_45opt | COMBO | 1 options: | |
| enable_45opt | BOOLEAN | false | — |
| diffusion_model_46opt | COMBO | 1 options: | |
| enable_46opt | BOOLEAN | false | — |
| diffusion_model_47opt | COMBO | 1 options: | |
| enable_47opt | BOOLEAN | false | — |
| diffusion_model_48opt | COMBO | 1 options: | |
| enable_48opt | BOOLEAN | false | — |
| diffusion_model_49opt | COMBO | 1 options: | |
| enable_49opt | BOOLEAN | false | — |
| diffusion_model_50opt | COMBO | 1 options: | |
| enable_50opt | BOOLEAN | false | — |
| diffusion_model_51opt | COMBO | 1 options: | |
| enable_51opt | BOOLEAN | false | — |
| diffusion_model_52opt | COMBO | 1 options: | |
| enable_52opt | BOOLEAN | false | — |
| diffusion_model_53opt | COMBO | 1 options: | |
| enable_53opt | BOOLEAN | false | — |
| diffusion_model_54opt | COMBO | 1 options: | |
| enable_54opt | BOOLEAN | false | — |
| diffusion_model_55opt | COMBO | 1 options: | |
| enable_55opt | BOOLEAN | false | — |
| diffusion_model_56opt | COMBO | 1 options: | |
| enable_56opt | BOOLEAN | false | — |
| diffusion_model_57opt | COMBO | 1 options: | |
| enable_57opt | BOOLEAN | false | — |
| diffusion_model_58opt | COMBO | 1 options: | |
| enable_58opt | BOOLEAN | false | — |
| diffusion_model_59opt | COMBO | 1 options: | |
| enable_59opt | BOOLEAN | false | — |
| diffusion_model_60opt | COMBO | 1 options: | |
| enable_60opt | BOOLEAN | false | — |
| diffusion_model_61opt | COMBO | 1 options: | |
| enable_61opt | BOOLEAN | false | — |
| diffusion_model_62opt | COMBO | 1 options: | |
| enable_62opt | BOOLEAN | false | — |
| diffusion_model_63opt | COMBO | 1 options: | |
| enable_63opt | BOOLEAN | false | — |
| diffusion_model_64opt | COMBO | 1 options: | |
| enable_64opt | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| filename | STRING | — |
| index | INT | — |