/djuːm/ DeWaterMark.
中文版
Tired of images covered in watermarks? Look no further!
This tool uses AI (StableDiffusion) to automatically remove watermarks from illustrations.
Disclaimer: All sample images in this repository were generated by me.
Removing watermarks from images does not mean you automatically gain authorization to use those images.
More importantly, removing watermarks involves modifying the images, which is prohibited under many licenses. Please do not misuse the models provided in this repository!
Training Method: No comment.
- Use
dev.py
to process the original image and generate a mask. - In Stable Diffusion (SD), select inpainting mode and upload the mask.
That's it!
- Choose a model with a similar art style; it can significantly improve the quality of the final result.
- Avoid using blurred masks. Set mask blur to at most 1–2. Adjust the mathematical morphology operations provided in the function to refine the mask as needed.
- When in doubt, over-select rather than under-select. At worst, you can manually erase areas incorrectly selected by the model, which is still easier than manually blacking out watermarks.
- For semi-transparent watermarks, set masked areas to use the original image. Otherwise, use the filled option.
- I recommend using Euler a sampler with 20 steps.
- Keep the CFG scale low. If you can get by with 2, don’t use 3. The goal is to avoid breaking the image. Otherwise, the style may look overly "AI-generated." Ignore this if you prefer the AI aesthetic.
- Set denoising strength to 0.2, with a maximum of 0.25. Going higher will likely break the image because this process uses a fine mask.
- In extreme cases, first perform a "Anti-Anti-AI" operation using DeTox.
The inpainting process can also remove residual edges left by the watermark.
Therefore, if you're planning to use ControlNet, you can first remove the watermark as described and then calculate edges from the watermark-free image.
If feasible, create a universal style inpainting model independent of (or based on) Stable Diffusion.
(Supports more types of transparent, image-based, and other watermarks; the following is for demonstration purposes.)
Original Image:
Generated Mask (you could manually erase false positives, but skipped here for demonstration):
Stable Diffusion Inpainting: