ComfyUI Node

Model to String

The checkpoint name, but as text you can actually reuse

By Goshe-nite·Created about a year ago·Updated about a year ago· 11
Model to String
  • model
  • STRING

ComfyUI happily loads a checkpoint and gives you a MODEL object, but it will not tell you, in words, which file that was. Annoying, because a filename is exactly what you want when you're building save filenames, logging generation info, or wiring up a metadata string. Model to String fixes that: connect any model loader to it and you get the checkpoint's file name - partial subfolder path included - as a STRING.

It's one of those "of course someone built this" nodes, small and single-purpose, and it does the job.

How it works

The mechanism is the pack's standard one, and it's a little cleverer than it looks. Instead of reading a value off the wire, the node parses the embedded workflow graph, traces which node is plugged into its model input, and then scans that node's recorded inputs for a widget whose key matches the pattern *_name. ComfyUI's checkpoint loader stores its file picker under ckpt_name; other loaders use model_name or similar. Whatever matches is returned, path included - so if your checkpoint lives in a subfolder like realism/, you get realism/checkpoint.safetensors, not just checkpoint.safetensors.

Because it's keyed on the widget name pattern rather than a hardcoded list of node types, it's more forgiving than its LoRA siblings: it'll work on any loader that exposes a *_name widget, not just the stock CheckpointLoader. That's also why it doesn't need a class check like Lora to String does.

Inputs and output

  • model (*) - the model loader's MODEL output. Connect your checkpoint (or UNET/diffusion model) loader here.
  • STRING - the model file name, e.g. realism/dreamshaper_8.safetensors.

From there it feeds anything that takes text: an Image Saver filename prefix, a text node, or a prompt template. The output is the filename only - not the full path on disk, and not any model metadata like hash or version.

Install and the one error you'll hit

It ships in GPS' Supplements for ComfyUI (Goshe-nite), a dependency-light pack - no pip installs, no model downloads. Via ComfyUI Manager search "GPS' Supplements for ComfyUI", or:

cd ComfyUI/custom_nodes
git clone https://github.com/Goshe-nite/comfyui-gps-supplements

Restart, and the nodes appear under GPSupps.

The one error to expect is Unable to get node info, thrown when it can't trace the source of your model input - classic causes are a bypassed loader or running a workflow without its embedded graph. It also won't work on nodes whose loader widget isn't named like *_name; if you're feeding it something exotic and getting nothing back, that's the first thing to check. And as with the rest of this pack, it reads the recorded state, so if a model was swapped upstream by a wired value, that's what you'll get - which is honestly the feature, not the bug.

CategoryGPSupps

Inputs (1)

NameTypeDefaultDescription
model*

Outputs (1)

NameTypeDescription
STRINGSTRING