Spaces:
Runtime error
Runtime error
Brian Watson
commited on
Commit
•
83169f8
1
Parent(s):
12632a1
Update app.py
Browse files
app.py
CHANGED
@@ -4,51 +4,23 @@ import sys
|
|
4 |
from pathlib import Path
|
5 |
|
6 |
models = [
|
7 |
-
{"name": "Anything
|
8 |
-
{"name": "
|
9 |
-
{"name": "
|
10 |
-
{"name": "
|
11 |
-
{"name": "
|
12 |
-
{"name": "
|
13 |
-
{"name": "
|
14 |
-
{"name": "
|
15 |
-
{"name": "
|
16 |
-
{"name": "
|
17 |
-
{"name": "
|
18 |
-
{"name": "
|
19 |
-
{"name": "Girl New 1", "url": "Fred99774/girlnew1"},
|
20 |
-
{"name": "Lit 6B", "url": "hakurei/lit-6B"},
|
21 |
-
{"name": "Luna Diffusion", "url": "proximasanfinetuning/luna-diffusion"},
|
22 |
-
{"name": "Midjourney 4.0", "url": "flax/midjourney-v4-diffusion"},
|
23 |
-
{"name": "Midjourney 4.1", "url": "Joeythemonster/anything-midjourney-v-4-1"},
|
24 |
-
{"name": "Mo-Di Diffusion", "url": "nitrosocke/mo-di-diffusion"},
|
25 |
-
{"name": "Nitro Diffusion", "url": "nitrosocke/Nitro-Diffusion"},
|
26 |
-
{"name": "Openjourney V2", "url": "prompthero/openjourney-v2"},
|
27 |
-
{"name": "Openjourney", "url": "prompthero/openjourney"},
|
28 |
-
{"name": "Seek Art Mega", "url": "coreco/seek.art_MEGA"},
|
29 |
-
{"name": "Something", "url": "Guizmus/SDArt_something"},
|
30 |
-
{"name": "Spider Verse diffusion", "url": "nitrosocke/spider-verse-diffusion"},
|
31 |
-
{"name": "Vintedois 1.0", "url": "22h/vintedois-diffusion-v0-1"},
|
32 |
-
{"name": "Vintedois 2.0", "url": "22h/vintedois-diffusion-v0-2"},
|
33 |
-
{"name": "❤ ART STYLES ==========", "url": "joachimsallstrom/Double-Exposure-Diffusion"},
|
34 |
-
{"name": "Balloon Art", "url": "Fictiverse/Stable_Diffusion_BalloonArt_Model"},
|
35 |
-
{"name": "Double Exposure Diffusion", "url": "joachimsallstrom/Double-Exposure-Diffusion"},
|
36 |
-
{"name": "Fluid Art", "url": "Fictiverse/Stable_Diffusion_FluidArt_Model"},
|
37 |
-
{"name": "GTA5 Artwork Diffusion", "url": "ItsJayQz/GTA5_Artwork_Diffusion"},
|
38 |
-
{"name": "Marvel WhatIf Diffusion", "url": "ItsJayQz/Marvel_WhatIf_Diffusion"},
|
39 |
-
{"name": "Naruto Diffuser", "url": "lambdalabs/sd-naruto-diffusers"},
|
40 |
-
{"name": "Papercut", "url": "Fictiverse/Stable_Diffusion_PaperCut_Model"},
|
41 |
-
{"name": "Pokemon Diffuser", "url": "lambdalabs/sd-pokemon-diffusers"},
|
42 |
-
{"name": "Synthwave Punk 2", "url": "ItsJayQz/SynthwavePunk-v2"},
|
43 |
-
{"name": "Valorant Diffusion", "url": "ItsJayQz/Valorant_Diffusion"},
|
44 |
-
{"name": "Van Gogh Diffusion", "url": "dallinmackay/Van-Gogh-diffusion"},
|
45 |
-
{"name": "Vectorartz Diffusion", "url": "coder119/Vectorartz_Diffusion"},
|
46 |
-
{"name": "VoxelArt", "url": "Fictiverse/Stable_Diffusion_VoxelArt_Model"},
|
47 |
]
|
48 |
|
49 |
current_model = models[0]
|
50 |
|
51 |
-
text_gen = gr.Interface.load("spaces/
|
52 |
|
53 |
models2 = []
|
54 |
for model in models:
|
@@ -64,7 +36,7 @@ def text_it(inputs, text_gen=text_gen):
|
|
64 |
def set_model(current_model_index):
|
65 |
global current_model
|
66 |
current_model = models[current_model_index]
|
67 |
-
return gr.update(
|
68 |
|
69 |
|
70 |
def send_it(inputs, model_choice):
|
@@ -72,16 +44,14 @@ def send_it(inputs, model_choice):
|
|
72 |
return proc(inputs)
|
73 |
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
with gr.Blocks(css=css) as myface:
|
78 |
gr.HTML(
|
79 |
|
80 |
)
|
81 |
|
82 |
with gr.Row():
|
83 |
with gr.Row():
|
84 |
-
input_text = gr.Textbox(label="Prompt idea", lines=1)
|
85 |
# Model selection dropdown
|
86 |
model_name1 = gr.Dropdown(
|
87 |
label="Choose Model",
|
@@ -93,30 +63,33 @@ with gr.Blocks(css=css) as myface:
|
|
93 |
with gr.Row():
|
94 |
see_prompts = gr.Button("Generate Prompts")
|
95 |
run = gr.Button("Generate Images", variant="primary")
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
|
|
|
|
|
|
118 |
|
119 |
-
model_name1.change(set_model, inputs=model_name1, outputs=[output1, output2, output3, output4, output5, output6, output7, output8])
|
120 |
|
121 |
run.click(send_it, inputs=[magic1, model_name1], outputs=[output1])
|
122 |
run.click(send_it, inputs=[magic2, model_name1], outputs=[output2])
|
@@ -126,6 +99,7 @@ with gr.Blocks(css=css) as myface:
|
|
126 |
run.click(send_it, inputs=[magic6, model_name1], outputs=[output6])
|
127 |
run.click(send_it, inputs=[magic7, model_name1], outputs=[output7])
|
128 |
run.click(send_it, inputs=[magic8, model_name1], outputs=[output8])
|
|
|
129 |
|
130 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic1])
|
131 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic2])
|
@@ -135,6 +109,7 @@ with gr.Blocks(css=css) as myface:
|
|
135 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic6])
|
136 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic7])
|
137 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic8])
|
|
|
138 |
|
139 |
myface.queue(concurrency_count=200)
|
140 |
-
myface.launch(inline=True, show_api=False, max_threads=400)
|
|
|
4 |
from pathlib import Path
|
5 |
|
6 |
models = [
|
7 |
+
{"name": "Anything 5.0", "url": "stablediffusionapi/anything-v5"},
|
8 |
+
{"name": "Counterfeit 2.0", "url": "gsdf/Counterfeit-V2.0"},
|
9 |
+
{"name": "Counterfeit 3.0", "url": "stablediffusionapi/counterfeit-v30"},
|
10 |
+
{"name": "Dreamlike Anime", "url": "dreamlike-art/dreamlike-anime-1.0"},
|
11 |
+
{"name": "MeinaMix 7", "url": "Nacholmo/meinamixv7-diffusers"},
|
12 |
+
{"name": "Openjourney 4", "url": "prompthero/openjourney-v4"},
|
13 |
+
{"name": "OpenNiji", "url": "Korakoe/OpenNiji"},
|
14 |
+
{"name": "Pastel Mix", "url": "andite/pastel-mix"},
|
15 |
+
{"name": "Picasso Diffusion 1.1", "url": "aipicasso/picasso-diffusion-1-1"},
|
16 |
+
{"name": "Rev Anim", "url": "stablediffusionapi/rev-anim"},
|
17 |
+
{"name": "TMND mix", "url": "stablediffusionapi/tmnd-mix"},
|
18 |
+
{"name": "Waifu Diffusion", "url": "hakurei/waifu-diffusion"},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
]
|
20 |
|
21 |
current_model = models[0]
|
22 |
|
23 |
+
text_gen = gr.Interface.load("spaces/daspartho/prompt-extend")
|
24 |
|
25 |
models2 = []
|
26 |
for model in models:
|
|
|
36 |
def set_model(current_model_index):
|
37 |
global current_model
|
38 |
current_model = models[current_model_index]
|
39 |
+
return gr.update(value=f"{current_model['name']}")
|
40 |
|
41 |
|
42 |
def send_it(inputs, model_choice):
|
|
|
44 |
return proc(inputs)
|
45 |
|
46 |
|
47 |
+
with gr.Blocks() as myface:
|
|
|
|
|
48 |
gr.HTML(
|
49 |
|
50 |
)
|
51 |
|
52 |
with gr.Row():
|
53 |
with gr.Row():
|
54 |
+
input_text = gr.Textbox(label="Prompt idea", placeholder="Eg. Eyewear model", lines=1)
|
55 |
# Model selection dropdown
|
56 |
model_name1 = gr.Dropdown(
|
57 |
label="Choose Model",
|
|
|
63 |
with gr.Row():
|
64 |
see_prompts = gr.Button("Generate Prompts")
|
65 |
run = gr.Button("Generate Images", variant="primary")
|
66 |
+
|
67 |
+
with gr.Row():
|
68 |
+
output1 = gr.Image(label="")
|
69 |
+
output2 = gr.Image(label="")
|
70 |
+
output3 = gr.Image(label="")
|
71 |
+
with gr.Row():
|
72 |
+
magic1 = gr.Textbox(label="Generated Prompt", lines=2)
|
73 |
+
magic2 = gr.Textbox(label="Generated Prompt", lines=2)
|
74 |
+
magic3 = gr.Textbox(label="Generated Prompt", lines=2)
|
75 |
+
with gr.Row():
|
76 |
+
output4 = gr.Image(label="")
|
77 |
+
output5 = gr.Image(label="")
|
78 |
+
output6 = gr.Image(label="")
|
79 |
+
with gr.Row():
|
80 |
+
magic4 = gr.Textbox(label="Generated Prompt", lines=2)
|
81 |
+
magic5 = gr.Textbox(label="Generated Prompt", lines=2)
|
82 |
+
magic6 = gr.Textbox(label="Generated Prompt", lines=2)
|
83 |
+
with gr.Row():
|
84 |
+
output7 = gr.Image(label="")
|
85 |
+
output8 = gr.Image(label="")
|
86 |
+
output9 = gr.Image(label="")
|
87 |
+
with gr.Row():
|
88 |
+
magic7 = gr.Textbox(label="Generated Prompt", lines=2)
|
89 |
+
magic8 = gr.Textbox(label="Generated Prompt", lines=2)
|
90 |
+
magic9 = gr.Textbox(label="Generated Prompt", lines=2)
|
91 |
|
92 |
+
model_name1.change(set_model, inputs=model_name1, outputs=[output1, output2, output3, output4, output5, output6, output7, output8, output9])
|
93 |
|
94 |
run.click(send_it, inputs=[magic1, model_name1], outputs=[output1])
|
95 |
run.click(send_it, inputs=[magic2, model_name1], outputs=[output2])
|
|
|
99 |
run.click(send_it, inputs=[magic6, model_name1], outputs=[output6])
|
100 |
run.click(send_it, inputs=[magic7, model_name1], outputs=[output7])
|
101 |
run.click(send_it, inputs=[magic8, model_name1], outputs=[output8])
|
102 |
+
run.click(send_it, inputs=[magic9, model_name1], outputs=[output9])
|
103 |
|
104 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic1])
|
105 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic2])
|
|
|
109 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic6])
|
110 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic7])
|
111 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic8])
|
112 |
+
see_prompts.click(text_it, inputs=[input_text], outputs=[magic9])
|
113 |
|
114 |
myface.queue(concurrency_count=200)
|
115 |
+
myface.launch(inline=True, show_api=False, max_threads=400)
|