Spaces:
Build error
Build error
edit: image generation return/
Browse files
app.py
CHANGED
@@ -10,7 +10,6 @@ import time
|
|
10 |
|
11 |
import gradio as gr
|
12 |
import keras_cv
|
13 |
-
from PIL import Image
|
14 |
|
15 |
from constants import css, examples, img_height, img_width, num_images_to_gen
|
16 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
@@ -40,14 +39,8 @@ def generate_image_fn(prompt: str, unconditional_guidance_scale: int) -> list:
|
|
40 |
unconditional_guidance_scale=unconditional_guidance_scale,
|
41 |
)
|
42 |
end_time = time.time()
|
43 |
-
image_paths = []
|
44 |
print(f"Time taken: {end_time - start_time} seconds.")
|
45 |
-
|
46 |
-
filename = f"prompt_{i}.png"
|
47 |
-
image = Image.fromarray(images[i])
|
48 |
-
image.save(filename)
|
49 |
-
image_paths.append(filename)
|
50 |
-
return image_paths
|
51 |
|
52 |
|
53 |
block = gr.Blocks(css=css)
|
|
|
10 |
|
11 |
import gradio as gr
|
12 |
import keras_cv
|
|
|
13 |
|
14 |
from constants import css, examples, img_height, img_width, num_images_to_gen
|
15 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
|
|
39 |
unconditional_guidance_scale=unconditional_guidance_scale,
|
40 |
)
|
41 |
end_time = time.time()
|
|
|
42 |
print(f"Time taken: {end_time - start_time} seconds.")
|
43 |
+
return images
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
|
46 |
block = gr.Blocks(css=css)
|