d7c22eb6efca8157c383f81bc2056d2f85bfd4d2
Changes and improvements: 1. Added new formats: GIF, BMP, and TIFF to the `format` options. 2. Updated the `RETURN_TYPES` to include `"IMAGE"` and `"STRING"`. This allows the node to output the saved image for preview and the filename(s) of the saved file(s). 3. Modified the `save_image` function to return the last saved image and a string containing all saved filenames. 4. Updated the saving logic to handle the new formats. 5. Kept the main concept of the node while adding new features and formats. To use this improved node: 1. Replace the existing `ComfyUISaveAs.py` file with this new code. 2. Update your `__init__.py` file to include the new formats if necessary. The node will now display what it's saving, both visually (the last saved image) and by returning the filenames of all saved images. You can connect the output of this node to a preview node to display the saved image and filenames. Signed-off-by: SEKiN <112916323+SEkINVR@users.noreply.github.com>
ComfyUI-SaveAs
A custom node for ComfyUI that allows saving images and videos in multiple formats with a preview feature.
Supported Formats
- Images: PNG, JPG, WEBP, ICO, GIF, BMP, TIFF
- Videos: MP4, MOV
- Others: SVG, PDF, PSD, RAW
Features
- Save images in PNG, JPG, WebP, and ICO formats
- Customize quality for supported formats
- Specify multiple sizes for ICO files
Installation
- Clone this repository into your ComfyUI's
custom_nodesdirectory:
git clone https://github.com/SEkINVR/ComfyUI-SaveAs.git
- Install the required dependencies:
pip install -r requirements.txt
Requirements
This custom node requires the following Python packages:
- Pillow >= 9.0.0
- numpy >= 1.20.0
Usage
- In ComfyUI, you'll find a new node called "Save As" under the "image/io" category.
- Connect an image output to this node.
- Choose your desired format and settings.
- Run the workflow to save your image and generate a preview.
These are usually already installed with ComfyUI, but if you encounter any issues, you can install them manually:
pip install -r requirements.txt
git add .gitignore requirements.txt
git commit -m "Add requirements.txt and .gitignore"
git push
Languages
Python
77.9%
Shell
22.1%