Generative Visual Prompt: Unifying Distributional Control of Pre-Trained Generative Models

Chen Henry Wu, Saman Motamed, Shaunak Srivastava, Fernando De la Torre

TL;DR

Generative Visual Prompt (PromptGen) is a unified framework that grants fine-grained distributional control over pre-trained generative models (like GANs and Diffusion models) without requiring retraining or labels. By using Invertible Neural Networks (INNs) to approximate energy-based control signals from off-the-shelf models (like CLIP or classifiers), PromptGen enables efficient, feed-forward sampling for tasks like text-guided synthesis, pose control, and automated de-biasing.

The Challenge: Controllability and Bias in Generative Models

While modern generative models produce stunning, high-fidelity images, they suffer from two major hurdles that limit their practical application: controllability and bias.

First, most models are trained in an unsupervised manner. If you have a general face generator, it is not always clear how to specifically sample "a baby" or "a person with glasses" without performing expensive, architecture-specific "latent space surgery."

Second, generative models act as mirrors of their training data. If a dataset predominantly features specific demographics, the model will over-represent those groups, inheriting and potentially amplifying societal biases. Existing solutions to these problems often require retraining the entire model, are restricted to specific architectures (like StyleGAN), or rely on slow optimization processes (like Markov Chain Monte Carlo) at inference time, making them impractical for real-time use.

Methodology: PromptGen and Invertible Neural Networks

The authors propose PromptGen, a framework that treats control as a problem of "distributional shift" within the latent space of a frozen generator.

The PromptGen framework uses an Invertible Neural Network (INN) to approximate energy-based control, allowing for iterative, feed-forward sampling.

PromptGen achieves this through a clever combination of Energy-Based Models (EBMs) and Amortized Sampling:

  • Energy-Based Control: The desired control (e.g., "make it look like this text prompt") is defined as an energy function. PromptGen leverages off-the-shelf models to provide this energy: CLIP for text guidance, classifiers for specific attributes, and inverse graphics models for physical properties like pose.
  • Amortized Sampling with INNs: Traditionally, sampling from an EBM requires iterative, slow optimization (like Langevin dynamics). PromptGen bypasses this by training an Invertible Neural Network (INN) to learn a mapping from a simple distribution (like a Normal distribution) to the complex, controlled distribution. Once trained, the INN acts as a "visual prompt" that transforms the latent space in a single, lightning-fast feed-forward pass.
  • Iterative Composition: Because the composition of an INN and a generator is itself a generative model, controls can be stacked. For example, you can first apply a text-control prompt and then seamlessly apply a de-biasing prompt on top of it.

Key Insights and Results

PromptGen proves to be highly versatile, successfully applying controls to StyleGAN2, StyleNeRF, NVAE, and Diffusion Autoencoders. This model-agnostic nature sets it apart from previous methods that were often strictly tied to GAN architectures.

PromptGen enables diverse distributional controls, including text-guided synthesis, de-biasing, and pose control.

Uncovering "Reporting Bias" in CLIP

A fascinating discovery made using PromptGen is the identification of a "reporting bias" within CLIP. When the researchers prompted the model for "a person without makeup," the CLIP-guided generation predominantly produced images of women. This occurs because, in human language and image captions, we rarely specify "no makeup" for men. Thanks to PromptGen’s iterative framework, researchers were able to identify this bias and explicitly apply a gender-debiasing prompt to correct the distribution.

Performance and Speed

  • Inference Speed: PromptGen is roughly 100x faster than previous EBM-based sampling methods (like PPGM). It achieves inference in ~0.2 seconds per sample, compared to ~21.5 seconds for optimization-based methods.
  • Superior De-biasing: In head-to-head comparisons for de-biasing binary attributes (like gender and age), PromptGen outperformed or matched state-of-the-art methods like FairStyle, particularly when managing complex combinations of attributes.
  • Identity Preservation: When using inverse graphics models as control, PromptGen successfully generated the same individual in various poses, achieving better identity preservation scores than specialized models like DiscoFaceGAN.

Datasets Evaluated

The researchers rigorously evaluated PromptGen across several high-resolution datasets:

  • FFHQ & MetFaces: For face generation and de-biasing experiments.
  • AFHQ-Cat: For animal category control (e.g., "British Shorthair").
  • Landscape-HQ: For environmental control (e.g., "winter" vs. "autumn").
  • ImageNet & CelebA: For class-embedding space tests and quantitative comparisons against binary attribute de-biasing baselines.

Limitations and Future Work

While powerful, PromptGen operates under a "support set constraint." It is a mode-seeking framework, meaning it can only sample from regions the original base model already knows. It cannot perform "domain adaptation"—if the base model has never seen a specific object, PromptGen cannot force it to create one from scratch. Additionally, the quality of the control is strictly bounded by the accuracy and inherent biases of the external off-the-shelf models used to define the energy functions.

Future work will explore learning more complex energy functions beyond simple classifiers and investigating how to combine PromptGen with domain adaptation techniques to further expand a generator's creative range.

Summary updated

BibTeX
@inproceedings{wu2022generative,
  author = {Chen Henry Wu and Saman Motamed and Shaunak Srivastava and Fernando De la Torre},
  title = {{Generative Visual Prompt: Unifying Distributional Control of Pre-Trained Generative Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=Gsbnnc--bnw},
}
Figure