Nodes/ComfyCollectorNodes/Safetensors Metadata (CCN)
ComfyUI Node

Safetensors Metadata (CCN)

What's actually inside that .safetensors?

By valkymaera·Created 4 months ago·Updated 10 days ago· 1
Safetensors Metadata (CCN)
    • summary
    • full_metadata
    model_type
    filename
    show_tensorstrue
    max_tensors50
    debug_modefalse

    You downloaded a checkpoint from somewhere, and the filename tells you almost nothing. What architecture is it? Is it a full checkpoint or just a UNet? What's actually in the metadata block? Safetensors Metadata (CCN) answers all of that by reading the header of any .safetensors file - fast, and it never loads the weights, so no VRAM involved.

    Pick a model_type (loras, checkpoints, vae, clip, unet, diffusion_models, text_encoders, controlnet, style_models, hypernetworks, upscale_models - whatever folder type you want to browse), give it a filename, and you get two STRING outputs: a human-readable summary and the full_metadata. The summary includes tensor count plus an architecture detection pass - the pack ships a small detector that looks at the tensor keys and shapes to guess what kind of model you're holding, which is a genuinely useful trick when you've got an unlabeled download.

    The inputs that matter

    • model_type - which model directory to search.
    • filename - typed, and it's forgiving: it does an exact match first, then falls back to a unique substring match. Ambiguous names return the list of candidates.
    • show_tensors (default on) and max_tensors (default 50) - cap how much of the tensor listing appears.
    • debug_mode - extra console noise if you want it.

    It can also take an absolute path if the file lives outside the standard folders. Anything that isn't a .safetensors gets a clear "not a safetensors file" message.

    Why you'd reach for it

    Metadata reading is exactly the kind of thing that sits in the gap between "I downloaded this" and "I trust this." The safetensors format exists partly because it's a safe, inspectable container - reading its header tells you about the file without executing anything in it, which matters more than ever given the malware incidents in the custom-node ecosystem. For LoRAs specifically, the embedded metadata often carries trigger words and training info that a normal loader hides from you.

    Install

    Part of ComfyCollectorNodes, one install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/valkymaera/ComfyCollectorNodes
    

    then restart, or install via ComfyUI Manager ("ComfyCollectorNodes"). No models to download; the pack uses the safetensors library that ComfyUI already bundles.

    Where people get burned

    Two things. First, the filename must match what's actually in that model folder - a typo returns a "file not found" message as a string output rather than an error, so read the output (the node is an output node, so results show in the UI). Second, it only reads the header, so don't expect it to tell you what a model will render like - it tells you what a file is. For per-LoRA metadata with trigger words in a nicer format, the pack also has a dedicated CCN_LoraMetadata node; this one is the general-purpose reader.

    CategoryCCN

    Inputs (5)

    NameTypeDefaultDescription
    model_typeCOMBO11 options: loras, checkpoints, vae, clip, unet, diffusion_models, +5
    filenameSTRING
    show_tensorsoptBOOLEANtrue
    max_tensorsoptINT501–9999
    debug_modeoptBOOLEANfalse

    Outputs (2)

    NameTypeDescription
    summarySTRING
    full_metadataSTRING