๐ท๏ธ Write Metadata
Putting your name in a JPEG's EXIF without leaving ComfyUI
- Result Path
Here's a distinction that costs people a lot of time. ComfyUI's PNG metadata - the embedded workflow and prompt text chunks - is not the same thing as the EXIF/IPTC fields a stock agency, a client, or a gallery actually reads. The first is your node graph, saved so the image can be reopened as a project. The second is Artist, ImageDescription, copyright, keywords. Plenty of people go looking for a node that writes the second one, try a few save nodes, and find only steps/CFG/checkpoint hash.
๐ท๏ธ Write Metadata is that node, more or less. Give it a file path and a JSON object, and it shells out to the author's ime (image-metadata-editor) CLI to merge those tags into the file - JPEG or PNG - without touching a single pixel.
What it's for
The workflow that makes sense: you've got images already sitting on disk - an overnight batch, an upscale pass, files pulled from somewhere else - and you want to stamp them consistently. Or you're saving JPEG/WebP deliverables and want an author field and a description in them, which is exactly the gap that sends people to exiftool-and-a-shell-script.
If you're saving inside this pack, check its ๐ผ Save Image node first - it takes a metadata JSON input and injects it via the same ime path at save time, one node fewer and no second pass over the file. Write Metadata earns its place when the file wasn't created by that graph, or when you need to fix a file already on disk.
How it works
It parses your JSON first, and rejects anything that isn't a non-empty object. Then it works out the target format from the file extension and sanitises your payload before handing it to ime: only two top-level keys are accepted, exif and custom. Unknown top-level keys get wrapped into custom.PngText for PNGs or custom.UserComment for JPEG/WebP, and it auto-translates PngText โ UserComment if you used the wrong one for the format.
That translation matters, and it's grounded in how the formats work: PNG carries arbitrary text in its tEXt/iTXt chunks, while JPEG and WebP have no such chunks and land everything in EXIF UserComment. That's the same divide that means a ComfyUI workflow survives a PNG and dies the moment you export JPEG.
Finally it writes the cleaned JSON to a temp file and runs:
bin/ime /absolute/path/image.jpg --set @/tmp/whatever.json --output /absolute/path/out.jpg
The output is Result Path - a STRING naming the file that was written. In-place, that's the source path. With Output Path set, it's the new path.
The three inputs
File Path - absolute path to a JPEG or PNG. Absolute, not relative, not "the one I just saved". You'll be wiring this from another node's path output in practice: right-click the widget, convert to input, and connect e.g. the PNG Path from the pack's Save Image.
Metadata (JSON) - a JSON object, defaulting to {}, which is an error if you leave it that way. The author's own example in the tooltip:
{"exif": {"Artist": "John"}, "custom": {"UserComment": {"rating": 5}}}
For PNGs use custom.PngText; for JPEG/WebP, custom.UserComment. Nested structure needs to be right - the node fixes which key you used, not the shape inside it.
Output Path (optional) - where ime writes instead of editing in place.
The in-place default is the real trap
Leave Output Path empty and the node modifies the file you pointed it at. No copy, no backup. If File Path came from your master PNG, you've just edited the master - and while metadata writing is lossless for pixels, you've still handed a CLI tool write access to your archive. Set an output path the first few times you use this, and check the result.
Install
cd ComfyUI/custom_nodes
git clone --depth 1 https://github.com/Avaray/honda-nodes.git
cd honda-nodes
python install.py
ComfyUI Manager works too (Node Pack โ Honda Nodes). The installer is what puts ime on your machine: it queries GitHub for the latest Avaray/image-metadata-editor release, downloads the right binary for your OS and architecture, drops it in honda-nodes/bin/, and makes it executable on Linux/macOS. It also grabs jq for the JSON nodes. The node looks for ime on your PATH first, then in that bin/ folder.
Common issues
"The 'ime' CLI tool was not found." install.py never ran, or its downloads failed - it needs internet access to GitHub, and on a blocked connection it prints a warning and carries on. Run it manually in the pack directory and watch the output:
cd ComfyUI/custom_nodes/honda-nodes
../../../python_embeded/python.exe install.py # Windows portable
python3 install.py # venv / Linux
"Invalid JSON in Metadata input." Straight from json.loads. Check your quoting, and remember the field is multiline so you can lay it out properly instead of cramming it on one line.
"Metadata contains no valid 'exif' or 'custom' keys after sanitization." You passed an empty object, or nested everything under a key that got dropped.
It never runs. Not an output node. ComfyUI only executes what feeds an output node, so a Write Metadata sitting at the end of a chain with Result Path connected to nothing is dead weight. Hang a ๐ ๏ธ Print to Console off Result Path, or feed it to a file node, or you'll be debugging a node that was never asked to execute.
ime exits non-zero. The node raises with ime's own stderr in the message - read it. Usual causes are a path that doesn't exist or an exif key ime rejects.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | Absolute path to the target JPEG or PNG file. | |
| metadata | STRING | {} | A JSON object to merge into the metadata via 'ime'. Example: {"exif": {"Artist": "John"}, "custom": {"UserComment": {"rating": 5}}} Use the correct structure for the image format (e.g. PngText for PNGs). |
| output_pathopt | STRING | If provided, ime writes the result to this path instead of modifying the source file in-place. Leave empty to edit in-place. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Result Path | STRING | โ |