← Open Source
Xiaojiu-z

Stable-Hair

Pytorch Implementation of: "Stable-Hair: Real-World Hair Transfer via Diffusion Model" (AAAI 2025).

ModelsVision modelsPython
Open on GitHub
Momentum
+1stars in 24 hours+0.2%
540
Stars
62
Forks
+1
This week
1
Contributors
Created 2024-07-16 · Updated 2026-10-16 · #6787 today
Top developers

Xiaojiu-z/Stable-Hair is ranked 6,787 with 540 stars.

Same-category comparison

Xiaojiu-z/Stable-Hair is ranked 6,787 among these 8 peers; Mengqi-Lei/count-anything is ranked 6,785.

Same-category comparison
NameRankMetrics
Tencent-Hunyuan/Hunyuan3D-Part6,763
Language:
Python
Stars:
548
Forks:
62
Description:
Hunyuan 3D Part Segmentation and Generation Pipeline.
NVlabs/PointWorld6,770
Language:
Python
Stars:
546
Forks:
42
Description:
PointWorld: Scaling 3D World Models for In-The-Wild Robotic Manipulation.
MiniMax-AI/MiniMax-M2.16,779
Stars:
544
Forks:
44
Description:
MiniMax M2.1, a SOTA model for real-world dev & agents.
Mengqi-Lei/count-anything6,785
Language:
Python
Stars:
540
Forks:
45
Description:
Code and implementation guidelines for the paper ✨Counting Anything. Project Page: https://mengqi-lei.github.io/count-anything-projectpage/.
pariskang/CMLM-ZhongJing6,811
Language:
Jupyter Notebook
Stars:
532
Forks:
60
Description:
The first-ever Traditional Chinese Medicine large language model - "CMLM-ZhongJing". Inspired by the profound wisdom of the ancient Chinese medical master Zhang Zhongjing, it is a pre-trained large language model designed specifically for the field of Traditional Chinese Medicine.
JetAstra/SDAR6,815
Language:
Python
Stars:
531
Forks:
43
Description:
SDAR (Synergy of Diffusion and AutoRegression), a large diffusion language model(1.7B, 4B, 8B, 30B).
NVlabs/GENMO6,820
Language:
Python
Stars:
528
Forks:
56
End2End-Diffusion/REPA-E6,827
Language:
Python
Stars:
526
Forks:
33
Description:
[ICCV 2025] Official implementation of the paper: REPA-E: Unlocking VAE for End-to-End Tuning of Latent Diffusion Transformers.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryModels
SubcategoryVision models
KeywordsComputer vision, Image production, Model architecture
Stars540
Forks62
Contributors1
Created date2024-07-16
Updated date2026-10-16
Stars in 1 day1
Stars in 7 days1
Rank6,787
Previous rank6,966
Rank change179
7-day stars rank11,426
Previous 7-day stars rank16,110
7-day stars rank change4,684
Total stars rank18,225
Previous total stars rank18,220
Total stars rank change-5
CountryChina
README summary

Official Repo for Stable-Hair **Stable-Hair: Real-World Hair Transfer via Diffusion Model** *Yuxuan Zhang, Qing Zhang, Yiren Song, Jichao Zhang, Hao Tang, Jiaming Liu* Abstract Current hair transfer methods struggle to handle diverse and intricate hairstyles, limiting their applicability in real-world scenarios. In this paper, we propose a novel diffusion-based hair transfer framework, named Stable-Hair, which robustly transfers a wide range of real-world hairstyles to user-provided faces for virtual hair try-on. To

achieve this goal, our Stable-Hair framework is designed as a two-stage pipeline. In the first stage, we train a Bald Converter alongside stable diffusion to remove hair from the user-provided face images, resulting in bald images. In the second stage, we specifically designed a Hair Extractor and a Latent IdentityNet to transfer the target hairstyle with highly detailed and high-fidelity to the bald image. The Hair Extractor is trained to encode reference images with the desired

hairstyles, while the Latent IdentityNet ensures consistency in identity and background. To minimize color deviations between source images and transfer results, we introduce a novel Latent ControlNet architecture, which functions as both the Bald Converter and Latent IdentityNet. After training on our curated triplet dataset, our method accurately transfers highly detailed and high-fidelity hairstyles to the source images. Extensive experiments demonstrate that our approach achieves state-of-the-art performance compared to existing hair transfer methods. - [x] Training code

Getting Started Environment Setup Our code is built on the diffusers version of Stable Diffusion, In our experiments, we use model version v1-5. If you have a diffusers version of controlnet configured, you can use this repository directly. Download them and save to the directory and . Inference Gradio demo We provide a simple gr demo for more flexible use. Limitation The Results are influenced by the effect of the first stage, if the bald converter does not go well

, the effect of hair transfer is not good. By the way, this released model only trained on a small dataset (6k images for stage1, 2w images for stage2) and all the face images are from FFHQ datasets which means they were cropped and aligned. From my practice, using video and full body datasets to finetune this model is a good way to improve, due to some restrictions the improved model will not be publicly available. If you want to expand

the border of this model, feel free to contact me.

Frequently asked questions

How many stars and forks are recorded?

Xiaojiu-z/Stable-Hair has 540 stars and 62 forks.

What is the repository rank?

Xiaojiu-z/Stable-Hair is ranked 6,787.

What language and category are recorded?

Xiaojiu-z/Stable-Hair has 540 stars, uses Python and belongs to Models.

Which repository is closest in rank?

Xiaojiu-z/Stable-Hair is compared with Mengqi-Lei/count-anything, ranked 6,785 with 540 stars.

README

Official Repo for Stable-Hair

Stable-Hair: Real-World Hair Transfer via Diffusion Model

Yuxuan Zhang, Qing Zhang, Yiren Song, Jichao Zhang, Hao Tang, Jiaming Liu

Abstract

Current hair transfer methods struggle to handle diverse and intricate hairstyles, limiting their applicability in real-world scenarios. In this paper, we propose a novel diffusion-based hair transfer framework, named Stable-Hair, which robustly transfers a wide range of real-world hairstyles to user-provided faces for virtual hair try-on. To achieve this goal, our Stable-Hair framework is designed as a two-stage pipeline. In the first stage, we train a Bald Converter alongside stable diffusion to remove hair from the user-provided face images, resulting in bald images. In the second stage, we specifically designed a Hair Extractor and a Latent IdentityNet to transfer the target hairstyle with highly detailed and high-fidelity to the bald image. The Hair Extractor is trained to encode reference images with the desired hairstyles, while the Latent IdentityNet ensures consistency in identity and background. To minimize color deviations between source images and transfer results, we introduce a novel Latent ControlNet architecture, which functions as both the Bald Converter and Latent IdentityNet. After training on our curated triplet dataset, our method accurately transfers highly detailed and high-fidelity hairstyles to the source images. Extensive experiments demonstrate that our approach achieves state-of-the-art performance compared to existing hair transfer methods.

Todo List

    • [x] Stage1 inference code
    • [x] Stage1 pre-trained weights
    • [x] Stage2 inference code
    • [x] Stage2 pre-trained weights
    • [x] Training code

Getting Started

Environment Setup

Our code is built on the diffusers version of Stable Diffusion, In our experiments, we use model version v1-5. If you have a diffusers version of controlnet configured, you can use this repository directly.

git clone https://github.com/Xiaojiu-z/Stable-Hair.git
cd Stable-Hair

Pretrained Models

Google Drive. Download them and save to the directory models/stage1 and models/stage2.

Inference

python infer_full.py

Gradio demo

We provide a simple gr demo for more flexible use.

python gradio_demo_full.py

Limitation

The Results are influenced by the effect of the first stage, if the bald converter does not go well, the effect of hair transfer is not good. By the way, this released model only trained on a small dataset (6k images for stage1, 2w images for stage2) and all the face images are from FFHQ datasets which means they were cropped and aligned. From my practice, using video and full body datasets to finetune this model is a good way to improve, due to some restrictions the improved model will not be publicly available. If you want to expand the border of this model, feel free to contact me.

Cite

@misc{zhang2024stablehairrealworldhairtransfer,
      title={Stable-Hair: Real-World Hair Transfer via Diffusion Model}, 
      author={Yuxuan Zhang and Qing Zhang and Yiren Song and Jiaming Liu},
      year={2024},
      eprint={2407.14078},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2407.14078}, 
}
Nearby in the ranking
Similar items