fffiloni commited on
Commit
30f62bc
1 Parent(s): 5a2437e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
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
- if init_image != None:
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
- else:
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 !")