ASSET: Autoregressive Semantic Scene Editing with Transformers at High Resolutions

Difan Liu, Tobias Hinz, Matthew Fisher, Richard Zhang, Taesung Park, Evangelos Kalogerakis

Introduction

Semantic image editing empowers users to modify images by manipulating underlying segmentation maps—for instance, transforming a grassy field into a body of water. While this task has seen significant progress, achieving high-resolution (1024×1024) results that maintain global structural consistency remains a formidable challenge. Existing methods often face a trade-off between the local detail provided by Convolutional Neural Networks (CNNs) and the global context captured by Transformers. ASSET (Autoregressive Semantic Scene Editing with Transformers) addresses this by introducing a novel attention mechanism that enables high-resolution synthesis with long-range dependencies.

The Context-Resolution Dilemma

Traditional CNN-based approaches are limited by their local receptive fields, often failing to maintain global consistency across large images. While Transformers can model long-range relationships, their standard self-attention mechanism suffers from quadratic complexity; doubling the resolution quadruples the memory and computational requirements.

To mitigate this, previous state-of-the-art models employed "sliding window" attention. However, this approach induces "tunnel vision," where the model only considers nearby pixels. In complex scenes, such as a lake reflecting a distant mountain, sliding windows fail to capture the necessary global relationships, leading to visual artifacts and physical inconsistencies.

Methods: Sparsified Guided Attention (SGA)

ASSET utilizes a VQGAN-based framework, representing images as discrete tokens, combined with a transformer encoder-decoder architecture. The core innovation is Sparsified Guided Attention (SGA), which makes 1024×1024 editing computationally feasible by focusing attention on the most relevant image regions.

The SGA process follows three primary steps:

  1. The Guiding Transformer: The model first processes a downsampled, low-resolution version of the image and the user's edits. At this lower resolution, the transformer can afford "full attention," mapping every pixel's relationship to every other pixel.
  2. Sparsification: The attention map from the low-resolution guide serves as a "cheat sheet." It identifies which distant regions are most critical for the current edit (e.g., identifying that a water pixel must attend to a specific mountain peak to generate a reflection).
  3. High-Resolution Execution: The high-resolution transformer then computes attention only for the "top-K" most important regions identified by the guide, in addition to the immediate local neighborhood.

By reducing attention matrix sparsity to less than 10%, ASSET maintains the ability to "see" across the entire image without the prohibitive memory costs of full attention.

Experimental Evaluation

The authors evaluated ASSET on three major benchmarks: Flickr-Landscape (440,000 high-quality images), COCO-Stuff, and ADE20K.

Visual and Quantitative Performance

ASSET demonstrates a superior ability to generate complex, globally-consistent features such as reflections and shadows that sliding-window models often miss. On the Flickr-Landscape dataset at 1024px, ASSET achieved a Fréchet Inception Distance (FID) of 7.7, significantly outperforming Taming Transformers (10.9) and ImageBART (10.4).

Efficiency and User Preference

SGA is approximately 20x faster than full attention at 1024×1024 resolution and fits within the VRAM limits of a standard high-end GPU (e.g., NVIDIA A100). In contrast, full attention at this resolution would exceed 40GB of VRAM. Furthermore, in a "blind" user study, participants preferred ASSET’s results over 80% of the time compared to other high-resolution baselines.

Key Insights

  • Inherent Sparsity: In image synthesis, a pixel rarely needs to attend to every other pixel. Most relevant information is contained within the local neighborhood and a few key distant regions.
  • Low-Res Proxies: A 256×256 "guide" provides sufficient structural information to accurately predict attention patterns for a 1024×1024 model.
  • Bidirectional Context: Unlike standard autoregressive models that look only at "past" pixels (left-to-right), ASSET’s encoder views the entire unmasked image simultaneously, ensuring seamless blending between new and existing content.

Limitations and Future Work

Despite its successes, ASSET has limitations. The autoregressive sampling process is serial, meaning 1024×1024 edits can take several minutes—precluding real-time use. Additionally, the model uses learned positional embeddings tied to specific resolutions, requiring fine-tuning to move between different image sizes. Finally, because editing occurs in a compressed latent space, minor misalignments or blurring can occasionally occur at the boundaries of the edited regions.

Summary updated

BibTeX
@article{liu2022asset,
  author = {Difan Liu and Tobias Hinz and Matthew Fisher and Richard Zhang and Taesung Park and Evangelos Kalogerakis},
  title = {{ASSET: Autoregressive Semantic Scene Editing with Transformers at High Resolutions}},
  journal = {ACM Trans. Graphics},
  year = {2022},
  url = {https://openreview.net/forum?id=C8qIbq_ARb},
}
Figure