Spaces:
Build error
Build error
emirhanbilgic
commited on
Commit
•
4eeda8f
1
Parent(s):
cc62b3b
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ base_model_path = "SG161222/Realistic_Vision_V6.0_B1_noVAE"
|
|
20 |
base_cache = "model-cache"
|
21 |
vae_model_path = "stabilityai/sd-vae-ft-mse"
|
22 |
ip_cache = "./ip-cache"
|
23 |
-
device = "cuda"
|
24 |
|
25 |
# Setup function to load models and other dependencies
|
26 |
def setup():
|
@@ -57,13 +57,12 @@ def setup():
|
|
57 |
safety_checker=StableDiffusionSafetyChecker.from_pretrained("CompVis/stable-diffusion-safety-checker"),
|
58 |
cache_dir=base_cache,
|
59 |
)
|
60 |
-
pipe = pipe.to(device)
|
61 |
|
62 |
# IP adapter
|
63 |
ip_model = IPAdapterFaceID(
|
64 |
pipe,
|
65 |
-
"ip-cache/ip-adapter-faceid_sd15.bin"
|
66 |
-
device
|
67 |
)
|
68 |
|
69 |
return app, ip_model
|
@@ -134,7 +133,7 @@ def construct_prompt(base_prompt, additional_prompt, gender):
|
|
134 |
|
135 |
return full_prompt
|
136 |
|
137 |
-
|
138 |
def generate_image(face_image_1, face_image_2, additional_prompt, gender):
|
139 |
base_prompt = "portrait of a 6 y.o. child, 8k, HD, happy, perfect eyes, cute"
|
140 |
full_prompt = construct_prompt(base_prompt, additional_prompt, gender)
|
|
|
20 |
base_cache = "model-cache"
|
21 |
vae_model_path = "stabilityai/sd-vae-ft-mse"
|
22 |
ip_cache = "./ip-cache"
|
23 |
+
#device = "cuda"
|
24 |
|
25 |
# Setup function to load models and other dependencies
|
26 |
def setup():
|
|
|
57 |
safety_checker=StableDiffusionSafetyChecker.from_pretrained("CompVis/stable-diffusion-safety-checker"),
|
58 |
cache_dir=base_cache,
|
59 |
)
|
60 |
+
#pipe = pipe.to(device)
|
61 |
|
62 |
# IP adapter
|
63 |
ip_model = IPAdapterFaceID(
|
64 |
pipe,
|
65 |
+
"ip-cache/ip-adapter-faceid_sd15.bin" #device
|
|
|
66 |
)
|
67 |
|
68 |
return app, ip_model
|
|
|
133 |
|
134 |
return full_prompt
|
135 |
|
136 |
+
#@spaces.GPU(duration = 40)
|
137 |
def generate_image(face_image_1, face_image_2, additional_prompt, gender):
|
138 |
base_prompt = "portrait of a 6 y.o. child, 8k, HD, happy, perfect eyes, cute"
|
139 |
full_prompt = construct_prompt(base_prompt, additional_prompt, gender)
|