Spaces:
Runtime error
Runtime error
Fabrice-TIERCELIN
commited on
Commit
•
1f71e06
1
Parent(s):
2430f28
Fix error
Browse filesHi
@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
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,
|