https://github.com/edelvarden/comfyui_image_metadata_extension
Custom node for ComfyUI. It adds additional metadata for saved images, ensuring compatibility with the Civitai website.
https://github.com/edelvarden/comfyui_image_metadata_extension
Last synced: 2 months ago
JSON representation
Custom node for ComfyUI. It adds additional metadata for saved images, ensuring compatibility with the Civitai website.
- Host: GitHub
- URL: https://github.com/edelvarden/comfyui_image_metadata_extension
- Owner: edelvarden
- License: gpl-3.0
- Created: 2024-09-21T19:21:59.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-04-10T02:47:54.000Z (2 months ago)
- Last Synced: 2025-04-10T03:32:31.994Z (2 months ago)
- Language: Python
- Homepage:
- Size: 1.1 MB
- Stars: 26
- Watchers: 3
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-comfyui - **comfyui_image_metadata_extension**
README
# ComfyUI Image Metadata Extension

Custom node for [ComfyUI](https://github.com/comfyanonymous/ComfyUI). It adds additional metadata for saved images, ensuring compatibility with the Civitai website.
This is a fork of [nkchocoai/ComfyUI-SaveImageWithMetaData](https://github.com/nkchocoai/ComfyUI-SaveImageWithMetaData).
**Key differences:**
- Simplified the node by removing unnecessary fields for general use.
- Included metadata for LoRa weights.
- The `subdirectory_name` field allows you to specify a custom name or use mask values to create a subdirectory for saved images. For example, using the mask `%date:yyyy-MM%` ([formatting options](#formatting-options)) will create a directory named with the current year and month (e.g., `2024-10`), organizing your images by the date they were generated.
- The `output_format` defines the saved image format:
- `png`, `jpg`, `webp` – saves in the specified format.
- `png_with_json`, `jpg_with_json`, `webp_with_json` – saves in the chosen format and writes workflow metadata to a JSON file with the same name.
- The `quality` option has the following levels:
- **`max` / `lossless WebP`** – 100%
- **`high`** – 80%
- **`medium`** – 60%
- **`low`** – 30%*(Lower quality, smaller file size. PNG images ignore this setting.)*
- The `metadata_scope` option controls metadata inclusion:
- **`full`** – default metadata + extra metadata.
- **`default`** – same as the SaveImage node.
- **`workflow_only`** – workflow metadata only.
- **`none`** – no metadata.## Installation
### Recommended Installation
Use the [ComfyUI-Manager](https://github.com/ltdrdata/ComfyUI-Manager) to install.
```
comfyui_image_metadata_extension
```### Manual Installation
1. Navigate to the `custom_nodes` directory inside your ComfyUI folder.
2. Clone this repository:```bash
git clone https://github.com/edelvarden/comfyui_image_metadata_extension.git
```## Usage
Basic usage looks like ([workflow.json](assets/workflow.json)):

Lora strings are automatically added to the prompt area, allowing the Civitai website to understand the weights you used. Other metadata is also successfully included.

## Formatting Options
- The `filename_prefix` and `subdirectory_name` support the following options:| Key | Information to be Replaced |
| --------------- | ------------------------------------- |
| %seed% | Seed value |
| %width% | Image width |
| %height% | Image height |
| %pprompt% | Positive prompt |
| %pprompt:[n]% | First n characters of positive prompt |
| %nprompt% | Negative prompt |
| %nprompt:[n]% | First n characters of negative prompt |
| %model% | Checkpoint name |
| %model:[n]% | First n characters of checkpoint name |
| %date% | Date of generation (yyyyMMddhhmmss) |
| %date:[format]% | Date of generation |- See the following table for the identifiers specified by `[format]` in `%date:[format]%`:
| Identifier | Description |
| ---------- | --------------------------- |
| yyyy | Year |
| MM | Month |
| dd | Day |
| hh | Hour |
| mm | Minute |
| ss | Second |