sashavor
commited on
Commit
β’
777259c
1
Parent(s):
a6726ed
initial app
Browse filesThis view is limited to 50 files because it contains too many changes. Β
See raw diff
- app.py +27 -16
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_1.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_10.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_2.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_3.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_4.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_5.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_6.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_7.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_8.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_9.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_1.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_10.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_2.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_3.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_4.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_5.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_6.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_7.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_8.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_9.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_1.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_10.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_2.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_3.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_4.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_5.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_6.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_7.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_8.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_9.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_1.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_10.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_2.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_3.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_4.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_5.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_6.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_7.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_8.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_9.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_60884/Photo_portrait_of_a_doctor_image_1.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_60884/Photo_portrait_of_a_doctor_image_10.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_60884/Photo_portrait_of_a_doctor_image_2.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_60884/Photo_portrait_of_a_doctor_image_3.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_60884/Photo_portrait_of_a_doctor_image_4.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_60884/Photo_portrait_of_a_doctor_image_5.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_60884/Photo_portrait_of_a_doctor_image_6.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_60884/Photo_portrait_of_a_doctor_image_7.jpg +0 -0
- {Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_60884/Photo_portrait_of_a_doctor_image_8.jpg +0 -0
app.py
CHANGED
@@ -1,28 +1,39 @@
|
|
1 |
import gradio as gr
|
2 |
-
import random
|
|
|
3 |
|
4 |
-
def
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
im_prompts = []
|
10 |
-
if im_prompt != None:
|
11 |
-
im_prompts = [im_prompt]
|
12 |
-
pil_ims = generate(n=1, prompts=prompts, images=im_prompts, seed=seed, steps=n_steps, method=method)
|
13 |
-
return pil_ims[0]
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
with gr.Blocks() as demo:
|
17 |
gr.Markdown("# Stable Diffusion Explorer")
|
18 |
-
gr.Markdown("
|
|
|
19 |
with gr.Row():
|
20 |
with gr.Column():
|
21 |
-
gr.
|
22 |
-
gr.
|
23 |
with gr.Column():
|
24 |
-
gr.
|
25 |
-
gr.
|
|
|
|
|
26 |
|
|
|
27 |
|
28 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
import random, os
|
3 |
+
from PIL import Image
|
4 |
|
5 |
+
def open_ims(choice):
|
6 |
+
print(choice)
|
7 |
+
imnames = os.listdir('images/'+'Photo_portrait_of_a_'+choice.replace(' ',' ')+'/Seed_46267/')
|
8 |
+
images = [(Image.open(name)) for name in imnames]
|
9 |
+
return images
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
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
|
18 |
+
|
19 |
+
categories=os.listdir('images/')
|
20 |
+
categories = [c.replace('Photo_portrait_of_a_','').replace('_',' ') for c in categories]
|
21 |
+
print(categories)
|
22 |
|
23 |
with gr.Blocks() as demo:
|
24 |
gr.Markdown("# Stable Diffusion Explorer")
|
25 |
+
gr.Markdown("## TODO")
|
26 |
+
demo.load(random_image, None, images)
|
27 |
with gr.Row():
|
28 |
with gr.Column():
|
29 |
+
choice = gr.Dropdown(categories, label = "Choose a first category", interactive=True)
|
30 |
+
gr.Gallery(images, label="Images"),
|
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()
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_1.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_10.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_2.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_3.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_4.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_5.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_6.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_7.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_8.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_46267/Photo_portrait_of_a_doctor_image_9.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_1.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_10.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_2.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_3.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_4.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_5.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_6.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_7.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_8.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_48040/Photo_portrait_of_a_doctor_image_9.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_1.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_10.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_2.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_3.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_4.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_5.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_6.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_7.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_8.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_51237/Photo_portrait_of_a_doctor_image_9.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_1.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_10.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_2.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_3.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_4.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_5.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_6.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_7.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_8.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_54325/Photo_portrait_of_a_doctor_image_9.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_60884/Photo_portrait_of_a_doctor_image_1.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_60884/Photo_portrait_of_a_doctor_image_10.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_60884/Photo_portrait_of_a_doctor_image_2.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_60884/Photo_portrait_of_a_doctor_image_3.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_60884/Photo_portrait_of_a_doctor_image_4.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_60884/Photo_portrait_of_a_doctor_image_5.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_60884/Photo_portrait_of_a_doctor_image_6.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_60884/Photo_portrait_of_a_doctor_image_7.jpg
RENAMED
File without changes
|
{Photo_portrait_of_a_doctor β images/Photo_portrait_of_a_doctor}/Seed_60884/Photo_portrait_of_a_doctor_image_8.jpg
RENAMED
File without changes
|