Kvikontent commited on
Commit
63a3f35
1 Parent(s): 2430f28

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -8,11 +8,7 @@ pipe = DiffusionPipeline.from_pretrained("stabilityai/sdxl-turbo")
8
  def generate_image(prompt):
9
  # Run the diffusion model to generate an image
10
  output = pipe(prompt, num_inference_steps=50, guidance_scale=7.5)
11
- image_tensor = output.images[0]
12
- image_array = image_tensor.cpu().numpy().transpose(1, 2, 0)
13
- image_array = (image_array * 255).astype(np.uint8)
14
- image = Image.fromarray(image_array)
15
- return image
16
 
17
  gr_interface = gr.Interface(
18
  fn=generate_image,
 
8
  def generate_image(prompt):
9
  # Run the diffusion model to generate an image
10
  output = pipe(prompt, num_inference_steps=50, guidance_scale=7.5)
11
+ return output.images[0]
 
 
 
 
12
 
13
  gr_interface = gr.Interface(
14
  fn=generate_image,