fffiloni commited on
Commit
df7806f
1 Parent(s): b152191

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -14
app.py CHANGED
@@ -24,20 +24,8 @@ source_img = gr.Image(source="upload", type="numpy")
24
  gallery = gr.Gallery(label="Generated images", show_label=False, elem_id="gallery").style(grid=[2], height="auto")
25
 
26
  def infer(prompt, init_image):
27
- init_image = Image.open(BytesIO(init_image)).convert("RGB")
28
- init_image = init_image.resize((768, 512))
29
- #image = pipe(prompt, init_image=init_image)["sample"][0]
30
- images_list = pipe([prompt] * 2, init_image=init_image, strength=0.75)
31
- images = []
32
- safe_image = Image.open(r"unsafe.png")
33
- for i, image in enumerate(images_list["sample"]):
34
- if(images_list["nsfw_content_detected"][i]):
35
- images.append(safe_image)
36
- else:
37
- images.append(image)
38
-
39
- return images
40
-
41
  print("Great sylvain ! Everything is working fine !")
42
 
43
  title="Stable Diffusion CPU"
 
24
  gallery = gr.Gallery(label="Generated images", show_label=False, elem_id="gallery").style(grid=[2], height="auto")
25
 
26
  def infer(prompt, init_image):
27
+ print(init_image)
28
+ return init_image
 
 
 
 
 
 
 
 
 
 
 
 
29
  print("Great sylvain ! Everything is working fine !")
30
 
31
  title="Stable Diffusion CPU"