NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

HairCLIP: Design Your Hair by Text and Reference Image

Tianyi Wei, Dongdong Chen, Wenbo Zhou, Jing Liao, Zhentao Tan, Lu Yuan, Weiming Zhang, Nenghai Yu

Abstract

HairCLIP is a unified framework designed for high-quality, disentangled hair manipulation. By leveraging the shared embedding space of CLIP and the generative capabilities of StyleGAN, HairCLIP allows users to edit hairstyle and color using either natural language text or reference images. Unlike previous methods that require separate models for specific prompts or complex user interactions, HairCLIP provides a single, flexible solution that preserves identity and background while precisely modifying hair attributes.

Introduction

Editing hair in images is a complex task due to the intricate geometry, texture, and color of hair and its need for seamless integration with the face. Traditional tools often require tedious manual input, such as precise masks or sketches. While recent text-based models like StyleCLIP have simplified this, they often suffer from "entanglement"—where changing hair inadvertently alters the subject's identity or the background—and typically require training separate "mapper" networks for each unique text prompt. HairCLIP addresses these challenges by providing a unified model capable of handling diverse text and image inputs within a single framework.

Original source image before hair manipulation.

Methodology

The HairCLIP architecture is built upon the StyleGAN2 generator, utilizing its hierarchical latent space ($W+$) to achieve disentangled editing.

CLIP-Based Unified Embedding

The core of the system is the use of CLIP (Contrastive Language-Image Pre-Training). Because CLIP maps both images and text into a shared mathematical space, HairCLIP can process a text prompt (e.g., "purple hair") and a reference image of purple hair as functionally equivalent inputs. This eliminates the need for separate architectures for different input modalities.

Hierarchical Latent Mapping

HairCLIP employs three sub-mappers ($M_c, M_m, M_f$) corresponding to the coarse, medium, and fine layers of StyleGAN. Based on the observation that hairstyle is a structural attribute (coarse/medium) and color is a textural attribute (fine), the system selectively injects information:

  • Hairstyle information is fed into the coarse and medium mappers.
  • Color information is directed to the fine mapper.

This semantic layering ensures that changing the hair's shape does not affect its color, and vice versa, while preventing leakage into non-hair regions of the image.

Results and Discussion

HairCLIP demonstrates significant improvements over existing baselines like StyleCLIP and TediGAN. Quantitatively, it achieves a high Identity Similarity (IDS) score of 0.83 and a PSNR of 27.8, indicating superior preservation of the original subject's features and background.

HairCLIP produces realistic hairstyle modifications while maintaining the subject's identity.

Qualitatively, the model avoids common artifacts such as "hallucinated" foreheads or skin tone shifts. Furthermore, it exhibits strong generalization, successfully handling "unseen" descriptions (e.g., "mushroom hairstyle") by leveraging CLIP's broad semantic knowledge. Another key advantage is "unaligned transfer," allowing the model to apply a hairstyle from a profile-view reference image to a front-facing target image without requiring pose alignment.

Conclusion

HairCLIP represents a significant step forward in interactive image editing. By unifying text and image inputs and enforcing semantic disentanglement through hierarchical mapping, it offers a powerful yet user-friendly tool for hair design. While limited by the domain of the underlying StyleGAN model, it provides a robust foundation for future work in multi-modal attribute manipulation.

Summary updated

BibTeX
@inproceedings{wei2021hairclip,
  author = {Tianyi Wei and Dongdong Chen and Wenbo Zhou and Jing Liao and Zhentao Tan and Lu Yuan and Weiming Zhang and Nenghai Yu},
  title = {{HairCLIP: Design Your Hair by Text and Reference Image}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr52688.2022.01754},
}
Figure