Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
import gradio as gr
|
2 |
from diffusers import StableDiffusionPipeline
|
3 |
import torch
|
4 |
-
|
5 |
|
6 |
model_id = "prompthero/openjourney"
|
7 |
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
8 |
|
9 |
def generate_image(prompt):
|
10 |
image = pipe(prompt).images[0]
|
11 |
-
image =
|
12 |
return image
|
13 |
|
14 |
-
iface = gr.Interface(generate_image, gr.inputs.Textbox(label="Enter a prompt"), gr.outputs.Image())
|
15 |
-
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
from diffusers import StableDiffusionPipeline
|
3 |
import torch
|
4 |
+
import numpy as np
|
5 |
|
6 |
model_id = "prompthero/openjourney"
|
7 |
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
8 |
|
9 |
def generate_image(prompt):
|
10 |
image = pipe(prompt).images[0]
|
11 |
+
image = np.asarray(image)
|
12 |
return image
|
13 |
|
14 |
+
iface = gr.Interface(generate_image, gr.inputs.Textbox(label="Enter a prompt"), gr.outputs.Image(type='numpy'))
|
15 |
+
iface.launch()
|