ComfyUI Node

Get String Extra

Read any value back out of your image metadata

By kinorax·Created 5 months ago·Updated about a month ago· 2
Get String Extra
  • extras
  • string
key

Get String Extra is the "read" half of the pack's custom-metadata trick. Somewhere upstream, a Set String Extra node tucked a text value into your image's image_info under a key. This node takes that key and hands you the string back, so a value you set once - a style note, a version, a filename stem, a tag you want to keep with the generation - becomes a real wire in your graph instead of a thing you retype.

The mental model: extras ride along

This pack's whole design is built around image_info, a bundle that carries your prompt, model, sampler settings, and more. On top of that there's an extras dictionary: arbitrary key→value pairs that ride along inside image_info. The Set*Extra nodes write to it, the Get*Extra nodes read from it, and because image_info gets serialized into the saved image's metadata, whatever you stash there survives the trip through Image Saver and comes back through Image Reader. That's the part people find surprising and useful: your custom values aren't lost when the image leaves ComfyUI.

Using it

Get String Extra has exactly two relevant inputs. extras is the IPT-ImageInfoExtras socket - wire in the extras output from Image Info Context or another image-info node. key is the parameter-line key you're looking up, matching whatever the matching Set String Extra used.

The output is string - the stored text, or None if the key isn't present. So you can chain it into a String socket (prompt text, a filename, whatever) and let it flow into the rest of the workflow.

There's a family of these, one per type - Get Int Extra, Get Float Extra, Get Size Extra, Get Margin Extra, Get Sampler Params Extra, Get Lora Stack Extra. Each casts the stored value into the right type for its output socket, so you can read a number back into an INT or FLOAT input, a size into an IPT-Size, and so on. This node is the plain-text version.

When you'd reach for it

The honest use case is a workflow you run over and over where a value is set once, in one place, and consumed in several. Set the extra once near the top, read it where you need it, and you've removed a wire and a source of drift. Where people get burned is treating it as a database: keys are case-sensitive, the value is whatever the string cast makes of it, and if the key doesn't exist you get None back, not an error. That's fine - just handle the empty case downstream.

Installing it

Ships in the ComfyUI-Info-Prompt-Toolkit pack. Via ComfyUI Manager, search "Info Prompt Toolkit", or:

cd ComfyUI/custom_nodes
git clone https://github.com/kinorax/comfyui-info-prompt-toolkit.git
cd comfyui-info-prompt-toolkit
pip install -r requirements.txt

Restart ComfyUI. No models to download. It's a small single-author pack (GPL-3.0), so you're adopting its metadata conventions deliberately - but once you do, this read/write pattern is genuinely convenient.

CategoryInfo-Prompt-Toolkit/ImageInfo

Inputs (2)

NameTypeDefaultDescription
keySTRINGParameter line key
extrasoptIPT-ImageInfoExtras

Outputs (1)

NameTypeDescription
stringSTRING