Extensions/ComfyUI Save WebP Meta Node
ComfyUI Extension

ComfyUI Save WebP Meta Node

Save WebP images with A1111-compatible generation parameters and ComfyUI prompt/workflow metadata.

By ukr8b3g-cmyk·Created 5 months ago·Updated 17 days ago· 4
ukr8b3g-cmyk/ComfyUI-save-webp-meta-node
Nodes1
On cloudLocal install
Categoryimage/save
Stars4
Updated17 days ago
Readme

save_webp_meta

ComfyUI node for saving images with metadata.

<img width="669" height="850" alt="image" src="https://github.com/user-attachments/assets/9ddb231b-aff1-4233-b488-421108459422" />

Overview

This custom node saves ComfyUI-generated images with embedded metadata so they can be viewed in prompt viewers such as SD Prompt Reader, Tiefsee, and Infinite Image Browsing.

Compatible viewers:

As a bonus, saved images can be dragged into the prompt field of A1111-based Stable Diffusion WebUI tools such as Forge or NEO to recover part of the prompt data. Because ComfyUI and A1111-based tools use different samplers, schedulers, and graph structures, the imported result may not be exact.

Japanese / 日本語

v1.2.2: Choose a save folder per node

Enter an absolute folder path in output_directory. Leave it blank to use ComfyUI's standard output folder. Put the file name prefix in filename_prefix, which also accepts a relative subfolder.

| Field | Example | | --- | --- | | output_directory | D:\SD_PIC\Comfyui_w | | filename_prefix | P3_image_MultiangleCamera | | file_format | webp | | quality | 70 |

This saves files such as D:\SD_PIC\Comfyui_w\P3_image_MultiangleCamera_00001_.webp. The node shows a preview from ComfyUI's temporary folder. The chosen path is saved in the workflow and may be embedded in exported images. Restart ComfyUI and refresh the browser after updating. Existing workflows can use the same node.

v1.2.1 fixes

Zero-strength CLIP LoRAs no longer produce misleading single-strength tags. Filename node references prefer runtime values; unknown or duplicate references remain unresolved. Image-less diagnostics now match the bundled schema. Existing image files and raw workflow metadata are unchanged.

CLIP強度0のLoRA誤タグ、ファイル名の古い画面値優先、画像なし診断Schemaの3件を修正しました。既存画像とraw workflowの保存形式は変更していません。

v1.2.0: model and prompt-path metadata

Save WEBP Meta now supports H3 static-frame/custom-sampler paths, paired image-edit encoders, multiple text encoders, native LoRA stacks, and source-verified H3 Designer / Krea2 BBOX pure prompt compilers. It uses only the saving image's upstream execution path and preserves unknown values rather than borrowing another sampler's settings. Actual output dimensions are used after resizing.

See supported paths, source pins and limitations and change history. This is metadata extraction support, not a claim that every model was GPU-tested. The public node and existing image formats are unchanged; no new mandatory dependency was added.

Recent Change (v1.1.0 history)

  • Added Qwen Image 2.1 and Krea2 metadata support, including output-slot-aware positive/negative prompt resolution.
  • Metadata now follows the image's active sampler, model, text encoder, VAE, and LoRA path when available. Disabled LoRAs are excluded.
  • Handles ConditioningZeroOut, ComfySwitchNode, and current ComfyUI ResolutionSelector workflows. Existing PNG/EXIF storage and piexif>=1.1.3 remain unchanged.

Metadata Compatibility

Save WEBP Meta writes two kinds of metadata:

  • A1111-compatible generation parameters
  • ComfyUI prompt and workflow metadata for drag-and-drop workflow restore

A1111-compatible fields include the following when available:

  • Positive prompt
  • Negative prompt
  • Steps
  • Sampler
  • CFG scale
  • Seed
  • Size
  • Model
  • Model family
  • Text encoder
  • VAE
  • Denoising strength
  • LoRA tags
  • LoRA hashes
  • Clip skip
  • RNG source
  • Eta noise seed delta
  • Emphasis
  • Method

ComfyUI restore metadata includes:

  • prompt
  • workflow

Installation

Search for Save WEBP Meta in ComfyUI Manager. Manager reads requirements.txt to install piexif with the node. <img width="1009" height="209" alt="1782109385-gYfI3MLQbFzCJqK51dVHnopE" src="https://github.com/user-attachments/assets/3c608696-fe24-4ee5-811f-fb2fa6ad5408" />

For a manual Git install, clone the repository into custom_nodes.

cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/ukr8b3g-cmyk/ComfyUI-save-webp-meta-node save_webp_meta
  1. Install piexif with the Python that runs ComfyUI.
  2. Restart ComfyUI.
  3. Check the node list for Save WEBP Meta under image/save.

Install Without Git Clone

You can also install this node without using git clone.

Zip install:

  1. Open the GitHub repository page.
  2. Click Code, then Download ZIP.
  3. Extract the ZIP file.
  4. Rename the extracted folder to save_webp_meta.
  5. Move it into ComfyUI/custom_nodes/.
  6. Install piexif.
  7. Restart ComfyUI.

Manual file install:

  1. Create ComfyUI/custom_nodes/save_webp_meta/.
  2. Copy the repository files into that folder.
  3. Install piexif.
  4. Restart ComfyUI.

Update

If installed with git clone, update with:

cd /path/to/ComfyUI/custom_nodes/save_webp_meta
git pull

If installed from a ZIP file or by manual copy:

  1. Download the latest repository ZIP.
  2. Extract it.
  3. Replace the old ComfyUI/custom_nodes/save_webp_meta/ files with the new files.
  4. Keep any personal backup files outside the node folder.
  5. Restart ComfyUI.

Supported Formats

  • webp
  • webp_lossless
  • png
  • jpg
  • avif

Metadata storage by format:

| Format | A1111-compatible metadata | ComfyUI prompt/workflow restore | | --- | --- | --- | | png | PNG parameters | PNG prompt / workflow | | webp | EXIF UserComment | EXIF prompt / workflow | | webp_lossless | EXIF UserComment | EXIF prompt / workflow | | jpg | EXIF UserComment | EXIF prompt / workflow | | avif | EXIF UserComment | EXIF prompt / workflow |

For maximum compatibility with SD Prompt Reader and ComfyUI drag-and-drop restore, png, webp, or webp_lossless is recommended.

avif metadata is written when the local Pillow build supports AVIF, but some external readers may not display AVIF files or read AVIF EXIF metadata.

Dependencies

Required:

  • ComfyUI
  • Pillow
  • piexif 1.1.3 or later
  • numpy
  • torch

Install piexif manually

Open a terminal in the Save WEBP Meta node folder. Run this command using the Python environment that runs ComfyUI.

python -m pip install -r requirements.txt

For ComfyUI Windows Portable, open PowerShell in the folder containing python_embeded and ComfyUI, then run this command.

.\python_embeded\python.exe -s -m pip install -r ".\ComfyUI\custom_nodes\save_webp_meta\requirements.txt"

If the node folder has a different name, use its actual name in the path. Restart ComfyUI after installing the dependency.

Check format support:

python -c "from PIL import features; print('webp', features.check('webp')); print('avif', features.check('avif')); import piexif; print('piexif ok')"

Dependency Troubleshooting

In most ComfyUI environments, Pillow, numpy, and torch are already installed. If metadata saving fails, check the optional or format-specific dependencies first.

Check dependencies:

python -c "from PIL import features; import piexif; print('webp', features.check('webp')); print('avif', features.check('avif')); print('piexif ok')"

If you see piexif is required to write EXIF metadata, follow the manual installation steps.

If webp is False, install or update Pillow in the ComfyUI Python environment:

python -m pip install -U Pillow

If avif is False, your Pillow build does not support AVIF. Possible fixes:

  • Update Pillow.
  • Use another Python environment where Pillow was built with AVIF support.
  • Use png, webp, webp_lossless, or jpg instead.

If metadata is written but not shown in an external app:

  • Test the same workflow with png.
  • Check whether the reader supports EXIF for that format.
  • Avoid image optimizers, editors, social media sites, and upload services that strip metadata.
  • For maximum compatibility, use png or webp_lossless.

OS and Environment Notes

This node is intended to work on Windows, Linux, and macOS ComfyUI environments. Format support depends more on the Python environment and Pillow build than on the OS itself.

  • png: Supported in most environments.
  • jpg: Supported in most environments.
  • webp: Requires Pillow with WebP support.
  • webp_lossless: Requires Pillow with WebP support.
  • avif: Requires Pillow with AVIF support.

avif support varies the most across OS, Python, and Pillow installation methods. Even when metadata is written correctly, some external apps may not display AVIF files or read AVIF EXIF metadata.

Main Files

  • webp_save.py: main node implementation
  • __init__.py: ComfyUI node registration
  • _import_check.py: dependency check helper
  • README.md: documentation
  • LICENSE: MIT license

Default Values

  • filename_prefix: comfy_%model%_%date%
  • file_format: webp
  • quality: 70
  • output_directory: blank (ComfyUI's output directory)

These defaults favor ComfyUI metadata viewers and keep the saved file name compact by default. You can still change quality manually in the node for each workflow or run.

Filename Patterns

  • %seed%
  • %width%
  • %height%
  • %pprompt:N%
  • %nprompt:N%
  • %model:N%
  • %date%
  • %date:FORMAT%
  • %NodeTitle.WidgetName%

Troubleshooting

  • Restart ComfyUI after installing or updating this node.
  • If metadata is missing, first test with png.
  • Image editors, optimizers, social media sites, and upload services may strip metadata.
  • Save Image (Websocket) does not preserve metadata.
  • ComfyUI workflow restoration depends on embedded prompt and workflow data.
  • External prompt readers may not fully interpret complex workflows that use many custom nodes.

Japanese

SD Prompt Reader、Tiefsee、Infinite Image Browsing などのプロンプトビューアで、ComfyUI 生成画像のメタデータを確認しやすくするためのカスタムノードです。

対応ビューア:

A1111 系の Stable Diffusion WebUI、Forge、NEO などでは、保存画像から一部の生成パラメータを読み取れる場合があります。 ComfyUI と A1111 系ではサンプラー、スケジューラー、ノード構造が異なるため、完全に同じ結果を再現できるとは限りません。

v1.2.2:ノードごとに保存先を指定

output_directory に保存先フォルダの絶対パスを入力します。空欄の場合は ComfyUI の標準出力フォルダを使います。filename_prefix にはファイル名の先頭部分を指定します。相対サブフォルダも指定できます。

| 項目 | 設定例 | | --- | --- | | output_directory | D:\SD_PIC\Comfyui_w | | filename_prefix | P3_image_MultiangleCamera | | file_format | webp | | quality | 70 |

この例では D:\SD_PIC\Comfyui_w\P3_image_MultiangleCamera_00001_.webp のように保存されます。プレビューは ComfyUI の一時フォルダから表示します。指定パスはワークフローに保存され、出力画像に埋め込まれる場合があります。更新後は ComfyUI を再起動し、ブラウザーを更新してください。保存済みワークフローでは既存ノードをそのまま使えます。

v1.2.0:画像モデルとプロンプト経路の対応拡張

H3静止画・Custom Sampler・複数Text Encoder・標準LoRAスタックと、検証済みH3 Designer/Krea2 BBOXの最終プロンプト取得を追加しました。保存する画像の上流だけを追跡し、未知の値は別Samplerから補いません。保存時の実画像寸法を記録します。

対応範囲・検証済みソース・制約を確認してください。未知のMiniBoxや変更されたコンパイラーではプロンプトは部分対応となりますが、IMAGEと元Workflowの保存は維持します。公開入力・保存形式・必須依存関係は変更していません。実モデルのGPU生成や実画面の受け入れ確認とは区別します。

最近の変更(v1.1.0の履歴)

  • Qwen Image 2.1 と Krea2 のメタデータに対応し、同じノードの出力スロットから出る Positive / Negative を区別します。
  • 保存画像につながる Sampler、Model、Text Encoder、VAE、LoRA を優先して追跡し、無効な LoRA は除外します。
  • ConditioningZeroOut、ComfySwitchNode、現行 ComfyUI の ResolutionSelector に対応しました。PNG / EXIF の保存形式と piexif>=1.1.3 は維持しています。

メタデータ互換性

Save WEBP Meta は、次の2種類のメタデータを書き込みます。

  • A1111 互換の生成パラメータ
  • ComfyUI でワークフローを復元するための prompt と workflow

A1111 互換メタデータには、取得できる範囲で次の情報が含まれます。

  • Positive prompt
  • Negative prompt
  • Steps
  • Sampler
  • CFG scale
  • Seed
  • Size
  • Model
  • Model family
  • Text encoder
  • VAE
  • Denoising strength
  • LoRA tags
  • LoRA hashes
  • Clip skip
  • RNG source
  • Eta noise seed delta
  • Emphasis
  • Method

ComfyUI 復元用メタデータには、次の情報が含まれます。

  • prompt
  • workflow

対応形式

  • webp
  • webp_lossless
  • png
  • jpg
  • avif

形式ごとのメタデータ保存方法:

| 形式 | A1111 互換メタデータ | ComfyUI 復元用メタデータ | | --- | --- | --- | | png | PNG parameters | PNG prompt / workflow | | webp | EXIF UserComment | EXIF prompt / workflow | | webp_lossless | EXIF UserComment | EXIF prompt / workflow | | jpg | EXIF UserComment | EXIF prompt / workflow | | avif | EXIF UserComment | EXIF prompt / workflow |

SD Prompt Reader などのプロンプトリーダーと、ComfyUI へのドラッグアンドドロップ復元の両方を重視する場合は、png、webp、webp_lossless の使用を推奨します。

avif もメタデータを書き込みますが、Pillow 側の AVIF 対応が必要です。また、外部ビューアやプロンプトリーダーによっては AVIF 画像を表示できない、または AVIF の EXIF メタデータを読めない場合があります。

依存関係

必要なもの:

  • ComfyUI
  • Pillow
  • piexif 1.1.3 以降
  • numpy
  • torch

piexif の手動インストール

Save WEBP Meta のノードフォルダーでターミナルを開き、ComfyUI が使う Python 環境で次のコマンドを実行します。

python -m pip install -r requirements.txt

ComfyUI Windows Portable では、python_embeded と ComfyUI が並ぶフォルダーを開き、そこで PowerShell を起動して次のコマンドを実行します。

.\python_embeded\python.exe -s -m pip install -r ".\ComfyUI\custom_nodes\save_webp_meta\requirements.txt"

ノードフォルダー名が異なる場合は、コマンド内の save_webp_meta を実際の名前に置き換えてください。インストール後に ComfyUI を再起動します。

形式対応の確認:

python -c "from PIL import features; print('webp', features.check('webp')); print('avif', features.check('avif')); import piexif; print('piexif ok')"

依存関係のトラブル対処

多くの ComfyUI 環境では、Pillow、numpy、torch はすでに入っています。 メタデータ保存に問題がある場合は、まずオプション依存関係や形式ごとの対応状況を確認してください。

依存関係の確認:

python -c "from PIL import features; import piexif; print('webp', features.check('webp')); print('avif', features.check('avif')); print('piexif ok')"

piexif is required to write EXIF metadata が出た場合は、手動インストール手順に従ってください。

webp が False の場合は、ComfyUI の Python 環境で Pillow を更新してください。

python -m pip install -U Pillow

avif が False の場合は、その Pillow ビルドが AVIF に対応していません。 対処法:

  • Pillow を更新する
  • AVIF 対応の Pillow が使える別の Python 環境を使う
  • png、webp、webp_lossless、jpg のいずれかを使う

メタデータは書き込まれているのに外部アプリで表示されない場合:

  • 同じワークフローを png で試す
  • そのリーダーが対象形式の EXIF を読めるか確認する
  • メタデータを削除する画像編集ソフト、最適化ツール、SNS、アップロードサービスを避ける
  • 互換性を重視する場合は png または webp_lossless を使う

OS と環境依存

このノードは Windows、Linux、macOS の ComfyUI 環境で動作することを想定しています。 ただし、実際の対応形式は OS そのものよりも Python 環境と Pillow のビルドに依存します。

  • png: 多くの環境で利用できます。
  • jpg: 多くの環境で利用できます。
  • webp: Pillow が WebP に対応している必要があります。
  • webp_lossless: Pillow が WebP に対応している必要があります。
  • avif: Pillow が AVIF に対応している必要があります。

特に avif は、OS、Python、Pillow のインストール方法によって対応状況が変わりやすい形式です。 保存側でメタデータを書き込めても、外部アプリ側が AVIF 表示や AVIF の EXIF 読み取りに対応していない場合は表示または読み取りができないことがあります。

主なファイル

  • webp_save.py: ノード本体
  • __init__.py: ComfyUI へのノード登録
  • _import_check.py: 依存関係確認用ヘルパー
  • README.md: 説明
  • LICENSE: MIT ライセンス

初期値

  • filename_prefix: comfy_%model%_%date%
  • file_format: webp
  • quality: 70
  • output_directory: 空欄(ComfyUI の標準出力フォルダ)

これらの初期値は、ComfyUI 側のメタデータ閲覧を想定しつつ、ファイル名が長くなりすぎないようにしています。 quality は各ワークフローや実行時にノード上で手動変更できます。

インストール

ComfyUI Manager で Save WEBP Meta を検索してインストールします。Manager は requirements.txt を読み取り、ノードと一緒に piexif をインストールします。

Git で手動導入する場合は、custom_nodes にクローンします。

cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/ukr8b3g-cmyk/ComfyUI-save-webp-meta-node save_webp_meta
  1. ComfyUI が使う Python で piexif をインストールします。
  2. ComfyUI を再起動します。
  3. ノード一覧の image/save に Save WEBP Meta が表示されることを確認します。

git clone を使わないインストール方法

git clone を使わずにインストールすることもできます。

ZIP でインストールする場合:

  1. GitHub のリポジトリページを開きます。
  2. Code から Download ZIP を選びます。
  3. ZIP ファイルを展開します。
  4. 展開したフォルダ名を save_webp_meta に変更します。
  5. ComfyUI/custom_nodes/ に移動します。
  6. piexif をインストールします。
  7. ComfyUI を再起動します。

手動でファイルを配置する場合:

  1. ComfyUI/custom_nodes/save_webp_meta/ を作成します。
  2. リポジトリ内のファイルをそのフォルダにコピーします。
  3. piexif をインストールします。
  4. ComfyUI を再起動します。

アップデート方法

git clone でインストールした場合:

cd /path/to/ComfyUI/custom_nodes/save_webp_meta
git pull

ZIP または手動コピーでインストールした場合:

  1. 最新のリポジトリ ZIP をダウンロードします。
  2. ZIP ファイルを展開します。
  3. 古い ComfyUI/custom_nodes/save_webp_meta/ 内のファイルを新しいファイルで置き換えます。
  4. 個人的なバックアップファイルがある場合は、ノードフォルダの外に置いてください。
  5. ComfyUI を再起動します。

注意事項

  • インストールまたは更新後は ComfyUI を再起動してください。
  • メタデータが保存されない場合は、まず png で動作確認してください。
  • 画像編集ソフト、最適化ツール、SNS、アップロードサービスを通すとメタデータが削除されることがあります。
  • Save Image (Websocket) はメタデータを保持しません。
  • ComfyUI でのワークフロー復元には、画像内の prompt と workflow が必要です。
  • 多数のカスタムノードを使った複雑なワークフローは、外部プロンプトリーダー側で完全に解釈できない場合があります。