Spaces:
Running
Running
Commit ·
8bcbc72
1
Parent(s): d69a33b
Enable source hair+neck transfer by default (HairFastGAN on GPU, BiSeNet fallback)
Browse files- web_app.py +5 -3
web_app.py
CHANGED
|
@@ -736,9 +736,11 @@ def api_swap():
|
|
| 736 |
swapped, source, faces_src[0], faces_tgt[0], strength=0.85
|
| 737 |
)
|
| 738 |
|
| 739 |
-
# 5.
|
| 740 |
-
# on GPU
|
| 741 |
-
|
|
|
|
|
|
|
| 742 |
hf_portrait = None
|
| 743 |
try:
|
| 744 |
hf_portrait = transfer_hair(face_bgr=swapped, shape_bgr=source,
|
|
|
|
| 736 |
swapped, source, faces_src[0], faces_tgt[0], strength=0.85
|
| 737 |
)
|
| 738 |
|
| 739 |
+
# 5. HAIR + NECK — transfer the SOURCE's hairstyle onto the result.
|
| 740 |
+
# HairFastGAN (StyleGAN) on GPU/with HF token for a realistic hairline;
|
| 741 |
+
# the BiSeNet warp otherwise. ON by default so the swap carries the
|
| 742 |
+
# user's own hair + neck (set swap_hair=0 for a fast face-only swap).
|
| 743 |
+
if request.form.get("swap_hair", "1") in ("1", "true", "on"):
|
| 744 |
hf_portrait = None
|
| 745 |
try:
|
| 746 |
hf_portrait = transfer_hair(face_bgr=swapped, shape_bgr=source,
|