ComfyUI Extension: Display Image with Mask for ComfyUI
Run ComfyUI workflows without the setup
No installs, no CUDA version roulette, no GPU sitting idle on your bill. Bring a workflow and run it in the browser.
This repository contains a versatile custom node for ComfyUI, Display Image with Mask, designed to offer advanced image viewing, masking, and saving capabilities directly within your workflow.
README
🖼️ Display Image with Mask for ComfyUI
This repository contains a versatile custom node for ComfyUI, Display Image with Mask, designed to offer advanced image viewing, masking, and saving capabilities directly within your workflow.
This node acts as a powerful previewer and a utility tool, combining features often found in separate nodes into a single, convenient package.
Features
- Flexible Image Sources: Load the main image and the mask from:
- Standard ComfyUI
IMAGEinputs (noodles). - Direct URLs (supports
jpg,png,webp,avif, etc.).
- Standard ComfyUI
- Advanced Masking:
- Alpha Channel Masking: Applies the mask as a transparency channel, not just by blacking out pixels. White in the mask is opaque, black is fully transparent.
- Automatic Centering: If the mask is a different size than the image, it is automatically centered before being applied. No more stretching or distortion!
- Color to Grayscale: Automatically converts color masks to grayscale for correct application.
- Invert Mask: A simple toggle to invert the mask's effect.
- Enhanced Format Support:
- Automatically enables
.avifsupport for the entire ComfyUI session, fixing potential loading issues with the nativeLoadImagenode.
- Automatically enables
- Advanced Saving Options:
- Enable/Disable Saving: A simple toggle to save the final processed image.
- Custom Subdirectory: Specify a subfolder within your ComfyUI
outputdirectory. - Custom Filename: Define a base name for your saved files.
- Automatic Timestamping: Automatically append a
YYYYMMDD-HHMMSStimestamp to your filename to prevent overwrites and keep your files organized.
Installation
-
Clone the Repository Navigate to your ComfyUI
custom_nodesdirectory and clone this repository:cd ComfyUI/custom_nodes/ git clone https://github.com/orion4d/ComfyUI_image-display.git -
Install Dependencies Navigate into the cloned directory and install the required Python packages using the
requirements.txtfile. Make sure you have activated your ComfyUI's virtual environment (venv) first.cd YourRepoName/ pip install -r requirements.txt -
Restart ComfyUI Start or restart ComfyUI. The
🖼️ Display Image with Masknode will be available under theutils/displaycategory.
How to Use
- Add the
🖼️ Display Image with Masknode to your workflow. - Provide an input image via the
imagenoodle connection or theimage_urlfield. - Optionally, provide a mask via the
masknoodle connection or themask_urlfield. - Adjust the settings as needed:
invert_mask: To flip the mask's effect.save_image: To enable saving.save_path: To set a custom output subfolder (e.g.,my_project/masks).filename: To set a custom base name for the file.add_datetime: To toggle the timestamp on the filename.
- The node will display a preview of the processed image and pass it along to the next node in your workflow.
Run ComfyUI workflows without the setup
No installs, no CUDA version roulette, no GPU sitting idle on your bill. Bring a workflow and run it in the browser.