Manjushri commited on
Commit
94f2c7b
·
1 Parent(s): 1e77966

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
2
  import modin.pandas as pd
3
  import torch
4
  from PIL import Image
 
5
  from diffusers import DiffusionPipeline
6
  from huggingface_hub import login
7
 
@@ -11,8 +12,8 @@ pipe = pipe.to(device)
11
 
12
  def infer(source_img, prompt, negative_prompt, guide, steps, seed, Strength):
13
  generator = torch.Generator(device).manual_seed(seed)
14
- source_image = gr.Image(source='canvas')
15
- image = pipe(prompt, negative_prompt=negative_prompt, image=source_image, strength=Strength, guidance_scale=guide, num_inference_steps=steps).images[0]
16
  return image
17
 
18
  gr.Interface(fn=infer, inputs=[gr.Image(source='canvas'), gr.Textbox(label = 'Prompt Input Text. 77 Token (Keyword or Symbol) Maximum'), gr.Textbox(label='What you Do Not want the AI to generate.'),
 
2
  import modin.pandas as pd
3
  import torch
4
  from PIL import Image
5
+ import imageio
6
  from diffusers import DiffusionPipeline
7
  from huggingface_hub import login
8
 
 
12
 
13
  def infer(source_img, prompt, negative_prompt, guide, steps, seed, Strength):
14
  generator = torch.Generator(device).manual_seed(seed)
15
+
16
+ image = pipe(prompt, negative_prompt=negative_prompt, image=source_img, strength=Strength, guidance_scale=guide, num_inference_steps=steps).images[0]
17
  return image
18
 
19
  gr.Interface(fn=infer, inputs=[gr.Image(source='canvas'), gr.Textbox(label = 'Prompt Input Text. 77 Token (Keyword or Symbol) Maximum'), gr.Textbox(label='What you Do Not want the AI to generate.'),