Nodes/ComfyUI-PNGInfo/Safetensors Info (Readable)
ComfyUI Node

Safetensors Info (Readable)

Read a model's training secrets without loading a single weight

By galigali-san·Created 2 months ago·Updated 2 months ago· 6
Safetensors Info (Readable)
    • info
    • json
    file
    custom_path

    Every downloaded model is a black box until you look inside. A checkpoint's .safetensors file carries a __metadata__ block where the trainer or merger stashed the interesting stuff - the merge recipe, the LoRA's learning rate and network dim, the folder paths from the machine that made it. Safetensors Info (Readable) lets you peek at all of that without loading the model, which is the whole trick: no 12GB RAM spike, no ten-second wait, no risk. You point it at a file and the answer is effectively instant.

    How it works

    The safetensors format is gloriously simple: the first 8 bytes are a little-endian 64-bit integer saying how long the JSON header is, the header follows, and then the tensor bytes. This node reads just those first few kilobytes - the header - pulls out __metadata__, and ignores the weights entirely. That's why a multi-gigabyte checkpoint takes milliseconds to inspect. Nothing gets loaded into memory because nothing needs to be; the tensor data never touches Python.

    It then builds you a readable report: filename, full path, human-formatted file size, tensor count, metadata item count, and then each metadata key individually - and here's a nice touch - if a metadata value is itself a JSON string (common with merge tools and trainers), it re-indents and pretty-prints it instead of dumping one unreadable line.

    The inputs and outputs

    • file - a dropdown that scans your checkpoints, loras, vae, diffusion_models, text_encoders, embeddings, controlnet, upscale_models folders (and a few more), listing every .safetensors as folder :: filename. If the dropdown shows "(safetensorsが見つかりません)" - no safetensors found - that's your cue to use the next field.
    • custom_path (optional STRING) - a full file path that overrides the dropdown. Handy for files outside the standard model folders. It strips surrounding quotes, so pasting a quoted Windows path works.

    Outputs are two strings:

    • info - the formatted report described above.
    • json - the raw __metadata__ as a clean JSON string, if you want it programmatically or need to compare against something.

    Neither is visible on its own - like most text outputs, you'll want to run info into a show-text node (easy-use's showAnything or pythongosssss's Show Text) to read it on screen.

    What it's actually for

    • Merge checkpoints: supermerger and friends leave merge recipes in metadata. You can see exactly what went into a Franken-model before you decide to trust it.
    • Kohya-trained LoRAs: learning rate, network dim/rank, training resolution, the source folder paths. If someone's LoRA is undertrained and you want to know why, the answer is usually in here.
    • Settling arguments: "is this really the model it claims to be?" - model type, tensor count, and file size tell you a lot.

    Install

    Same one-liner as the rest of this pack, no dependencies at all (pure Python stdlib plus ComfyUI core):

    cd ComfyUI/custom_nodes
    git clone https://github.com/galigali-san/ComfyUI-PNGInfo
    

    Restart, and it's under image as Safetensors Info (Readable). ComfyUI Manager can also find it by the pack title. The pack's companion node, Safetensors Metadata Cleaner, does the reverse - it removes this metadata before you share a model.

    Gotchas

    • The dropdown only lists files in ComfyUI's known model folders. Anything elsewhere needs custom_path.
    • Not every model has metadata. A clean, never-merged checkpoint often ships with an empty __metadata__, in which case the report says so - that's not an error, it's a sign you've got a tidy file.
    • If you're here to check privacy before sharing a model, note that those "folder paths" in the metadata can be genuinely personal - the cleaner node in this pack exists specifically to strip them.

    Fast, zero-cost, and it only ever reads - there's not much to get wrong, which is more than you can say for most of ComfyUI's ecosystem.

    Categoryimage

    Inputs (2)

    NameTypeDefaultDescription
    fileCOMBO1 options: (safetensorsが見つかりません)
    custom_pathoptSTRINGここにフルパスを入れると、上の選択より優先してそのファイルを読む

    Outputs (2)

    NameTypeDescription
    infoSTRING
    jsonSTRING