
Kontext-Watermark-Remover
[photo content], remove any watermark text or logos from the image while preserving the background, texture, lighting, and overall realism. Ensure the edited areas blend seamlessly with surrounding details, leaving no visible traces of watermark removal.About this LoRA
The Kontext-Watermark-Remover is an adapter for black-forest-lab's FLUX.1-Kontext-dev, designed to precisely remove watermarks and textual content from images while maintaining the original image quality and context.
Examples
Introduction
The Kontext-Watermark-Remover is a specialized LoRA adapter designed for the black-forest-labs/FLUX.1-Kontext-dev model. Its primary function is to precisely remove watermarks, logos, and other textual content from images. The model is engineered to perform this task while carefully maintaining the original image's quality, context, and realism.
Key capabilities include:
- Precise Watermark Removal: Effectively erases unwanted text and logos.
- Context Preservation: Maintains the integrity of the background, textures, and lighting.
- Seamless Integration: Ensures that edited areas blend perfectly with surrounding details, leaving no artifacts or visible traces of removal.
- High-Quality Output: Trained on 150 image pairs to deliver accurate and clean results.
The target use case for this model is for any user needing to clean images by removing distracting watermarks or text overlays without degrading the underlying visual content.
How to Use
This model is designed to be used with the diffusers library in an image-to-image pipeline. Below are the steps to get started, based on the provided demonstration code.
Step 1: Install Required Packages
First, ensure you have the necessary libraries installed:
pip install diffusers torch gradio transformers pillow gradio-imageslider huggingface_hub sentencepiece peft torchvision accelerate
Step 2: Load the Model and Adapter
In your Python script, load the base FLUX.1-Kontext-dev pipeline and then attach the Kontext-Watermark-Remover LoRA weights.
import torch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
# Load the base model
pipe = FluxKontextPipeline.from_pretrained(
"black-forest-labs/FLUX.1-Kontext-dev",
torch_dtype=torch.bfloat16
).to("cuda")
# Load the LoRA adapter
pipe.load_lora_weights(
"prithivMLmods/Kontext-Watermark-Remover",
weight_name="Kontext-Watermark-Remover.safetensors",
adapter_name="watermark_remover"
)
Step 3: Run Inference
To perform watermark removal, activate the adapter and call the pipeline with your input image and the specific trigger prompt.
# Set the adapter for use
pipe.set_adapters(["watermark_remover"], adapter_weights=[1.0])
# Load your image with a watermark
input_image = load_image("path/to/your/image.png").convert("RGB")
# Define the trigger prompt
prompt = "[photo content], remove any watermark text or logos from the image while preserving the background, texture, lighting, and overall realism. Ensure the edited areas blend seamlessly with surrounding details, leaving no visible traces of watermark removal."
# Run the pipeline
result_image = pipe(
image=input_image,
prompt=prompt,
guidance_scale=2.5,
width=input_image.size[0],
height=input_image.size[1],
num_inference_steps=28,
generator=torch.Generator().manual_seed(42),
).images[0]
result_image.save("image_without_watermark.png")
Recommended Settings
- Trigger Prompt: Use the full prompt for best results:
[photo content], remove any watermark text or logos from the image while preserving the background, texture, lighting, and overall realism. Ensure the edited areas blend seamlessly with surrounding details, leaving no visible traces of watermark removal. - Guidance Scale: A value around
2.5is recommended. - Steps: Approximately
28inference steps are suggested for good quality.
Use Cases
The primary use case for the Kontext-Watermark-Remover is the automated cleaning of images. It is particularly effective for:
- Removing Text Watermarks: Erasing copyright notices, usernames, or other text overlays.
- Deleting Logo Watermarks: Seamlessly removing company or stock photo agency logos.
- Cleaning up Signatures: Removing artist or photographer signatures from images.
- Restoring Images: Preparing images for professional use by removing distracting elements while preserving the original composition and quality.
The model's ability to understand and reconstruct backgrounds, textures, and lighting makes it suitable for complex images where the watermark covers detailed areas.
Examples
The model card provides several visual examples demonstrating its effectiveness. These before-and-after comparisons showcase the model's ability to handle various types of watermarks, including:
- Large, semi-transparent text on a movie poster.
- Opaque logos placed on complex backgrounds.
- Signatures and small text overlays on photographs.
In all examples, the final output shows a clean image where the watermark has been completely removed, and the underlying area has been realistically reconstructed to match the surrounding content.
FAQ
Q: What is the full trigger prompt for this model?
A: The recommended prompt is: [photo content], remove any watermark text or logos from the image while preserving the background, texture, lighting, and overall realism. Ensure the edited areas blend seamlessly with surrounding details, leaving no visible traces of watermark removal.
Q: What base model is this LoRA adapter for?
A: This adapter is designed specifically for black-forest-labs/FLUX.1-Kontext-dev.
Q: How was this model trained?
A: The model was trained for 25 epochs on a dataset of 150 image pairs, consisting of 75 images with watermarks and their corresponding 75 clean versions.
Q: Can I use this model for tasks other than watermark removal?
A: This model is highly specialized and trained exclusively for removing watermarks and textual content. Using it for other image editing tasks is not its intended purpose and may produce unpredictable results.
Technical Details
- Base Model:
black-forest-labs/FLUX.1-Kontext-dev - Model Type: LoRA Adapter
- Library:
diffusers - Pipeline: Image-to-Image
Training Parameters
- Dataset: 150 image pairs (75 start, 75 end)
- Epochs: 25
- UNet Learning Rate: 0.00005
- Text Encoder Learning Rate: 0.00001
- LR Scheduler:
constant - Optimizer:
AdamW8bit - Network Dimension (Rank): 64
- Network Alpha: 32
- Sampler:
euler - Training Steps: 2900 (with a 400-step warm-up)


