Spaces:
Runtime error
Runtime error
fix invert face
Browse files
app.py
CHANGED
@@ -112,7 +112,7 @@ def execute(image, prompt):
|
|
112 |
img = cv2.imread(image)
|
113 |
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
114 |
|
115 |
-
imgs = [ random_positioning(img)
|
116 |
|
117 |
pipe.load_lora_weights("XLabs-AI/flux-RealismLora", weight_name='lora.safetensors')
|
118 |
response = []
|
@@ -123,7 +123,7 @@ def execute(image, prompt):
|
|
123 |
for image in range(len(imgs)):
|
124 |
current_img = imgs[image]
|
125 |
cv2.imwrite('base_image.jpg', current_img)
|
126 |
-
cv2.imwrite("mask.jpg", maskHead('base_image.jpg'))
|
127 |
|
128 |
im = Image.open('base_image.jpg')
|
129 |
mask = Image.open('mask.jpg')
|
@@ -142,6 +142,9 @@ def execute(image, prompt):
|
|
142 |
).images[0]
|
143 |
response.append(result)
|
144 |
|
|
|
|
|
|
|
145 |
return response
|
146 |
|
147 |
iface = gr.Interface(
|
|
|
112 |
img = cv2.imread(image)
|
113 |
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
114 |
|
115 |
+
imgs = [ random_positioning(img)]
|
116 |
|
117 |
pipe.load_lora_weights("XLabs-AI/flux-RealismLora", weight_name='lora.safetensors')
|
118 |
response = []
|
|
|
123 |
for image in range(len(imgs)):
|
124 |
current_img = imgs[image]
|
125 |
cv2.imwrite('base_image.jpg', current_img)
|
126 |
+
cv2.imwrite("mask.jpg", cv2.bitwise_not(maskHead('base_image.jpg')))
|
127 |
|
128 |
im = Image.open('base_image.jpg')
|
129 |
mask = Image.open('mask.jpg')
|
|
|
142 |
).images[0]
|
143 |
response.append(result)
|
144 |
|
145 |
+
|
146 |
+
new_res = []
|
147 |
+
for image in response:
|
148 |
return response
|
149 |
|
150 |
iface = gr.Interface(
|