Spaces:
Runtime error
Runtime error
Fix error
#1
by
Fabrice-TIERCELIN
- opened
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 |
-
|
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,
|