Nodes/Utility-MegaPack/Models & Sampling
ComfyUI Node

Models & Sampling

Read safetensors metadata, extract LoRA triggers, and plan resolutions without loading a single model

By IxMxAMAR·Created 5 months ago·Updated 10 days ago· 1
Models & Sampling
    • model
    • clip
    • vae
    • name
    • sampler
    • seed
    • dim
    • cfg
    • params
    ◄modeaspect_ratio_pick►
    ◄theme(use pack default)►
    ◄path►
    ◄folder►
    ◄extensions.safetensors,.ckpt►
    ◄preset16:9►
    ◄long_side1024►
    ◄index0►
    ◄value1024►
    ◄multiple8►
    ◄target_megapixels1.00►
    ◄ratio_w16►
    ◄ratio_h9►
    ◄snap_multiple8►
    ◄seed0►
    ◄cycle_modefixed►
    ◄string_input►
    ◄base_seed0►
    ◄count4►
    ◄samplereuler►
    ◄schedulernormal►
    ◄steps20►
    ◄cfg7.00►
    ◄denoise1.00►
    ◄model_presetQwen-Image — 1:1 1328x1328►

    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 → the params DICT.
    • lora_extract_triggers, model_fingerprint, scheduler_pick → the name STRING.
    • aspect_ratio_pick, sdxl_bucket_pick, megapixel_calculator → width and height land in the seed and dim INT slots (generic socket naming - don't let it throw you), with details in params.
    • seed_cycle → the seed slot; sampler_pick → sampler; sampler_params_bundle → cfg plus the full params dict.

    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.

    CategoryUtility-MegaPack

    Inputs (25)

    NameTypeDefaultDescription
    modeCOMBOaspect_ratio_pick15 options: aspect_ratio_pick, list_installed_models, lora_extract_triggers, megapixel_calculator, model_fingerprint, model_resolution_pick, +9
    themeCOMBO(use pack default)17 options: (use pack default), (use ComfyUI default), cyberpunk, minimalist, glassmorphic, retro_terminal, +11
    pathoptSTRING—
    folderoptSTRING—
    extensionsoptSTRING.safetensors,.ckpt—
    presetoptCOMBO16:98 options: 1:1 (square), 4:3, 3:2, 16:9, 21:9, 9:16 (portrait), +2
    long_sideoptINT102464–8192—
    indexoptINT00–8—
    valueoptINT1024—
    multipleoptINT81–1024—
    target_megapixelsoptFLOAT1.000.01–64—
    ratio_woptINT161–999—
    ratio_hoptINT91–999—
    snap_multipleoptINT81–1024—
    seedoptINT00–4294967295—
    cycle_modeoptCOMBOfixed5 options: fixed, increment, decrement, random, from_string
    string_inputoptSTRING—
    base_seedoptINT00–4294967295—
    countoptINT41–256—
    sampleroptCOMBOeuler45 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +39
    scheduleroptCOMBOnormal9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
    stepsoptINT201–200—
    cfgoptFLOAT7.000–30—
    denoiseoptFLOAT1.000–1—
    model_presetoptCOMBOQwen-Image — 1:1 1328x132811 options: SD 1.5 — 512x512, Qwen-Image — 1:1 1328x1328, Qwen-Image — 16:9 1664x928, Qwen-Image — 9:16 928x1664, Qwen-Image — 4:3 1472x1104, Qwen-Image — 3:4 1104x1472, +5

    Outputs (9)

    NameTypeDescription
    modelMODEL—
    clipCLIP—
    vaeVAE—
    nameSTRING—
    samplerSTRING—
    seedINT—
    dimINT—
    cfgFLOAT—
    paramsDICT—