Models & Sampling
Read safetensors metadata, extract LoRA triggers, and plan resolutions without loading a single model
- model
- clip
- vae
- name
- sampler
- seed
- dim
- cfg
- params
Despite the name, the Models & Sampling node never loads a model. That's its whole personality: it's the intelligence-and-planning node of the pack. The mode dropdown's 14 operations split into three jobs - model intel (read .safetensors metadata without loading it, fingerprint a file, list installed models in a folder, extract LoRA trigger words), resolution planning (aspect ratio picker, SDXL bucket picker, megapixel calculator, snap-to-multiple), and seed/sampler tooling (seed cycle, multi-seed batch, seed history, sampler/scheduler pickers, a sampler-params bundle). Outputs are model, clip, vae, name, sampler, seed, dim, cfg, and params (DICT).
The two modes I'd genuinely reach for: safetensors_metadata and lora_extract_triggers. The first reads the JSON header of a .safetensors file - no tensors, no VRAM - and hands you the __metadata__ section plus tensor count. That's how you audit a downloaded model before trusting it, check its base model, or read its training info; the pack even ships a 52_safetensors_audit.json workflow for exactly that. The second pulls trigger words out of a LoRA's metadata (ss_tag_frequency, modelspec.trigger_words, and friends), which is the classic "I downloaded this LoRA and can't remember what to type" fix. Both read from a plain path - point them at your models/loras or models/checkpoints folder.
How it works
Same dispatch skeleton as the rest of the pack. The honest caveat is the model/clip/vae outputs: no mode produces them, so they're always empty. This node plans your sampling; it doesn't run it. The outputs that actually carry data:
safetensors_metadata,list_installed_models,multi_seed_batch,seed_history,sampler_params_bundle→ theparamsDICT.lora_extract_triggers,model_fingerprint,scheduler_pick→ thenameSTRING.aspect_ratio_pick,sdxl_bucket_pick,megapixel_calculator→ width and height land in theseedanddimINT slots (generic socket naming - don't let it throw you), with details inparams.seed_cycle→ theseedslot;sampler_pick→sampler;sampler_params_bundle→cfgplus the fullparamsdict.
A few inputs worth knowing: aspect_ratio_pick takes a preset (eight ratios) and long_side; megapixel_calculator takes target_megapixels + ratio_w/ratio_h; seed_cycle takes seed and a cycle_mode - fixed, increment, decrement, random, or from_string, the last of which derives a seed from text via SHA-256 so the same phrase always gives the same seed.
Installing it
Ships with the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/IxMxAMAR/ComfyUI-Utility-MegaPack
Restart ComfyUI, or ComfyUI Manager → "Utility-MegaPack". No model files and no heavy deps - this node deliberately avoids loading models, so it's cheap.
Where people get tripped up
The big one is expecting it to be a model loader: it isn't, and the empty model/clip/vae sockets are a feature, not a bug. Wire name/seed/params into a normal checkpoint loader and KSampler instead. Second, aspect_ratio_pick snaps both dimensions to multiples of 8 - SD UNet/VAE demand it, and older versions produced 1000×562 from long_side=1000, which crashed the model. If you need odd sizes, use snap_to_multiple and pick your own multiple. And if you're coming from the seed-cycling scene, note the sampler/scheduler dropdowns are fixed lists (euler, euler_ancestral, dpmpp_2m, karras, sgm_uniform, and so on) - they're pickers that emit strings, so anything you type into a KSampler by hand still works, but for consistency it's nicer to source it from this node's dropdown.
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | aspect_ratio_pick | 14 options: aspect_ratio_pick, list_installed_models, lora_extract_triggers, megapixel_calculator, model_fingerprint, multi_seed_batch, +8 |
| theme | COMBO | (use pack default) | 17 options: (use pack default), (use ComfyUI default), cyberpunk, minimalist, glassmorphic, retro_terminal, +11 |
| pathopt | STRING | — | |
| folderopt | STRING | — | |
| extensionsopt | STRING | .safetensors,.ckpt | — |
| presetopt | COMBO | 16:9 | 8 options: 1:1 (square), 4:3, 3:2, 16:9, 21:9, 9:16 (portrait), +2 |
| long_sideopt | INT | 102464–8192 | — |
| indexopt | INT | 00–8 | — |
| valueopt | INT | 1024 | — |
| multipleopt | INT | 81–1024 | — |
| target_megapixelsopt | FLOAT | 1.000.01–64 | — |
| ratio_wopt | INT | 161–999 | — |
| ratio_hopt | INT | 91–999 | — |
| snap_multipleopt | INT | 81–1024 | — |
| seedopt | INT | 00–4294967295 | — |
| cycle_modeopt | COMBO | fixed | 5 options: fixed, increment, decrement, random, from_string |
| string_inputopt | STRING | — | |
| base_seedopt | INT | 00–4294967295 | — |
| countopt | INT | 41–256 | — |
| sampleropt | COMBO | euler | 15 options: euler, euler_ancestral, heun, heunpp2, dpm_2, dpm_2_ancestral, +9 |
| scheduleropt | COMBO | normal | 7 options: normal, karras, exponential, sgm_uniform, simple, ddim_uniform, +1 |
| stepsopt | INT | 201–200 | — |
| cfgopt | FLOAT | 7.000–30 | — |
| denoiseopt | FLOAT | 1.000–1 | — |
Outputs (9)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| clip | CLIP | — |
| vae | VAE | — |
| name | STRING | — |
| sampler | STRING | — |
| seed | INT | — |
| dim | INT | — |
| cfg | FLOAT | — |
| params | DICT | — |