๐ FRED Text to XMP
Turn a tag list into XMP metadata you can embed for Lightroom and Bridge
- XMP_formatted_text
- help
If you're serious about archiving AI images, you'll eventually want them searchable in a real photo manager - and Lightroom and Bridge search on XMP, not on A1111 parameter strings. FRED_Text_to_XMP converts a plain text tag list (or a whole sentence) into a properly formatted XMP metadata block, with your tags written into the standard dc:subject field. Feed its output to a node that writes metadata into the file, and your library becomes searchable by the keywords that actually describe your images.
How it works
It takes your text and turns it into an XMP packet - the XML that photo tools read - with each tag as an entry in <dc:subject>:
- Comma mode (default): split the text on commas, trim whitespace, each item becomes a tag.
"portrait, cinematic light, red dress"โ three searchable keywords. - Sentence mode (
sentence_modeon): instead of commas, it tokenizes the whole string into words, filters out common stopwords, and tags the meaningful ones. Handy when your prompt isn't comma-structured - though you'll get a lot more, noisier tags this way. replace_space_with_underscore: turns spaces into underscores in multi-word tags, which some tools handle better than quoted multi-word keywords.
The output is a complete XMP packet string (XMP_formatted_text) with the standard xpacket wrapper and the RDF structure - the exact format a tool like ExifTool or a metadata writer expects. Plus the pack's usual help.
What it's not
One honest caveat: this node formats the XMP; it doesn't embed it into a file on its own. (The pack README describes a fuller embed-with-modes version, but the shipped v2 node is the formatter.) You feed the string into something that writes metadata - a custom save step, an ExifTool call, or a metadata-embedding node. Pair it with your saver pipeline and the XMP block lands inside your PNG/JPEG/TIFF for the photo manager to index.
Where it earns its keep
- Searchable archives. Generate with a consistent tag string ("character: alice, style: oil_painting, face: closeup"), convert, embed, and every image becomes findable by keyword in Bridge/Lightroom instead of by filename archaeology.
- Prompt-to-keyword automation. In sentence mode you can feed the raw positive prompt and get a reasonable keyword cloud without hand-writing tags.
- Consistent sidecar workflows where tools expect
dc:subjectpopulated.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Poukpalaova/ComfyUI-FRED-Nodes_v2.git
Restart, or "ComfyUI FRED Nodes v2" via ComfyUI Manager. Pure string processing - no dependencies beyond Python's stdlib.
Gotchas
Sentence mode and stopword filtering are crude - it'll keep words like "the" out but won't understand that "very" is noise, so expect a cleanup pass on auto-generated tags. And remember the embedding step: if you wire this output to a plain text display and call it a day, nothing gets written to the file. The value is in finishing the connection to a metadata writer.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | โ | |
| sentence_mode | BOOLEAN | false | โ |
| replace_space_with_underscore | BOOLEAN | false | โ |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| XMP_formatted_text | STRING | โ |
| help | STRING | โ |