WMAdapter: Adding WaterMark Control to Latent Diffusion Models

Hai Ci, Yiren Song, Pei Yang, Jinheng Xie, Mike Zheng Shou

As AI-generated imagery floods the internet, the "wild west" of copyright and provenance has become a central concern for researchers and creators alike. While digital watermarking isn't new, applying it to Latent Diffusion Models (LDMs) like Stable Diffusion has historically forced a painful trade-off: you could have a robust watermark, or you could have a high-quality image, but rarely both.

A new paper from researchers at the National University of Singapore’s Show Lab introduces WMAdapter, a "plug-and-play" watermark plugin that manages to break this deadlock. By treating watermarking as a contextual adaptation task rather than a brute-force modification, WMAdapter offers a way to embed unique, robust keys into images without the tell-tale blurriness or artifacts of its predecessors.

TL;DR

WMAdapter is a lightweight (1.3MB) plugin for the VAE decoder of diffusion models that embeds user-specified 48-bit watermarks during the generation process. By using a content-aware "contextual adapter" and a novel hybrid finetuning strategy, it achieves state-of-the-art image quality and robustness while remaining scalable to millions of unique user keys.

What Problem Does This Paper Address?

Existing diffusion watermarking methods generally fall into two camps, both with significant flaws:

  1. Post-hoc methods: These add watermarks after the image is generated. They are often easy to strip away and don't take advantage of the rich latent space of the generation process.
  2. Diffusion-native methods: These integrate watermarking into the model itself. However, many (like Stable Signature) require finetuning a separate VAE decoder for every single unique key. This is a nightmare for scalability—imagine a service with a million users needing a million different VAE decoders. Other "plugin" attempts often introduce "lens flare" artifacts or significant blurriness because they modify the diffusion process too intrusively.

The gap, therefore, is a method that is scalable (one model, many keys), imperceptible (no artifacts), and robust (survives cropping, JPEG compression, etc.).

Methods

The researchers propose two primary innovations to solve these issues, visualized in the pipeline below:

WMAdapter Pipeline

1. The Contextual Adapter

Instead of generating a generic watermark pattern and "stamping" it onto the latent space, WMAdapter uses a Contextual Adapter. This module consists of six "Fuser" blocks attached to the intermediate layers of the VAE decoder.

  • Content-Awareness: The adapter takes both the watermark bits and the image features as input. This allows the model to "hide" the watermark in areas of high texture or complexity where it is less visible to the human eye, rather than applying it uniformly.
  • Efficiency: At only 1.3MB, it adds a negligible 30ms of overhead to the generation process.

2. Hybrid Finetuning

To eliminate the grid-like artifacts and blurriness seen in other methods, the authors developed a two-stage training strategy:

  • Stage 1: Train the adapter on a large dataset (MS-COCO) while keeping the VAE frozen.
  • Stage 2 (The "Hybrid" part): Jointly finetune the adapter and the VAE decoder on a small dataset to align them perfectly. However—and this is the clever bit—at inference time, they use the original VAE decoder. This "alignment-only" training ensures the adapter learns to work with the VAE's natural distribution without permanently altering (and potentially degrading) the VAE's output quality.

Key Insights and Ideas

  • The "Inference Trick": The most surprising finding is that you can finetune a VAE to "help" the adapter learn, but then discard those VAE changes during actual use. This suppresses the "lens flare" artifacts that plague models like Stable Signature, which rely on a modified decoder.
  • Context is King: Traditional adapters are "context-less"—they don't look at the image. By making the adapter contextual, WMAdapter improves PSNR (image quality) by over 4 dB compared to context-less versions.
  • Scalability via Bits: Because the watermark is an input bitstring rather than a model weight, a single WMAdapter instance can support $2^{48}$ unique keys, making it viable for massive commercial platforms.

Key Results

As shown in the performance comparisons below, WMAdapter excels in both visual fidelity and robustness:

Visual and Quantitative Comparison
  • Superior Image Quality: WMAdapter-I (the hybrid version) achieved a PSNR of 34.8 dB, significantly higher than Stable Signature (29.7 dB) and WOUAF (25.3 dB). Visually, it avoids the color shifts and grid artifacts common in competing methods.
  • Robustness: Under "combined attacks" (simultaneous cropping, JPEG compression, and brightness changes), WMAdapter maintained a bit accuracy of 0.90, outperforming most native diffusion watermarking methods.
  • Tracing Accuracy: In a "needle in a haystack" test with $10^6$ users, the model achieved nearly 100% tracing accuracy, meaning it can correctly identify which user key was used to generate a specific image out of a million possibilities.

Limitations and Future Work

While WMAdapter is a significant step forward, the authors note a few hurdles:

  • Specific Attacks: Like many current methods, it struggles with significant Rotation and Gaussian Noise. This is largely because the underlying watermark decoder (HiDDeN) wasn't trained for these specific distortions.
  • Artifacts in "-F" Variant: The "Fixed" finetuning version (without the hybrid approach) still occasionally produces tiny grid-like artifacts visible upon zooming.
  • Future Directions: The authors suggest that WMAdapter could be extended to video generation models (like AnimateDiff) since they often share the same VAE architecture as image models.

Reference: Ci, H., Song, Y., Yang, P., Xie, J., & Shou, M. Z. (2025). WMAdapter: Adding WaterMark Control to Latent Diffusion Models. Proceedings of the 42nd International Conference on Machine Learning (ICML).

Summary updated

BibTeX
@inproceedings{ci2025wmadapter,
  author = {Hai Ci and Yiren Song and Pei Yang and Jinheng Xie and Mike Zheng Shou},
  title = {{WMAdapter: Adding WaterMark Control to Latent Diffusion Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=xXYGBmpMAj},
}
Figure