Any to String (Image Saver)
Turn any wire into text so it can land in your metadata
- value
- string
A little adapter node: it accepts any input type and spits out a string. In the Image Saver pack that's more useful than it sounds, because the saver's metadata fields want text, while half the values you'd want to record - a seed, a CFG, a size, some node's numeric output - arrive as INT or FLOAT. Any to String is the glue that lets you take whatever's on a wire and drop it into a field, a filename, or a custom metadata note as readable text.
How it works
It takes a wildcard input (ComfyUI's "any type", shown as *) and converts the value to its string representation. A 1234567 INT becomes the text "1234567"; a 7.5 FLOAT becomes "7.5". Wherever a downstream node needs a string but the value upstream isn't one, this bridges the gap. No formatting options - it's a straight cast to text.
A concrete use: say you want the seed baked into a custom note or a filename fragment. The seed leaves your Seed Generator as an INT, but a text field or a string-concatenation node only speaks strings. Drop it through Any to String first and now it's "1234567", ready to append to a label like run_ or to stuff into the saver's custom field. It's the small adapter that lets numeric values participate in text.
The inputs and outputs that matter
- value - any type. Whatever you connect, it gets stringified.
The single output is string (a STRING) - feed it into a text field, a String-consuming metadata input, or a saver's custom field.
Installing it
ComfyUI Manager: search ComfyUI Image Saver, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/alexopus/ComfyUI-Image-Saver
cd ComfyUI-Image-Saver
pip install -r requirements.txt
Restart, hard-refresh. No downloads.
Where people get tripped up
Two things to keep straight. First, this converts type, not meaning - it gives you whatever Python's default string representation of the value is. For a plain number that's exactly what you want; for a complex object (a MODEL, a CONDITIONING) the string won't be something human-readable or useful, so only point it at values that make sense as text.
Second, don't reach for this where the saver already has a typed field. Image Saver takes seed_value, cfg, steps and friends as their native INT/FLOAT types - you feed those directly, no conversion needed. Any to String is for the cases where you want a value as text specifically: composing a custom note, building part of a filename, or feeding a node that only accepts strings. Used for the right job it's a quiet workhorse; used to "fix" a type that didn't need fixing, it's just an extra hop.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| value | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| string | STRING | String representation of the input |