Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SaveImageWEBP Node for Saving Images in WebP Format #6708

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TechnoByteJS
Copy link
Contributor

This pull request introduces a new node, SaveImageWEBP, which allows users to save images in the WebP format. As WebP images are typically 25-35% smaller than PNGs with comparable quality.

This node:

  • Works exactly like the SaveImage node, but saves in WebP instead of PNG.
  • Lets users choose between lossless and lossy compression, adjust quality levels, and select encoding methods (default, fastest, or slowest).
  • Supports embedding metadata (e.g., prompts and additional info) into the WebP files using Exif tags, and is compatible with ComfyUI's existing metadata system. Metadata handling uses Exif tags, just like the SaveAnimatedWEBP node.

This pull request introduces a new node, `SaveImageWEBP`, which allows users to save images in the WebP format. As WebP images are typically 25-35% smaller than PNGs with comparable quality.

This node: 
 - Works exactly like the `SaveImage` node, but saves in WebP instead of PNG.
 - Lets users choose between lossless and lossy compression, adjust quality levels, and select encoding methods (`default`, `fastest`, or `slowest`).
 - Supports embedding metadata (e.g., prompts and additional info) into the WebP files using Exif tags, and is compatible with ComfyUI's existing metadata system. Metadata handling uses Exif tags, just like the `SaveAnimatedWEBP` node.
@comfyanonymous
Copy link
Owner

There is a "SaveAnimatedWebp" node which saves regular webps if the batch size is 1.

@TechnoByteJS
Copy link
Contributor Author

TechnoByteJS commented Feb 13, 2025

@comfyanonymous

I'm well aware of the SaveAnimatedWebp node, but as you said, that node is not usable for saving static images at a batch size larger than 1.

I rarely ever generate at a batch size of 1, and from what I've seen in other people's workflows, they also usually generate at a batch size larger than 1.

Which makes the SaveAnimatedWebp not usable for static images.

And having SaveAnimatedWebp node be the intended way for saving static images will confuse users a lot.

This SaveImageWEBP node solves that problem.

@ltdrdata
Copy link
Collaborator

Oh, that's right. Currently, to save multiple batch static images as WebP, the batch needs to be converted into a list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants