ComfyUI Node

Set String Extra

Stash any text in your image metadata — notes, tags, settings that travel with the file

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

Set String Extra is the most flexible member of the pack's extras family: it writes an arbitrary text keyvalue pair into the metadata "extras" that get embedded in the A1111 infotext when you save with Image Saver. Floats and ints get their own specialized nodes; this one accepts anything that fits in a string.

The float and int versions exist because numbers come back as typed values you can drive a workflow with. Strings are different: you'll reach for this node when the thing you want to persist is textual and you don't need it back as a number. The obvious use is provenance and notes - a model recipe, a batch label, a comment to your future self about why this pass used that setting. But there are real functional uses too: storing a tag list before caption writing, persisting a filename stem or a folder name, or writing a human-readable summary line into metadata that other tools can read without touching the workflow.

Inputs and outputs

  • key - the parameter line key.
  • value - the string to store. This is a plain text field; there's no template or variable expansion in here, so what you type is literally what gets saved.
  • extras (optional) - the incoming extras bundle to merge into.

Output is the merged extras bundle, chainable with the other Set nodes and consumable by Image Info Context.

Because it's a free-form string, there's one extra responsibility on you: the value becomes a single parameter line in the infotext, so keep it line-friendly. Multi-line prose is legal but it'll make the metadata ugly and can confuse parsers downstream. A short label, not a diary entry.

How it fits the wider picture

Same machinery as the rest of the family - extras merge into image_info.extras (duplicate keys overwritten), Image Saver serializes them into the file, Image Reader rebuilds them on load, and the matching Get String Extra node returns your value as a string ready to wire anywhere a string is accepted (a filename builder, a caption node, a prompt field). The pack's Prompt Template node even does $key replacement against extras, so a string extra can be a slot in a template - write a value once, and every template that references $key picks it up.

Install

Standard pack install:

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

Or ComfyUI Manager → search "ComfyUI-Info-Prompt-Toolkit" → install → restart. No models, no extra dependencies.

Where people get burned

The recurring theme applies here hardest: extras only survive if a pack saver writes the file, and duplicate keys silently overwrite. With strings there's also no validation - a typo in a key means a silent dead entry, and a newline in a value can mangle the infotext format. If you're storing structured data, keep it to a single line and make the key count. And when you reload, remember you get a string out: if it's secretly a number you want to compute with, use the typed int/float extras instead, because the Get node won't convert it for you.

CategoryInfo-Prompt-Toolkit/ImageInfo

Inputs (3)

NameTypeDefaultDescription
keySTRINGParameter line key
valueSTRINGParameter line value
extrasoptIPT-ImageInfoExtras

Outputs (1)

NameTypeDescription
extrasIPT-ImageInfoExtras