Spaces:
Runtime error
Runtime error
juancopi81
commited on
Commit
•
7114cb6
1
Parent(s):
a16984d
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
from stable_diffusion_tf.stable_diffusion import StableDiffusion as StableDiffusionPy
|
2 |
import gradio as gr
|
3 |
from tensorflow import keras
|
|
|
4 |
|
5 |
keras.mixed_precision.set_global_policy("float32")
|
6 |
# load keras model
|
@@ -21,7 +22,9 @@ def generate_images(prompt: str, num_steps: int, unconditional_guidance_scale: i
|
|
21 |
batch_size=1,
|
22 |
)
|
23 |
|
24 |
-
|
|
|
|
|
25 |
|
26 |
|
27 |
# pass function, input type for prompt, the output for multiple images
|
|
|
1 |
from stable_diffusion_tf.stable_diffusion import StableDiffusion as StableDiffusionPy
|
2 |
import gradio as gr
|
3 |
from tensorflow import keras
|
4 |
+
from PIL import Image
|
5 |
|
6 |
keras.mixed_precision.set_global_policy("float32")
|
7 |
# load keras model
|
|
|
22 |
batch_size=1,
|
23 |
)
|
24 |
|
25 |
+
img = Image.fromarray(generated_img[0])
|
26 |
+
|
27 |
+
return img
|
28 |
|
29 |
|
30 |
# pass function, input type for prompt, the output for multiple images
|