Warping the Residuals for Image Editing with StyleGAN

Ahmet Burak Yildirim, Hamza Pehlivan, Aysegul Dundar · DOI

Introduction

Editing real-world images within the StyleGAN framework requires a process known as GAN inversion, which maps an image back into the generator's latent space. This process has historically faced a significant trade-off between reconstruction fidelity and editing quality. While low-rate latent spaces like $W+$ offer high editability, they often lose fine details such as jewelry or skin textures. Conversely, high-rate features capture these details perfectly but are "sticky"; they remain at their original pixel coordinates during edits, resulting in "ghosting" or blurry artifacts.

The WarpRes Architecture

The WarpRes framework introduces a novel pipeline to bridge this gap by making high-fidelity residuals dynamic. Building on the previous StyleRes architecture, the key innovation is a Flow Prediction and Warping mechanism that aligns detailed features with semantic transformations.

Methodology

  1. Residual Extraction: The system uses a fixed encoder to establish a base latent code and a trainable encoder to extract high-frequency residuals—the details missing from the base reconstruction.
  2. Flow-Based Alignment: Instead of static addition, WarpRes predicts a dense flow field between the original and edited features. This flow directs the model on how to spatially shift high-resolution residuals (e.g., moving an earring to match a head rotation).
  3. Internal Feature Guidance: To maintain efficiency, the flow is estimated using StyleGAN’s own intermediate feature maps rather than raw pixels, leveraging the rich spatial information already present in the GAN.
  4. Cycle Translation Training: The model is trained using a "round-trip" strategy where it applies a random edit and then attempts to revert it, ensuring the warped residuals can perfectly reconstruct the original input.
An example of a semantic edit (Angry expression) performed using the WarpRes framework.

Key Results and Performance

WarpRes achieves state-of-the-art performance across multiple benchmarks, particularly in maintaining identity during complex edits. On the CelebA-HQ dataset, the method achieved a lower (better) FID of 6.59 and a higher SSIM of 0.91 compared to existing high-fidelity inversion methods.

Qualitatively, WarpRes excels at preserving fine details—such as the specific pattern of a hat or the shape of eyeglasses—ensuring they follow the movement of the subject perfectly without leaving "ghost" trails behind. In pose-change tests, it maintained an Identity (Id) score of 0.74, significantly outperforming previous standards like HyperStyle (0.68).

The original source image before semantic editing.

Limitations and Future Directions

While WarpRes provides excellent 2D spatial movement, it does not possess an explicit 3D understanding of objects. Consequently, it may struggle with extreme rotations where surfaces are occluded or entirely new geometry is revealed. Future work may involve integrating this warping approach with 3D-aware GANs to combine multi-view consistency with high-fidelity 2D detail preservation.

Conclusion

WarpRes effectively solves the "sticky feature" problem in GAN inversion. By treating high-resolution residuals as dynamic components that can be warped in sync with semantic changes, the model enables high-fidelity, artifact-free editing of real-world images.

Summary updated

BibTeX
@article{yildirim2025warping,
  author = {Ahmet Burak Yildirim and Hamza Pehlivan and Aysegul Dundar},
  title = {{Warping the Residuals for Image Editing with StyleGAN}},
  journal = {Int. J. Comput. Vis.},
  year = {2025},
  url = {https://openreview.net/forum?id=ySCi5uYWY7},
}
Figure