SamplerToString (Citron Image Saver)
Turn a sampler choice into the string your metadata needs
- sampler_name
A one-output node, and the output is a string that says dpmpp_2m_sde. If you're wondering why anyone would install a node for that, the answer is ComfyUI's type system: a combo value can't be wired into a text input, so the moment you want your save node to record which sampler ran, you need a node like this converting one into the other.
How it works
One required input, sampler, offering ComfyUI's standard sampler enum - the same 44 names as the Sampler Selector (euler, euler_ancestral, dpmpp_2m, dpmpp_2m_sde, dpmpp_3m_sde, ddim, lcm, uni_pc, res_multistep, sa_solver and so on). One output, sampler_name, typed STRING, carrying whatever you picked.
That's the whole thing. It mirrors the Sampler Selector minus the SAMPLERS-typed output - no adapter back to a KSampler, string only.
So when would you use this instead of the selector? Two cases. First, when the sampler for your run isn't set on a socket at all: plenty of megapack nodes (Efficiency's sampler, Inspire's) hold the sampler as a widget, and if you don't want to convert that widget to an input, this node is how you tell the save node what was chosen. Second, when you've already got a selector feeding the sampler and you only need a matching string somewhere else in the graph - though in that case the selector's own sampler_name output already gives it to you and this node is redundant.
Because it's a plain value node, the classic failure mode applies: it records what you selected, not what ran. Two dropdowns on the canvas that both say "sampler" and only one of which drives the sampler is a metadata bug waiting to happen. The Sampler Selector solves this by feeding both places from one choice; this node only covers the half that can't be a socket.
If you're on any kind of parameter sweep - same prompt, six samplers, pick the best - this is worth wiring once. The filenames and the embedded parameters block will tell you which sample was which without you keeping a spreadsheet. That's the same "PNG is the project file" logic that makes the whole save-metadata habit worth having.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/citronlegacy/ComfyUI-CitronNodes
# restart ComfyUI
ComfyUI Manager may not have the pack indexed - the README still says "coming soon" and the repo's packaging metadata is placeholder - so clone it. The only pip dependency is piexif, which the savers import; missing it breaks the whole pack's import, this node included:
pip install piexif
Nothing to download model-wise. Category is Citron_ImageSaver/utils.
Common issues
- The metadata doesn't change when I change the sampler. You changed the sampler on the sampler node, not here. Two sources of truth is exactly the problem this node family exists to avoid.
- Nothing connects to my KSampler. Correct - this is a string output. Use the Sampler Selector if you need the typed combo output too.
- A pack sampler isn't in the list. This is ComfyUI's core list only. RES4LYF and similar don't appear.
- The string shows up in the file but resource hashes don't. Different input on the saver - that one's
additional_hashes, notsampler_name.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| sampler | COMBO | sampler (Comfy's standard) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| sampler_name | STRING | sampler name (STRING) |