Fabrice-TIERCELIN commited on
Commit
1f71e06
1 Parent(s): 2430f28

Hi

@Kvikontent

,

Merging this Pull Request will make your space work. You won't have an error at the execution anymore.

_Successfully tested on my duplicated space:_ https://huggingface.co/spaces/Fabrice-TIERCELIN/SDXL-Turbo-Realtime

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,