Spaces:
Build error
Build error
bugfix: attribute error
Browse files
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
-
import spaces
|
2 |
import gradio as gr
|
3 |
-
|
4 |
import os
|
5 |
import cv2
|
6 |
import torch
|
@@ -105,7 +104,7 @@ def get_negative_prompt(gender):
|
|
105 |
else: # Random
|
106 |
return "(deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime, mutated hands and fingers:1.4), (deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, disconnected limbs, mutation, mutated, ugly, disgusting, amputation"
|
107 |
|
108 |
-
|
109 |
def generate_image(face_image_1, face_image_2, prompt, gender, width, height, num_inference_steps, seed):
|
110 |
if seed is None:
|
111 |
seed = int.from_bytes(os.urandom(4), "big")
|
@@ -115,7 +114,7 @@ def generate_image(face_image_1, face_image_2, prompt, gender, width, height, nu
|
|
115 |
|
116 |
negative_prompt = get_negative_prompt(gender)
|
117 |
|
118 |
-
baby_image_path = morph_faces(face_image_1
|
119 |
|
120 |
def generate_images(faceid_embeds, num_outputs=1):
|
121 |
images = ip_model.generate(
|
@@ -153,4 +152,4 @@ gr_interface = gr.Interface(
|
|
153 |
title="Face Morphing and Image Generation with Stable Diffusion"
|
154 |
)
|
155 |
|
156 |
-
gr_interface.launch()
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
import spaces
|
3 |
import os
|
4 |
import cv2
|
5 |
import torch
|
|
|
104 |
else: # Random
|
105 |
return "(deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime, mutated hands and fingers:1.4), (deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, disconnected limbs, mutation, mutated, ugly, disgusting, amputation"
|
106 |
|
107 |
+
spaces.GPU(duration=40)
|
108 |
def generate_image(face_image_1, face_image_2, prompt, gender, width, height, num_inference_steps, seed):
|
109 |
if seed is None:
|
110 |
seed = int.from_bytes(os.urandom(4), "big")
|
|
|
114 |
|
115 |
negative_prompt = get_negative_prompt(gender)
|
116 |
|
117 |
+
baby_image_path = morph_faces(face_image_1, face_image_2)
|
118 |
|
119 |
def generate_images(faceid_embeds, num_outputs=1):
|
120 |
images = ip_model.generate(
|
|
|
152 |
title="Face Morphing and Image Generation with Stable Diffusion"
|
153 |
)
|
154 |
|
155 |
+
gr_interface.launch(share=True)
|