ComfyUI Node

Model Analyser

Peek Inside a Loaded Model Without Opening a Notebook

By MilitantHitchhiker·Created 2 years ago·Updated 11 months ago· 3
Model Analyser
  • model
  • STRING

The Model Analyser (class ModelAnalyserNode) answers a question you've probably had at least once: what am I actually running? You downloaded a checkpoint from somewhere, it loads, but is it fp16 or fp8? How big is it really, and which blocks dominate? Feed any loaded MODEL into this node and it returns a JSON summary of the diffusion model's weights - structure, size, block counts, and dtypes - all in one string output. No notebook, no Python, no huggingface dump.

How it works

It reaches into the loaded model's state dict (model.model.state_dict()) and runs five small analyses:

  • Structure - how many tensors live in each top-level group (e.g. double_blocks, single_blocks, final_layer for a Flux-style transformer).
  • Size - total size in GB plus the five largest tensors with their shapes and sizes in MB. The largest-tensor list is where you spot the real VRAM hogs.
  • Blocks - a count of double_blocks, single_blocks, and everything else. That naming is Flux-specific; on an SD 1.5 UNet both counts will be 0 and "other" gets everything.
  • Dtypes - a tally of tensor dtypes, which is how you confirm a model is genuinely fp8/bf16/fp16 rather than trusting the filename.
  • Additional info - total tensor count and total size in GB.

Everything comes back as a single STRING holding formatted JSON.

Inputs and output

  • model - any MODEL. That's the only input.
  • Output: STRING (the JSON). Since it's a text output, preview it in the node's output area or wire it into a text display node.

Installing it

It's in the Switchblade Pack: ComfyUI Manager → search MilitantHitchhiker-SwitchbladePack → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/MilitantHitchhiker/MilitantHitchhiker-SwitchbladePack

Restart. No dependencies beyond torch (which ComfyUI already has).

The honest take

This is genuinely useful, with one scope caveat you should keep in mind: it inspects model.model.state_dict() - the diffusion backbone only. It does not see the VAE, the CLIP/T5 text encoder, or the full checkpoint file. So "total size" here is the UNet/transformer alone, not the 6–24 GB checkpoint you downloaded. That's the same scope limitation as the pack's Flux Quant node, and it's the #1 way to misread the output.

The block naming (double/single) is also clearly written for Flux-class transformers. For SD 1.5 or SDXL the structure and dtype info remain useful - the dtype tally is the killer feature for checking whether that "fp8" model you grabbed is actually fp8, and the fp8/e4m3fn naming is the same one ComfyUI and the wider ecosystem use. It's not an output node, so don't expect it to save anything; it's a diagnostic you run while a workflow is up. For a model you're about to trust with a long batch, a thirty-second glance at the dtype breakdown is cheap insurance.

CategoryMilitantAI/Switchblade/Model Merging

Inputs (1)

NameTypeDefaultDescription
modelMODEL

Outputs (1)

NameTypeDescription
STRINGSTRING