Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -18,12 +18,11 @@ pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4",
|
|
18 |
pipe.to(device)
|
19 |
|
20 |
def infer(prompt, init_image):
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
image = pipe(prompt)["sample"][0]
|
27 |
return image
|
28 |
|
29 |
print("Great sylvain ! Everything is working fine !")
|
|
|
18 |
pipe.to(device)
|
19 |
|
20 |
def infer(prompt, init_image):
|
21 |
+
|
22 |
+
init_image = init_image.resize((512, 512))
|
23 |
+
init_image = preprocess(init_image)
|
24 |
+
image = pipe(prompt, init_image=init_image)["sample"][0]
|
25 |
+
|
|
|
26 |
return image
|
27 |
|
28 |
print("Great sylvain ! Everything is working fine !")
|