Nodes/ComfyUI-JDCN/LogicUtil_Parse Exif
ComfyUI Node

LogicUtil_Parse Exif

Pull the generation params out of any image, right in the graph

By daxcay·Created 2 years ago·Updated about a year ago· 159
LogicUtil_Parse Exif
  • image
  • STRING

That image you generated three weeks ago still has its whole recipe embedded in the file - prompt, negative prompt, steps, CFG, seed. LogicUtil_Parse Exif is the node that reads it back out, inside the graph, and hands it to you as a STRING. One input, image (an IMAGE), one output, a STRING of whatever generation info the file is hiding.

How it works

The mechanism is the interesting part, because it's broader than the name suggests. It doesn't just read the standard EXIF block. The source pulls from four places: the PNG's parameters text chunk (what Automatic1111 writes), the EXIF UserComment (what a lot of tools use), NovelAI's JSON comment format, and something called stealth pnginfo - generation data steganographically hidden in the low bits of pixels, used by a few mobile and web tools that don't want to disturb the visible image. That's why the code is a couple hundred lines and the one real dependency in the whole pack - piexif - exists almost entirely for this node.

What comes out is a single string like:

masterpiece, best quality, a portrait of a fox in snow
Negative prompt: bad anatomy, blurry
Steps: 28, CFG scale: 7, Seed: 1234567890, Size: 1024x1024

Wire that into a Text Preview-style node to eyeball it, or feed it onward to reconstruct the prompt automatically. That "image in, recipe out" loop is a genuinely useful ComfyUI trick - drag a reference image in, parse it, and rebuild its prompt with your own twist.

Gotchas: if the image has no embedded info, you get back an empty string - no error, just nothing. ComfyUI's own SaveImage writes the workflow JSON into the PNG metadata, which this node does not extract as a readable prompt; if you're after the workflow, dragging the image back into ComfyUI reconstructs it natively. And it reads from whatever IMAGE you hand it, so the image has to flow through an actual load node first - it's not a file-path reader.

Like the whole LogicUtil family, Parse Exif is a port of aria1th's ComfyUI-LogicUtils bundled into the JDCN pack from Daxton Caylor and Jerry Davos. The README documents the file and latent batch nodes and never gets around to this one - the EXIF reader is where the pack's only Python dependency comes from.

Install

Install is the standard JDCN routine: ComfyUI Manager → "Install Custom Node" → search JDCN → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/daxcay/ComfyUI-JDCN
cd ComfyUI-JDCN && pip install -r requirements.txt

That pip install step matters here - it's what pulls in piexif. If you skip requirements and this node throws an import error, that's the missing piece, not a broken install.

CategoryLogicUtil

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
STRINGSTRING