Skip to main content
QUICK REVIEW

[Paper Review] Sketch-Guided Text-to-Image Diffusion Models

Andrey Voynov, Kfir Aberman|arXiv (Cornell University)|Nov 24, 2022
Multimodal Machine Learning ApplicationsComputer Science5 citations
TL;DR

This paper introduces a lightweight, trainable latent guidance predictor (LGP) that guides pretrained text-to-image diffusion models using spatial maps like sketches during inference, without retraining the main model. The LGP, a per-pixel MLP trained on few thousand images, learns to translate noisy latent features into spatial guidance, enabling high-quality, diverse image generation that respects sketch layouts—even for freehand or out-of-domain sketches—while maintaining semantic alignment with text prompts.

ABSTRACT

Text-to-Image models have introduced a remarkable leap in the evolution of machine learning, demonstrating high-quality synthesis of images from a given text-prompt. However, these powerful pretrained models still lack control handles that can guide spatial properties of the synthesized images. In this work, we introduce a universal approach to guide a pretrained text-to-image diffusion model, with a spatial map from another domain (e.g., sketch) during inference time. Unlike previous works, our method does not require to train a dedicated model or a specialized encoder for the task. Our key idea is to train a Latent Guidance Predictor (LGP) - a small, per-pixel, Multi-Layer Perceptron (MLP) that maps latent features of noisy images to spatial maps, where the deep features are extracted from the core Denoising Diffusion Probabilistic Model (DDPM) network. The LGP is trained only on a few thousand images and constitutes a differential guiding map predictor, over which the loss is computed and propagated back to push the intermediate images to agree with the spatial map. The per-pixel training offers flexibility and locality which allows the technique to perform well on out-of-domain sketches, including free-hand style drawings. We take a particular focus on the sketch-to-image translation task, revealing a robust and expressive way to generate images that follow the guidance of a sketch of arbitrary style or domain. Project page: sketch-guided-diffusion.github.io

Motivation & Objective

  • To enable precise spatial control over pretrained text-to-image diffusion models during inference using spatial maps from another domain, such as sketches.
  • To overcome the limitations of existing methods that require task-specific training or fail on out-of-domain sketches.
  • To develop a universal, efficient, and domain-agnostic guidance mechanism that works with diverse sketch styles, including freehand drawings.
  • To demonstrate the method's flexibility beyond sketch-to-image by applying it to saliency-guided inpainting and horizon control.
  • To provide a lightweight, differentiable, and per-pixel training mechanism that avoids the need for large-scale retraining.

Proposed method

  • A small, per-pixel Multi-Layer Perceptron (MLP) called the Latent Guidance Predictor (LGP) is trained to map noisy latent features from the diffusion model’s backbone to spatial guidance maps.
  • The LGP is trained in a self-supervised manner using a small dataset of a few thousand images, with loss computed between predicted and target spatial maps (e.g., sketches) at each latent pixel.
  • Training uses the same noise scheduling as the diffusion process, enabling the LGP to generalize across noise levels during sampling.
  • The method operates independently per latent pixel, enabling local, flexible, and style-agnostic guidance without global image-level encoding.
  • During inference, the LGP generates a differential guidance map that is used to steer the denoising process of the pretrained diffusion model.
  • The approach is extended to other spatial guidance tasks, such as saliency-guided inpainting, by adapting the loss function (e.g., binary cross-entropy) and supervision signal.

Experimental results

Research questions

  • RQ1Can a lightweight, per-pixel MLP effectively guide a pretrained text-to-image diffusion model using spatial maps like sketches without fine-tuning the main model?
  • RQ2How well does the method generalize to out-of-domain sketches, such as freehand drawings, compared to in-domain or stylized sketches?
  • RQ3To what extent does the method preserve semantic alignment with the text prompt while enforcing spatial layout from the sketch?
  • RQ4Can the same framework be applied to other spatial guidance tasks beyond sketch-to-image, such as saliency-guided image generation or horizon control?
  • RQ5How does the per-pixel training mechanism compare to global image-level encoding in terms of flexibility, data efficiency, and robustness to style variation?

Key findings

  • The method achieves high-quality image generation that respects both the semantic content of the text prompt and the spatial layout of diverse sketch inputs, including freehand drawings.
  • The LGP generalizes well to out-of-domain sketches due to its per-pixel, local training, avoiding overfitting to specific stroke styles.
  • The approach requires only a few thousand images for training the LGP, significantly reducing data and computational costs compared to training dedicated image-to-image models.
  • The method successfully enables saliency-guided inpainting, where low saliency values in masked regions lead to background completion, while high saliency values result in foreground object generation.
  • The model performs robustly across different noise levels and can be applied effectively even when the text prompt and sketch are semantically ambiguous or conflicting.
  • Failure cases occur with complex, cluttered, or ambiguous sketches, particularly when random noise initialization conflicts with sketch structure, indicating limitations in handling high semantic ambiguity.

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.