HairFastGAN: Realistic and Robust Hair Transfer with a Fast Encoder-Based Approach

Maxim Nikolaev, Mikhail Kuznetsov, Dmitry P. Vetrov, Aibek Alanov
2/3/2026

No official code found. Best implementation: AIRI-Institute/HairFastGAN (253 stars, MIT, last commit 2024-11-15).

Abstract

Our paper addresses the complex task of transferring a hairstyle from a reference image to an input photo for virtual hair try-on. This task is challenging due to the need to adapt to various photo poses, the sensitivity of hairstyles, and the lack of objective metrics. The current state of the art hairstyle transfer methods use an optimization process for different parts of the approach, making them inexcusably slow. At the same time, faster encoder-based models are of very low quality because they either operate in StyleGAN's W+ space or use other low-dimensional image generators. Additionally, both approaches have a problem with hairstyle transfer when the source pose is very different from the target pose, because they either don't consider the pose at all or deal with it inefficiently. In our paper, we present the HairFast model, which uniquely solves these problems and achieves high resolution, near real-time performance, and superior reconstruction compared to optimization problem-based methods. Our solution includes a new architecture operating in the FS latent space of StyleGAN, an enhanced inpainting approach, and improved encoders for better alignment, color transfer, and a new encoder for post-processing. The effectiveness of our approach is demonstrated on realism metrics after random hairstyle transfer and reconstruction when the original hairstyle is transferred. In the most difficult scenario of transferring both shape and color of a hairstyle from different images, our method performs in less than a second on the Nvidia V100. Our code is available at https://github.com/AIRI-Institute/HairFastGAN.

View on arXivView PDF

Code Implementations(1)

MIT

[NeurIPS 2024] The official implementation of HairFastGAN. A framework for virtual hairstyle fitting.

25369C, C++Sep 24, 20241 years agoMIT
ganhairstyleneurips-2024stylegan

Cite this paper

@article{nikolaev2026hairfastgan,
  title  = {HairFastGAN: Realistic and Robust Hair Transfer with a Fast Encoder-Based Approach},
  author = {Maxim Nikolaev and Mikhail Kuznetsov and Dmitry P. Vetrov and Aibek Alanov},
  year   = {2026},
  eprint = {2404.01094},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2404.01094},
  url    = {https://arxiv.org/abs/2404.01094},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2404.01094.svg)](https://codeofpaper.com/paper/2404.01094)

Discussion