WaterFlow: Learning Fast & Robust Watermarks using Stable Diffusion

Vinay Shukla, Prachee Sharma, Ryan A. Rossi, Sungchul Kim, Tong Yu, Aditya Grover

TL;DR

WaterFlow is a fast, lightweight, and highly robust image watermarking framework that embeds imperceptible signals directly into the Fourier domain of a pretrained diffusion model's latent space. By replacing slow per-image optimization loops with a universal forward pass through invertible flow layers, it achieves state-of-the-art resistance against complex combination attacks and generative removal while running nearly 90x faster than previous optimization-based methods.

What Problem Does This Paper Address?

As photorealistic generative AI accelerates the spread of synthetic imagery and misinformation, the need for reliable visual watermarking has become critical. However, existing watermarking techniques face a difficult trilemma between computational efficiency, perceptual quality, and robustness.

Traditional watermarks (applied to image pixels or standard frequency domains) are easily erased by modern generative models like Variational Autoencoders (VAEs) and diffusion models, which naturally "clean" and regenerate the image content. Recent diffusion-based watermarking methods attempt to solve this by embedding signals directly into the latent space. However, they either require slow, per-image optimization loops (e.g., ZoDiac), making them impractical for real-world deployment, or demand massive end-to-end retraining of heavyweight networks (e.g., VINE). Furthermore, almost all existing methods falter when hit with "compound perturbations"—combinations of multiple attacks like rotation, blurring, and JPEG compression applied simultaneously.

Methods

WaterFlow (WF) introduces a zero-shot watermarking framework that operates in three distinct phases: training, embedding, and detection.

Overview of WaterFlow showing the generation and detection phases.
  1. Latent Vector Initialization: Given an image $x_0$, the method uses DDIM inversion to map the image back to its latent representation $Z_T$ within a pretrained diffusion model.
  2. Fourier Domain Embedding: The latent representation is transformed into the frequency domain using a Fast Fourier Transform (FFT). An initial circular "Tree-Ring" watermark pattern is implanted.
  3. Trainable Watermark Generation: To make the watermark input-specific and highly resilient, the real and imaginary components of the Fourier-transformed latents are passed through two lightweight neural networks ($H_{\text{real}}$ and $H_{\text{imag}}$). Crucially, these are parameterized by Residual Flow networks (Normalizing Flows), which are inherently invertible and well-suited for transforming Gaussian latents.
  4. Image Generation & Adaptive Enhancement: After injecting the learned watermark into the latent space, an Inverse FFT (IFFT) is applied, and the diffusion model decodes the latent back into a watermarked image $\hat{x}_0$. Finally, an adaptive enhancement step searches for a blending factor $\gamma$ to balance original image fidelity and watermark strength based on a user-defined Structural Similarity Index (SSIM) threshold.

At detection time, the image is inverted back to the latent space, and a fast statistical test based on a non-central $\chi^2$ distribution determines the presence of the watermark.

The authors introduce two inference-time variants from the same trained model: WaterFlow-Robust (WF-R), which prioritizes survival against intense attacks, and WaterFlow-Quality (WF-Q), which prioritizes visual imperceptibility. Users can dynamically toggle between them simply by adjusting the postprocessing SSIM threshold parameter without any retraining.

Datasets

The authors evaluated WaterFlow across three diverse image datasets to test real-world and synthetic performance:

  • MS-COCO: Real-world images spanning everyday scenes, landscapes, and objects.
  • DiffusionDB: Synthetic images generated by users interacting with Stable Diffusion, covering a massive aesthetic and prompt variety.
  • WikiArt: A curated collection of digital artworks across various historical periods and non-photorealistic styles (oil paintings, sketches, abstract art).

Key Insights and Ideas

  • Why Normalizing Flows? The choice of Residual Flows over standard architectures like UNet or MLPs proved crucial. Because Flow networks are invertible, they prevent mode collapse and preserve the expressiveness of the latent space. Dimensionality reduction in UNet and MLP architectures often traps the model in poor localizations, leading to weak watermarks that are easily wiped out by attacks.
Figure 5: Graph of different model architectures used to pa- rameterize Hreal and Himag as well as their robustness on the attack suite.
  • The Power of the Latent Fourier Domain: By combining the semantic richness of diffusion latents with the structural resilience of frequency-domain watermarking, WaterFlow aligns its perturbations with the underlying generative model's structure. This makes the watermark uniquely resistant to generative regeneration attacks (which try to "re-roll" the image pixels).

Key Results

  • Massive Speedups: By utilizing a universal forward pass instead of iterative per-image optimization, WaterFlow embeds watermarks in 6.15 seconds on average. This is comparable to the simple Tree-Ring baseline (5.77s) and nearly 90x faster than ZoDiac (517.68s).
Figure 3: We evaluate the average time it takes to water- mark a single image. We evaluate against two methods that share the same architectural backbone. Our results show that against existing strong baselines like ZoDiac, WF is signifi- cantly faster.
  • Defeating Combination Attacks: In the most challenging evaluation scenarios—where images were subjected to a barrage of simultaneous distortions (blurring, compression, noise, etc.)—WF-R achieved up to a 700% improvement in True Positive Rate (at 1% False Positive Rate) and a 44% improvement in Area Under the Curve (AUC) compared to the next-best baseline. Most other state-of-the-art methods dropped to near-zero detection capability under these compound attacks.
  • Pareto Frontier Dominance: As shown in the benchmarking visualization, both WaterFlow variants occupy the top-right corner of the robustness vs. quality trade-off, outperforming legacy and deep-learning baselines alike.
Figure 1: We showcase visualized robustness vs. perceptual results. We average AUC and SSIM across all three dataset. Results in the upper-right corner are preferred. We observe that WF-R has the highest robustness with competitive qual- ity while WF-Q is one of the best in terms of quality and second place in overall robustness.

Limitations and Future Work

While powerful, WaterFlow has a few limitations noted by the authors:

  • Generative Model Dependency: The framework relies on having access to a known, invertible latent space (like DDIM inversion in Stable Diffusion). It cannot be directly applied out-of-the-box to non-invertible or autoregressive/transformer-based generative models.
  • Domain Generalization: Performance on highly domain-specific imagery, such as satellite data or medical scans, remains unverified.
  • Visual Artifacts: In extreme high-robustness modes, the watermark can occasionally introduce minor visual artifacts, though this can be mitigated using the adaptive enhancement parameter.

Future Directions: The authors point toward jointly fine-tuning the diffusion backbones alongside the watermarking objective and exploring learnable post-processing steps to push the boundaries of visual fidelity even further.

Summary updated

Abstract

The ability to embed watermarks in images is a fundamental problem of interest for computer vision, and is exacerbated by the rapid rise of generated imagery in recent times. Current state-of-the-art techniques suffer from computational and statistical challenges such as the slow execution speed for practical deployments. In addition, other works trade off fast watermarking speeds but suffer greatly in their robustness or perceptual quality. In this work, we propose WaterFlow (WF), a fast and extremely robust approach for high fidelity visual watermarking based on a learned latent-dependent watermark. Our approach utilizes a pretrained latent diffusion model to encode an arbitrary image into a latent space and produces a learned watermark that is then planted into the Fourier Domain of the latent. The transformation is specified via invertible flow layers that enhance the expressivity of the latent space of the pre-trained model to better preserve image quality while permitting robust and tractable detection. Most notably, WaterFlow demonstrates state-of-the-art performance on general robustness and is the first method capable of effectively defending against difficult combination attacks. We validate our findings on three widely used real and generated datasets: MS-COCO, DiffusionDB, and WikiArt.
BibTeX
@misc{shukla2025waterflow,
  author = {Vinay Shukla and Prachee Sharma and Ryan A. Rossi and Sungchul Kim and Tong Yu and Aditya Grover},
  title = {{WaterFlow: Learning Fast \& Robust Watermarks using Stable Diffusion}},
  year = {2025},
  eprint = {2504.12354},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.12354},
}
Figure