Extensions/ComfyUI-JPG-Metadata
ComfyUI Extension

ComfyUI-JPG-Metadata

Add support for JPG workflow to Comfyui. Save and restore ComfyUI workflows from JPEG images via EXIF UserComment metadata.

By Amarillys·Created 3 months ago·Updated 3 months ago· 0
Amarillys/ComfyUI-JPG-Metadata
Nodes2
On cloudLocal install
Categoryimage
Stars0
Updated3 months ago
Readme

ComfyUI-JPG-Metadata

Save your storage! ( typically 80%-85% )

Save and restore ComfyUI workflows from JPEG images via EXIF UserComment metadata.

Now you can save and drag jpg image to comfyui to load workflow directly.

Also, we provide a tool with gui for you to convert old png images to new jpg with workflow.

Why

ComfyUI only fully supports workflow metadata in PNG (via tEXt chunks). If you save images as JPEG — smaller files, wider compatibility — the workflow is lost. This plugin fills that gap.

Nodes

| Node | Description | |---|---| | Save Image (JPG) | Save images as JPEG with workflow/prompt metadata embedded in EXIF UserComment. Outputs to output/ directory. | | Preview Image (JPG) | Preview images as JPEG with metadata, saved to temp directory (auto-cleaned). No permanent files unless you right-click save. |

Both nodes accept the same inputs as the built-in SaveImage / PreviewImage nodes (minus PNG-specific options), plus a quality slider (1–100).

Drag & Drop Restore

Drag a JPEG saved by this plugin back into ComfyUI — the workflow or prompt will be restored automatically. This works via a frontend extension that reads the EXIF UserComment tag from dropped .jpg/.jpeg files.

Priority: if the file contains a workflow key, the full workflow graph is loaded; otherwise it falls back to prompt (API format).

How It Works

  • Writing: prompt and extra_pnginfo (which contains workflow) are serialized as JSON and written to the EXIF UserComment tag (0x9286), which has a ~64 KB capacity.
  • Reading: A pure-JS EXIF parser (no dependencies) reads the tag from dropped JPEG files and calls loadGraphData / loadApiJson.

Limitations

  • JPEG does not support alpha channels; RGBA images are automatically converted to RGB.
  • EXIF UserComment has a practical limit of ~64 KB. Very complex workflows may exceed this.
  • The --disable-metadata CLI flag is respected — no metadata is written when enabled.

Installation

ComfyUI-Manager (Recommended)

Search for ComfyUI-JPG-Metadata in the Manager and click Install.

Manual

cd ComfyUI/custom_nodes
git clone https://github.com/Amarillys/ComfyUI-JPG-Metadata.git

Then restart ComfyUI.