Commit Graph

15 Commits (84ae5810bf22222ce1622efcec9b8ee6124755cc)

Author SHA1 Message Date
google-labs-jules[bot] ebc30b1cac fix: Address code review feedback from previous PR
This commit implements changes based on the code review feedback
for the recent face swap enhancement features.

Key changes include:

1.  **Error Handling for Color Transfer:**
    *   Wrapped the `apply_color_transfer` call in `swap_face` (within `face_swapper.py`) in a try-except block. If color transfer fails, an error is logged, and the system falls back to using the uncorrected swapped face ROI, preventing pipeline crashes.

2.  **GaussianBlur Kernel Size Validation:**
    *   Added validation logic in `face_swapper.py` for `mouth_mask_blur_kernel_size` and `face_mask_blur_kernel_size`.
    *   A helper function `_validate_kernel_size` ensures that kernel dimensions are positive odd integers. If invalid values are provided via global settings, a warning is logged, and the functions fall back to safe default kernel sizes (e.g., (9,9) for mouth, (5,5) for face).

3.  **Configurable GFPGAN Upscale Factor:**
    *   The `upscale` factor for `GFPGANer` in `face_enhancer.py` is now configurable via `getattr(modules.globals, 'gfpgan_upscale_factor', 2)`, allowing you to adjust this parameter.

4.  **Clarification on Mouth Mask Blur Default:**
    *   Added a comment in `face_swapper.py` explaining that the new default `(9,9)` for `mouth_mask_blur_kernel_size` is a deliberate performance/quality trade-off and that this setting is configurable.

These changes improve the robustness, configurability, and clarity of the recently added features.
2025-06-23 18:02:56 +00:00
google-labs-jules[bot] 74ce8569f5 Jules was unable to complete the task in time. Please review the work done so far and provide feedback for Jules to continue. 2025-06-20 18:51:12 +00:00
NeuroDonu 890beb0eae
fix & add trt support 2025-04-19 16:03:49 +03:00
Pedro Santos 7472dfb694 fix: add match statement
Added for optimization

Co-Authored-By: Zephira <zephira58@protonmail.com>
2024-12-23 06:29:36 +00:00
Pedro Santos 41c6916273 Revert "Update face_enhancer.py"
This reverts commit ed7a21687c.
2024-12-23 06:08:45 +00:00
Kenneth Estanislao ed7a21687c Update face_enhancer.py
change if from before statement to elif, also fix conditional ladder
2024-12-23 12:45:53 +08:00
KRSHH 84ca1dc2f2 Make Face Enhancer Model device Conditional
Added Co-Author

Co-Authored-By: Rishon <rishon@rishon.me>
2024-12-19 21:18:28 +05:30
KRSHH 681c20dbbd Revert "Make Face Enhancer Model device Conditional"
This reverts commit c240f6e31c.
2024-12-19 21:16:56 +05:30
KRSHH c240f6e31c Make Face Enhancer Model device Conditional 2024-12-19 21:12:57 +05:30
Kenneth Estanislao a1d9b73742 Revert "Merge pull request #829 from RishonLi/patch-1"
This reverts commit 5f5fe8890a, reversing
changes made to a9e8f27360.
2024-12-16 22:46:39 +08:00
Rishon de4f765878
Update face_enhancer.py for apple silicon mps 2024-12-14 16:47:07 +08:00
NeuroDonu a840986159
fix path for model 2024-11-09 16:43:13 +03:00
KRSHH 3da987340b
Fix Enhancer for Map Faces 2024-10-15 13:08:03 +05:30
c4fun 6400a80a91 solve the FACE_ENHANCER os problem for non-nt(linux, mac) system 2024-08-07 23:26:47 +08:00
Kenneth Estanislao e616245e3d initial commit
rebranding everything
2023-09-24 21:36:57 +08:00