savvi83 commited on
Commit
5019a97
·
verified ·
1 Parent(s): a06397b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -20,18 +20,18 @@ pipe = pipe.to(device)
20
 
21
 
22
  # Funzione per generare un'immagine
23
- def generate_image(prompt, neg_prompt, seed, steps):
24
  generator = torch.manual_seed(seed)
25
  start_time = time.time()
26
- image = pipe(prompt, height=resolution[1], width=resolution[0], num_inference_steps=steps, guidance_scale=guidance_scale, generator=generator, negative_prompt=neg_prompt).images[0]
27
  end_time = time.time()
28
  elapsed_time = end_time - start_time
29
  return image, elapsed_time
30
 
31
  demo = gr.Interface(
32
  fn=generate_image,
33
- inputs=["text","text", "slider", "slider"],
34
- outputs=[gr.Image(),"textbox"],
35
  )
36
 
37
  demo.launch()
 
20
 
21
 
22
  # Funzione per generare un'immagine
23
+ def generate_image(prompt, neg_prompt, width=resolution[0], height=resolution[1], seed, steps):
24
  generator = torch.manual_seed(seed)
25
  start_time = time.time()
26
+ image = pipe(prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=guidance_scale, generator=generator, negative_prompt=neg_prompt).images[0]
27
  end_time = time.time()
28
  elapsed_time = end_time - start_time
29
  return image, elapsed_time
30
 
31
  demo = gr.Interface(
32
  fn=generate_image,
33
+ inputs=["text","text","number","number", "slider", "slider"],
34
+ outputs=[gr.Image(),gr.Textbox(label="Elapsed time (seconds)")],
35
  )
36
 
37
  demo.launch()