ComfyUI-JPG-Metadata Introduction
ComfyUI-JPG-Metadata lets you save ComfyUI images as JPEGs without losing the information needed to reopen their workflows. When you use one of the extension’s JPEG nodes, it stores workflow and prompt information inside the image file. You can then drag that JPEG back into ComfyUI to restore the workflow.
This is useful when you want smaller image files but still need to revisit how an image was made. The author reports typical storage savings of 80%–85%. Your actual savings will depend on the images and the files you compare them with.
ComfyUI normally stores complete workflow information in PNG files. Saving an image as an ordinary JPEG can leave that workflow behind. This extension adds a way to carry it with the JPEG instead.
How ComfyUI-JPG-Metadata Works
Think of the JPEG as the finished artwork and its metadata as a note tucked inside the file. The note does not change what you see in the image; it holds information ComfyUI can use later.
- You connect your image to Save Image (JPG) or Preview Image (JPG) in ComfyUI.
- The node creates a JPEG and, when metadata is enabled, places the prompt and available workflow information in the JPEG’s EXIF
UserCommentfield. - When you drag a JPEG saved by the extension into ComfyUI, the extension reads that field. If it finds a complete workflow, it loads the workflow graph. Otherwise, if it finds prompt data, it loads that instead.
For example, you could save a finished image with Save Image (JPG), share or archive the JPEG, and later drag it into ComfyUI to continue working from its saved workflow. This depends on the workflow information still being present in the file.
ComfyUI-JPG-Metadata Features
| Feature | What it means for you |
|---|---|
| Save Image (JPG) | Saves a JPEG with prompt and workflow metadata to ComfyUI’s output/ directory. Use it for images you want to keep. |
| Preview Image (JPG) | Creates a JPEG preview with metadata in a temporary directory. Temporary files are cleaned up, so use Save Image (JPG) for a permanent output unless you explicitly save the preview. |
| Quality slider | Both nodes let you choose a JPEG quality value from 1 to 100. A lower value generally makes a smaller file with more visible compression; a higher value generally preserves more visual detail but uses more storage. |
| Drag-and-drop restore | Drag a .jpg or .jpeg created by the extension into ComfyUI to load its embedded workflow, or its prompt data when a complete workflow is unavailable. |
| PNG-to-JPEG conversion tool | The author also provides a GUI tool for converting older PNG images into JPEGs with workflow information. The supplied documentation does not describe its controls or conversion steps. |
The JPEG nodes take the same general inputs as ComfyUI’s built-in SaveImage and PreviewImage nodes, apart from PNG-specific options, and add the quality setting.
Keep these limits in mind:
- JPEG cannot preserve transparency. If your image has an alpha channel, the extension converts it to RGB when saving.
- The metadata field has a practical capacity of about 64 KB. A very complex workflow may be too large to store there.
- If ComfyUI is started with
--disable-metadata, the extension does not write workflow metadata to the JPEG.
Troubleshooting ComfyUI-JPG-Metadata
Dragging a JPEG into ComfyUI does not restore the workflow
- Check that the file was saved with this extension’s Save Image (JPG) or Preview Image (JPG) node. An ordinary JPEG may not contain a ComfyUI workflow.
- Check whether ComfyUI was run with
--disable-metadata. If so, no metadata was written when the image was saved. - Try another JPEG saved by the extension. A very complex workflow may exceed the metadata field’s practical size limit.
- If a prompt loads but the full node graph does not, the file may contain prompt data without a
workflowentry. The extension uses the prompt as a fallback in that case.
A transparent image no longer has transparency
JPEG does not support alpha channels. The extension converts images with transparency to RGB when saving them as JPEGs. Keep a format that supports transparency when that part of the image matters to your work.
A preview image is no longer available
Preview Image (JPG) writes to a temporary directory whose files are cleaned up. For work you intend to keep, use Save Image (JPG), or explicitly save the preview.
Frequently Asked Questions
Will every JPEG restore a ComfyUI workflow?
No. The drag-and-drop feature reads workflow or prompt information from the JPEG’s metadata. A JPEG without that information cannot supply it.
Does the quality slider change the saved workflow?
The slider controls JPEG image quality. Workflow and prompt information are stored separately as metadata, subject to the metadata size limit.
Will a JPEG always be 80%–85% smaller?
No. That figure is the author’s typical reported saving, not a guarantee for every image.
Which should I use: Save Image (JPG) or Preview Image (JPG)?
Use Save Image (JPG) for an output you want to keep. Use Preview Image (JPG) when you want a temporary preview.
Learn More about ComfyUI-JPG-Metadata
For the extension’s source and any additional information from the author, see the ComfyUI-JPG-Metadata repository.
