Skip to main content
QUICK REVIEW

[Paper Review] clip2latent: Text driven sampling of a pre-trained StyleGAN using denoising diffusion and CLIP

Justin N. M. Pinkney, Chuan Li|arXiv (Cornell University)|Oct 5, 2022
Generative Adversarial Networks and Image SynthesisComputer Science8 citations
TL;DR

This paper introduces clip2latent, a method that enables text-to-image generation by training a conditional diffusion model to sample latent vectors for a pre-trained StyleGAN, using CLIP embeddings as guidance—without fine-tuning or external text-image data. The approach achieves high-resolution (1024×1024), high-fidelity image synthesis in under a second with minimal training compute and strong alignment to text prompts.

ABSTRACT

We introduce a new method to efficiently create text-to-image models from a pre-trained CLIP and StyleGAN. It enables text driven sampling with an existing generative model without any external data or fine-tuning. This is achieved by training a diffusion model conditioned on CLIP embeddings to sample latent vectors of a pre-trained StyleGAN, which we call clip2latent. We leverage the alignment between CLIP's image and text embeddings to avoid the need for any text labelled data for training the conditional diffusion model. We demonstrate that clip2latent allows us to generate high-resolution (1024x1024 pixels) images based on text prompts with fast sampling, high image quality, and low training compute and data requirements. We also show that the use of the well studied StyleGAN architecture, without further fine-tuning, allows us to directly apply existing methods to control and modify the generated images adding a further layer of control to our text-to-image pipeline.

Motivation & Objective

  • To enable text-to-image generation using only a pre-trained StyleGAN and CLIP, without fine-tuning or external data.
  • To develop a conditional diffusion model that maps CLIP text embeddings to StyleGAN latent codes for image synthesis.
  • To achieve high-resolution, high-fidelity image generation with minimal computational cost and no need for labeled image-text pairs.
  • To preserve the controllability of StyleGAN’s hierarchical latent space for downstream editing.
  • To demonstrate that pre-trained models can be connected via diffusion to create powerful, data-free text-to-image pipelines.

Proposed method

  • Train a denoising diffusion model to generate StyleGAN latent codes conditioned on CLIP text embeddings, leveraging CLIP’s aligned image-text space.
  • Use CLIP’s frozen image and text encoders to embed prompts and guide latent sampling without requiring paired training data.
  • Condition the diffusion model on CLIP’s text embeddings to generate StyleGAN W-space latents that correspond to semantically relevant images.
  • Sample from the diffusion model at inference to produce high-resolution (1024×1024) images directly in the StyleGAN latent space.
  • Leverage the hierarchical structure of StyleGAN’s latent space to enable fine-grained editing via known latent direction methods.
  • Ensure generated latents lie within the valid manifold of StyleGAN’s latent space by design, avoiding artifacts common in optimization-based methods.

Experimental results

Research questions

  • RQ1Can a conditional diffusion model be trained to generate StyleGAN latents from CLIP text embeddings without any labeled image-text data?
  • RQ2Can this method achieve high-resolution (1024×1024) image generation with high fidelity and minimal artifacts?
  • RQ3Does the use of a pre-trained, frozen StyleGAN enable controllable image editing through known latent space directions?
  • RQ4How does the performance of this data-free method compare to existing text-to-image models that require fine-tuning or paired data?
  • RQ5Can the approach be generalized to non-face generative models, such as landscape-style GANs?

Key findings

  • The method generates high-resolution (1024×1024) images from text prompts with high CLIP alignment and minimal artifacts, achieving strong perceptual quality.
  • Inference is fast, producing megapixel-scale images in under one second using the pre-trained StyleGAN.
  • The diffusion model is trained without any text-image paired data, relying solely on CLIP’s pre-existing alignment between text and image embeddings.
  • Generated latents naturally lie within the valid manifold of StyleGAN’s W space, enabling high-quality editing with known latent direction methods like InterfaceGAN.
  • The approach generalizes to non-face models, as demonstrated with a 256×256 StyleGAN3 landscape model trained on the LHQ dataset.
  • The method outperforms optimization-based latent inversion in editability and artifact reduction, as shown in qualitative comparisons.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.