Introduction
This workflow leverages advanced AI tools like SAM, GroundingDINO, and Differential Diffusion, integrated with ComfyUI, to efficiently remove or add watermarks to multiple images at once. By combining segmentation, masking, and inpainting techniques, it produces clean and professional results at scale. For watermark addition, text-based prompts enable the creation of high-quality custom watermarks tailored to each input image.
SAM and GroundingDINO Segmentation
The SAM (Segment Anything Model) and GroundingDINO modules are employed to identify and segment specific regions in an image. These regions, such as watermarks or logos, are masked for further processing, ensuring precise targeting without affecting other areas of the image.
Read moreļ¼https://github.com/IDEA-Research/Grounded-Segment-Anything
Workflow Overview
How to use this workflow?
Watermark Removal
Step 1: Load Image
Use the Load Image node to upload the original image containing the watermark.
Step 2: Input Text Prompt
Add a Text Prompt Input node to allow custom guidance (e.g., "Remove watermark") or use a default prompt if left blank.
Step 3: Inpainting and Refinement
Use the CLIP Text Encode node for additional guidance to ensure logical composition.
Step 4: Watermark Segmentation
Use the SAM and GroundingDINO Segmentation nodes to generate a mask for the watermark.
Step 5: Export the Clean Image
Use the Save Image node to save the final image without the watermark. Adjust the resolution and file format as needed.
Watermark Addition
Step 1: Load Image
Use the Load Image or Load Image List From Dir node to upload one or multiple images for watermarking.
Step 2: Upload Finished Watermark Image
Input the watermark reference image in the Load Image node.
Step 3: Export the Watermarked Image
Use the Save Image node to export the final image with the watermark. Configure the file name and format for easy identification and distribution.