sashavor
commited on
Commit
•
3276427
1
Parent(s):
777259c
another error
Browse files
app.py
CHANGED
@@ -12,6 +12,7 @@ def random_image():
|
|
12 |
cat = random.choice(categories)
|
13 |
print(cat)
|
14 |
imnames = os.listdir('images/'+'Photo_portrait_of_a_'+choice.replace(' ',' ')+'/Seed_46267/')
|
|
|
15 |
ims = [(Image.open(name)) for name in imnames]
|
16 |
print(ims)
|
17 |
return ims
|
@@ -23,17 +24,16 @@ print(categories)
|
|
23 |
with gr.Blocks() as demo:
|
24 |
gr.Markdown("# Stable Diffusion Explorer")
|
25 |
gr.Markdown("## TODO")
|
26 |
-
|
27 |
with gr.Row():
|
28 |
with gr.Column():
|
29 |
choice = gr.Dropdown(categories, label = "Choose a first category", interactive=True)
|
30 |
-
gr.Gallery(
|
31 |
with gr.Column():
|
32 |
gr.Textbox(label="Text prompt"),
|
33 |
gr.Image(optional=True, label="Image prompt", type='filepath'),
|
34 |
|
35 |
-
|
36 |
-
|
37 |
choice.change(open_ims, [prompt], [images])
|
38 |
|
39 |
demo.launch()
|
|
|
12 |
cat = random.choice(categories)
|
13 |
print(cat)
|
14 |
imnames = os.listdir('images/'+'Photo_portrait_of_a_'+choice.replace(' ',' ')+'/Seed_46267/')
|
15 |
+
print(imnames)
|
16 |
ims = [(Image.open(name)) for name in imnames]
|
17 |
print(ims)
|
18 |
return ims
|
|
|
24 |
with gr.Blocks() as demo:
|
25 |
gr.Markdown("# Stable Diffusion Explorer")
|
26 |
gr.Markdown("## TODO")
|
27 |
+
|
28 |
with gr.Row():
|
29 |
with gr.Column():
|
30 |
choice = gr.Dropdown(categories, label = "Choose a first category", interactive=True)
|
31 |
+
images = gr.Gallery(label="Images"),
|
32 |
with gr.Column():
|
33 |
gr.Textbox(label="Text prompt"),
|
34 |
gr.Image(optional=True, label="Image prompt", type='filepath'),
|
35 |
|
36 |
+
demo.load(random_image, None, images)
|
|
|
37 |
choice.change(open_ims, [prompt], [images])
|
38 |
|
39 |
demo.launch()
|