StyleGAN-NADA: CLIP-Guided Domain Adaptation of Image Generators

Rinon Gal, Or Patashnik, Haggai Maron, Gal Chechik, Daniel Cohen-Or

Abstract

StyleGAN-NADA introduces a novel method for "blind" domain adaptation of pre-trained image generators. By utilizing the semantic capabilities of CLIP (Contrastive Language-Image Pre-training), the framework shifts a generator from its source domain to a target domain using only natural language prompts. This approach eliminates the need for target-domain images, enabling rapid adaptation to artistic styles, fictional concepts, and rare categories in minutes.

Introduction

Generative Adversarial Networks (GANs), particularly StyleGAN, have set benchmarks in high-fidelity image synthesis. However, their reliance on massive, high-quality datasets limits their applicability to domains where data is scarce or non-existent. While few-shot methods attempt to mitigate this, they still require a handful of reference images. StyleGAN-NADA addresses this bottleneck by treating domain adaptation as a text-guided optimization problem, allowing users to define target domains through simple descriptions like "paintings by Salvador Dalí" or "Pixar characters."

Methodology

The core of StyleGAN-NADA is a training pipeline that leverages a frozen CLIP model to supervise a StyleGAN generator.

Directional CLIP Loss

A primary challenge in text-to-image synthesis is avoiding "adversarial" solutions where the model produces noisy images that satisfy a classifier but lack visual coherence. StyleGAN-NADA introduces a Directional CLIP Loss. Instead of matching a single target embedding, the model calculates a semantic direction in CLIP space between a source text (e.g., "Photo") and a target text (e.g., "Sketch"). The generator is then trained so that the change between its original output and its adapted output aligns with this textual direction.

The StyleGAN-NADA training pipeline utilizing Directional CLIP Loss to align image changes with textual concepts.

Adaptive Layer-Freezing and Reference Generators

To maintain the structural integrity of the original latent space—such as preserving a subject's identity while changing their style—the authors employ two strategies:

  1. Two-Generator Setup: A frozen copy of the original generator provides a constant reference, ensuring the adapted model inherits the original's rich latent structure.
  2. Adaptive Layer-Freezing: The system identifies which layers of the synthesis network are most relevant to the target change. By updating only these layers, the model avoids overfitting and preserves foundational features like basic geometry.

Results and Versatility

StyleGAN-NADA demonstrates remarkable speed and flexibility. Texture-based adaptations (e.g., "Photo to Sketch") are achieved in under a minute, while significant shape modifications (e.g., "Dog to Cat") take approximately ten minutes on a single GPU.

Examples of zero-shot adaptation where human faces are transformed into the distinct artistic style of Fernando Botero.

The method proves superior to traditional few-shot baselines in user studies, particularly in maintaining diversity. While few-shot models often suffer from "mode collapse" when trained on limited images, StyleGAN-NADA's text-based supervision provides a clear semantic anchor that encourages varied outputs.

Discussion and Limitations

While powerful, StyleGAN-NADA is constrained by the "imagination" of the underlying CLIP model. If a concept is poorly represented in CLIP's training data, the adaptation will fail. Additionally, linguistic ambiguity can lead to unexpected results (e.g., "Raphael" referring to the painter or the cartoon turtle). Finally, while the model handles moderate shape changes well, it cannot yet perform massive structural overhauls that deviate fundamentally from the pre-trained model's template.

Conclusion

StyleGAN-NADA represents a significant step toward truly flexible image generation. By bridging the gap between natural language and generative modeling, it opens new avenues for creative expression and data augmentation in domains where traditional data collection is impossible.

Summary updated

BibTeX
@article{gal2021stylegan,
  author = {Rinon Gal and Or Patashnik and Haggai Maron and Gal Chechik and Daniel Cohen-Or},
  title = {{StyleGAN-NADA: CLIP-Guided Domain Adaptation of Image Generators}},
  journal = {ACM Trans. Graphics},
  year = {2021},
  doi = {10.1145/3528223.3530164},
}
Figure