Manjushri commited on
Commit
4e4f2f6
1 Parent(s): db03ca3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -11
app.py CHANGED
@@ -25,19 +25,9 @@ def img2img(source_img, prompt, strength):
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
- def txt2img(prompt):
29
- image=pipe(prompt=prompt, num_inference_steps=3, guidance_scale=0.0).images[0]
30
- return image
31
-
32
- def demo(prompt):
33
- with gr.Tab("Img2Img"):
34
- img2img(prompt)
35
- with gr.Tab("Txt2Img"):
36
- txt2img(prompt)
37
- return image
38
  title="SDXL Turbo Inpainting CPU"
39
  description="Inpainting with SDXL Turbo <br><br> <b>Please use square .png image as input, 512x512, 768x768, or 1024x1024</b>"
40
- gr.Interface(fn=demo, inputs=[gr.Image(source="upload", tool="sketch", label="Source Image"),
41
  gr.Textbox(label='What you want the AI to Generate, 77 Token limit'),
42
  gr.Slider(minimum=.5, maximum=1, value=.75, step=.025, label='Strength')],
43
  outputs='image',
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="SDXL Turbo Inpainting CPU"
29
  description="Inpainting with SDXL Turbo <br><br> <b>Please use square .png image as input, 512x512, 768x768, or 1024x1024</b>"
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')],
33
  outputs='image',