hideosnes commited on
Commit
2331805
1 Parent(s): 8e7422e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -4
app.py CHANGED
@@ -1,3 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  from diffusers import StableDiffusionXLInpaintPipeline
2
  import gradio as gr
3
  import numpy as np
@@ -20,13 +44,13 @@ def img2img(source_img, prompt, strength):
20
  imageio.imwrite("data_mask.png", source_img["mask"])
21
  src = resize(768, "data.png")
22
  src.save("src.png")
23
- mask = resize(768, "data_mask.png")
24
  mask.save("mask.png")
25
  image = pipe(prompt=prompt, image=src, mask_image=mask, num_inference_steps=6, strength=strength, guidance_scale=0.0).images[0]
26
  return image
27
-
28
- title="GoldExtra Zeichnung zu 2.5D"
29
- description="OpenCV.js > i2i > 3D"
30
  gr.Interface(fn=img2img, inputs=[gr.Image(source="upload", tool="sketch", label="Source Image"),
31
  gr.Textbox(label='What you want the AI to Generate, 77 Token limit'),
32
  gr.Slider(minimum=.5, maximum=1, value=.75, step=.025, label='Strength')],
 
1
+
2
+ Hugging Face's logo Hugging Face
3
+ Spaces:
4
+ Manjushri
5
+ /
6
+ SDXL-Turbo-Inpainting-CPU
7
+ App
8
+ Files
9
+ Community
10
+ 3
11
+ SDXL-Turbo-Inpainting-CPU
12
+ / app.py
13
+ Manjushri's picture
14
+ Manjushri
15
+ Update app.py
16
+ 4e4f2f6
17
+ verified
18
+ raw
19
+ history
20
+ blame
21
+ contribute
22
+ delete
23
+ No virus
24
+ 1.59 kB
25
  from diffusers import StableDiffusionXLInpaintPipeline
26
  import gradio as gr
27
  import numpy as np
 
44
  imageio.imwrite("data_mask.png", source_img["mask"])
45
  src = resize(768, "data.png")
46
  src.save("src.png")
47
+ mask = resize(768, "data_mask.png")
48
  mask.save("mask.png")
49
  image = pipe(prompt=prompt, image=src, mask_image=mask, num_inference_steps=6, strength=strength, guidance_scale=0.0).images[0]
50
  return image
51
+
52
+ title="SDXL Turbo Inpainting CPU"
53
+ description="Inpainting with SDXL Turbo <br><br> <b>Please use square .png image as input, 512x512, 768x768, or 1024x1024</b>"
54
  gr.Interface(fn=img2img, inputs=[gr.Image(source="upload", tool="sketch", label="Source Image"),
55
  gr.Textbox(label='What you want the AI to Generate, 77 Token limit'),
56
  gr.Slider(minimum=.5, maximum=1, value=.75, step=.025, label='Strength')],