PromptFix: You Prompt and We Fix the Photo

Yongsheng Yu, Ziyun Zeng, Hang Hua, Jianlong Fu, Jiebo Luo

TL;DR

PromptFix is a unified, instruction-guided diffusion framework designed to handle a wide variety of low-level image processing and editing tasks. By introducing a massive 1.01-million-sample dataset, a high-frequency guidance sampling method to prevent detail loss from VAE compression, and a VLM-driven auxiliary prompt module, it achieves state-of-the-art performance in image restoration while enabling impressive "blind restoration" without any explicit user commands.

What Problem Does This Paper Address?

While text-to-image diffusion models excel at generating realistic imagery from scratch, adapting them to follow human instructions for low-level image processing (like dehazing, super-resolution, or watermark removal) presents three major hurdles:

  1. Data Scarcity: There is a distinct lack of diverse, high-quality instruction-following datasets tailored specifically for low-level image restoration.
  2. Detail Loss: Latent diffusion models rely on Variational Autoencoders (VAEs) to compress images into a lower-dimensional latent space. While efficient, this compression severely discards high-frequency spatial details, causing restored images to lose sharp textures or fine text.
  3. Degradation Adaptation: When an image is severely degraded, simple human instructions like "fix the photo" do not provide enough context. The model's generative prior—typically trained on clean, high-quality images—struggles to bridge the gap between the heavily corrupted input and the desired clean output.

PromptFix introduces an all-in-one framework to solve these exact issues.

Overview of tasks handled by PromptFix

Methods

The PromptFix architecture builds upon Stable Diffusion 1.5 and integrates a frozen Vision-Language Model (LLaVA-1.5-7B) to assist the image generation process.

The framework introduces two key technical innovations:

  • VLM-based Auxiliary Prompt Module: To handle severe image degradation, the authors use LLaVA to automatically generate an "auxiliary prompt" consisting of a semantic caption ($Q_{\text{semantic}}$) and a defect description ($Q_{\text{defect}}$). Instead of concatenating this text directly with the user's instruction (which would cause truncation issues), PromptFix processes them separately through distinct cross-attention layers within the diffusion U-Net.
  • High-frequency Guidance Sampling (HGS): To combat the spatial information loss caused by VAE compression, the authors modify the VAE decoder. They pass skip-connect features from the VAE encoder through lightweight, trainable LoRA convolutions. During inference, they apply a fidelity constraint that uses both a Fourier filtering operator (high-pass filter) and a Sobel edge detection operator. This constraint explicitly minimizes the structural divergence between the high-frequency components of the input and the generated latents at each denoising step.
The architecture of PromptFix

Datasets

The authors curated the PromptFix Dataset, a large-scale benchmark containing 1,013,320 input-goal-instruction triplets spanning 7 major tasks:

  • Object Removal: Built using the Mulan dataset. The authors also used back-translation (swapping the target and source images) to effortlessly convert object removal data into object creation data.
  • Image Dehazing: Combined from RESIDE, SRRS, Dense-Haze, and O-Haze.
  • Colorization: Grayscale images generated from a subset of LAION-5b and Flickr.
  • Deblurring: Sourced from GoPro, HIDE, LFDOF, RealBlur, TextOCR, and CelebA.
  • Low-light Enhancement: Sourced from LOL, SID, SMID, SDSD, alongside synthetically darkened images.
  • Snow/Watermark Removal: Compiled from benchmarks like Snow100K, CLWD, and LOGO30K.

GPT-4 was leveraged to generate more than 250 diverse, natural language instruction prompts for each task to ensure robust generalization.

Data composition of the PromptFix dataset

Key Insights and Ideas

  • Bypassing the VAE Bottleneck: Standard latent diffusion models inherently blur fine details because the VAE encoder discards high-frequency information. PromptFix proves that you don't need to heavily fine-tune the entire generative model to fix this; adding lightweight LoRA layers to VAE skip-connections, paired with frequency-domain sampling guidance, can perfectly preserve sharp text and fine textures.
  • VLMs as Degradation Translators: Relying solely on human instructions ("fix this") fails when the model's generative prior doesn't understand the specific degradation. Using a VLM to explicitly caption the image's content and its defects provides a rich semantic bridge that allows the diffusion model to perform "blind restoration" without any user prompt at all.
Preservation of low-level details using HGS

Key Results

  • Quantitative Superiority: PromptFix consistently outperformed instruction-driven baselines (InstructP2P, InstructDiff, MGIE) and generalist restoration models (PromptIR, AirNet) across all seven tasks. For example, in colorization, PromptFix achieved an LPIPS score of 0.233 (outperforming InstructP2P's 0.394). In object removal, it achieved a stellar LPIPS of 0.054.
  • Multi-Task & Blind Restoration: Even though it wasn't explicitly trained to handle multiple degradations simultaneously, PromptFix excelled at multi-task processing (e.g., simultaneous desnowing, dehazing, and super-resolution), achieving a PSNR of 22.05 compared to PromptIR's 19.30.
  • Zero-Shot Blind Restoration: When user instructions were left completely blank, the VLM-guided auxiliary prompt successfully drove the restoration process, yielding results comparable to models that received explicit instructions.
Qualitative comparison between PromptFix and other methods

Limitations and Future Work

  • Out-of-Condition Control: In blind restoration mode (where no user prompt is provided), the model occasionally over-relies on the VLM's auxiliary prompt, leading it to perform text-to-image generation rather than strict image restoration.
  • HGS Fidelity Trade-off: High-frequency Guidance Sampling can sometimes cause the restored image to retain too many visual characteristics of the degraded input, representing a delicate trade-off between fidelity and perceptual quality.
  • Instruction Length Sensitivity: The model experiences a slight performance drop when given very long human instructions (40-70 words). The authors suggest augmenting the dataset with longer instructions in future iterations to address this long-tail effect.

Summary updated

BibTeX
@inproceedings{yu2024promptfix,
  author = {Yongsheng Yu and Ziyun Zeng and Hang Hua and Jianlong Fu and Jiebo Luo},
  title = {{PromptFix: You Prompt and We Fix the Photo}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=p1LpXNPmIa},
}
Figure