aditya-rAj19 commited on
Commit
8bcbc72
·
1 Parent(s): d69a33b

Enable source hair+neck transfer by default (HairFastGAN on GPU, BiSeNet fallback)

Browse files
Files changed (1) hide show
  1. 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. (optional) HAIR SWAP — only when explicitly requested. HairFastGAN
740
- # on GPU, else the BiSeNet warp. Off by default (can mangle the hair).
741
- if request.form.get("swap_hair", "0") in ("1", "true", "on"):
 
 
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,