TL;DR
HairPort is a 3D-aware hairstyle transfer framework that successfully handles large pose and scale discrepancies between source and reference images. By explicitly decoupling hair removal from hair synthesis and leveraging a 3D reconstruction pipeline, it achieves state-of-the-art results in preserving both the source identity and the reference hair geometry.
What Problem Does This Paper Address?
Hairstyle transfer is a highly sought-after feature for virtual try-on systems, augmented reality, and digital entertainment. However, existing 2D methods (whether based on GANs or diffusion models) typically fail when the source person and the reference hair image have significantly different head poses, viewpoints, or scales.
When a large pose gap exists, 2D warping cannot accurately synthesize the occluded or missing parts of a hairstyle. Furthermore, trying to simultaneously erase the original hair and generate a new style often introduces blended artifacts, distorts the head shape, or causes the subject's facial identity to drift.
Methods
HairPort overcomes these challenges by breaking the hairstyle transfer task into three distinct, sequential stages:
- Bald Conversion (Stage 1): To create a clean canvas, the framework first removes the source hair using a custom Bald Converter. This module adapts FLUX.1 Kontext via LoRA using an "in-context" training strategy. By organizing inputs into a 2x2 grid (containing the original image, a bald version, and their respective segmentation masks), the model leverages multi-modal attention to exchange fine-grained facial details. A parametric 3D head model (FLAME) provides structural guidance to ensure the reconstructed scalp matches the true head geometry.
- 3D-Aware Hair Transfer (Stage 2): To bridge the viewpoint gap, the reference image is lifted into 3D using an off-the-shelf image-to-3D model (e.g., Hi3DGen). The system aligns the 3D reference mesh with the source image's 2D landmarks to optimize camera parameters, re-renders the hair from the source's perspective, and applies a 2D affine warp to perfectly match the source's head shape.
- Flow-Matching Hair Synthesis (Stage 3): Finally, a conditional flow-matching generator (FLUX.2 9B) takes the bald source image and the geometry-aligned reference hair to synthesize the final photorealistic image, seamlessly blending the new hairstyle while preserving the original background and identity.
Datasets
- Baldy (New Dataset): The authors introduced a new synthetic dataset containing 6,000 pixel-aligned, identity-consistent hair-bald image pairs. Generated using SMPL-X body models, BEDLAM clothing, and physically modeled hair strands rendered in Blender, it provides the paired supervision necessary to train the Bald Converter.
- CelebA-HQ: A standard benchmark dataset used to quantitatively evaluate the framework's performance against existing baseline models.
Key Insights and Ideas
- Decoupling is Crucial: Separating hair removal from hair generation simplifies the generative task. Erasing the hair first eliminates the ambiguity of simultaneous editing, preventing the model from simply changing hair color instead of structure.
- In-Context Layouts for Image Editing: Training the diffusion model on a 2x2 grid layout allows the network to implicitly learn structural and textural relationships across different states (hairy vs. bald) without complex architectural modifications.
- Lifting to 3D Restores Missing Views: Purely 2D models cannot hallucinate the back or side of a head accurately if it wasn't visible in the reference. Explicit 3D reconstruction provides the necessary spatial conditioning to handle full 360-degree or highly oblique pose changes.
Key Results
- Quantitative Performance: On the face-aligned CelebA-HQ benchmark, HairPort outperformed prior state-of-the-art methods (including HairFastGAN, Stable-Hair, and HairFusion), achieving the highest scores in hairstyle similarity ($\text{DINO}_{\text{hair}} = 0.83$), identity preservation ($\text{IDS} = 0.74$), and non-hair consistency ($\text{SSIM}_{\text{nh}} = 0.83$).
- User Preference: In a user study, participants overwhelmingly preferred HairPort over baseline methods, capturing 76.57% of the votes for hair accuracy and 78.95% for attribute preservation.
- Ablation Studies: Removing the 3D alignment component severely degraded hairline placement under large pose changes, confirming that 3D reasoning is essential for geometric consistency.
Limitations and Future Work
- Upstream Error Propagation: Because the pipeline relies on an off-the-shelf image-to-3D model, any reconstruction artifacts—such as incorrect hair color or oversmoothed textures—will propagate directly into the final synthesized image.
- Computational Overhead: The multi-stage pipeline is computationally heavy, taking approximately 5 to 7 minutes per image on an NVIDIA H100 GPU. This bottleneck prevents the system from being used in real-time applications.
- Future Directions: The authors plan to explore parallelization, model distillation, and quantization to reduce runtime, alongside extending the framework to support video-based hairstyle editing.
Summary updated