Spaces:
Paused
Paused
Rishi Desai
commited on
Commit
·
7d09a23
1
Parent(s):
453e82b
renaming for clarity
Browse files- face_enhance.py +1 -1
- test.py +2 -2
face_enhance.py
CHANGED
@@ -314,7 +314,7 @@ def save_comfy_images(images, output_dirs):
|
|
314 |
pil_image.save(output_dirs[idx])
|
315 |
|
316 |
|
317 |
-
def
|
318 |
initialize_models() # Ensure models are loaded
|
319 |
main(face_image, input_image, output_image, dist_image, positive_prompt, id_weight)
|
320 |
|
|
|
314 |
pil_image.save(output_dirs[idx])
|
315 |
|
316 |
|
317 |
+
def face_enhance(face_image: str, input_image: str, output_image: str, dist_image: str = None, positive_prompt: str = "", id_weight: float = 0.75):
|
318 |
initialize_models() # Ensure models are loaded
|
319 |
main(face_image, input_image, output_image, dist_image, positive_prompt, id_weight)
|
320 |
|
test.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import argparse
|
2 |
import os
|
3 |
import shutil
|
4 |
-
from face_enhance import
|
5 |
|
6 |
def parse_args():
|
7 |
parser = argparse.ArgumentParser(description='Face Enhancement Tool')
|
@@ -69,7 +69,7 @@ def process_face(input_path, ref_path, output_path=None, id_weight=0.75):
|
|
69 |
comfy_ref_path = os.path.relpath(scratch_ref, "./ComfyUI/input")
|
70 |
comfy_input_path = os.path.relpath(scratch_input, "./ComfyUI/input")
|
71 |
|
72 |
-
|
73 |
|
74 |
print(f"Enhanced image saved to: {output_path}")
|
75 |
print(f"Working files are in: {scratch_dir}")
|
|
|
1 |
import argparse
|
2 |
import os
|
3 |
import shutil
|
4 |
+
from face_enhance import face_enhance
|
5 |
|
6 |
def parse_args():
|
7 |
parser = argparse.ArgumentParser(description='Face Enhancement Tool')
|
|
|
69 |
comfy_ref_path = os.path.relpath(scratch_ref, "./ComfyUI/input")
|
70 |
comfy_input_path = os.path.relpath(scratch_input, "./ComfyUI/input")
|
71 |
|
72 |
+
face_enhance(comfy_ref_path, comfy_input_path, output_path, dist_image=f"{output_path}_dist.png", id_weight=id_weight)
|
73 |
|
74 |
print(f"Enhanced image saved to: {output_path}")
|
75 |
print(f"Working files are in: {scratch_dir}")
|