yue-here commited on
Commit
77e2e9d
1 Parent(s): d2980e7

update app

Browse files
Files changed (1) hide show
  1. app.py +3 -9
app.py CHANGED
@@ -9,16 +9,10 @@ def infer(text, steps):
9
  generated_images = pipeline(
10
  text,
11
  batch_size=1, # Generate one image at a time for each step
12
- # generator=torch.Generator(device='cuda').manual_seed(config.seed), # Generator can be on GPU here
13
- num_inference_steps=steps
14
  ).images
15
 
16
  return generated_images[0]
17
 
18
- demo = gr.Interface(
19
- fn=infer,
20
- inputs=[gr.inputs.Textbox(label="Input Text"), gr.inputs.Slider(minimum=1, maximum=50, step=1, default=10, label="Inference Steps")],
21
- outputs=gr.outputs.Image(type="pil", label="Generated Image")
22
- )
23
-
24
- demo.launch()
 
9
  generated_images = pipeline(
10
  text,
11
  batch_size=1, # Generate one image at a time for each step
12
+ num_inference_steps=int(steps)
 
13
  ).images
14
 
15
  return generated_images[0]
16
 
17
+ demo = gr.Interface(fn=infer, inputs=["text", "number"], outputs="image")
18
+ demo.launch()