Spaces:
Runtime error
Runtime error
Brian Watson
commited on
Commit
·
28f0c64
1
Parent(s):
c6d3aa2
Update app.py
Browse files
app.py
CHANGED
@@ -4,14 +4,52 @@ import sys
|
|
4 |
from pathlib import Path
|
5 |
|
6 |
models = [
|
7 |
-
{"name": "
|
8 |
-
{"name": "
|
9 |
-
{"name": "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
]
|
11 |
|
12 |
current_model = models[0]
|
13 |
|
14 |
-
text_gen = gr.Interface.load("spaces/
|
15 |
|
16 |
models2 = []
|
17 |
for model in models:
|
@@ -27,7 +65,7 @@ def text_it(inputs, text_gen=text_gen):
|
|
27 |
def set_model(current_model_index):
|
28 |
global current_model
|
29 |
current_model = models[current_model_index]
|
30 |
-
return gr.update(
|
31 |
|
32 |
|
33 |
def send_it(inputs, model_choice):
|
@@ -35,14 +73,16 @@ def send_it(inputs, model_choice):
|
|
35 |
return proc(inputs)
|
36 |
|
37 |
|
38 |
-
|
|
|
|
|
39 |
gr.HTML(
|
40 |
|
41 |
)
|
42 |
|
43 |
with gr.Row():
|
44 |
with gr.Row():
|
45 |
-
input_text = gr.Textbox(label="Prompt idea",
|
46 |
# Model selection dropdown
|
47 |
model_name1 = gr.Dropdown(
|
48 |
label="Choose Model",
|
@@ -54,25 +94,30 @@ with gr.Blocks() as myface:
|
|
54 |
with gr.Row():
|
55 |
see_prompts = gr.Button("Generate Prompts")
|
56 |
run = gr.Button("Generate Images", variant="primary")
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
-
model_name1.change(set_model, inputs=model_name1, outputs=[output1, output2, output3, output4, output5, output6])
|
76 |
|
77 |
run.click(send_it, inputs=[magic1, model_name1], outputs=[output1])
|
78 |
run.click(send_it, inputs=[magic2, model_name1], outputs=[output2])
|
@@ -80,6 +125,8 @@ with gr.Blocks() as myface:
|
|
80 |
run.click(send_it, inputs=[magic4, model_name1], outputs=[output4])
|
81 |
run.click(send_it, inputs=[magic5, model_name1], outputs=[output5])
|
82 |
run.click(send_it, inputs=[magic6, model_name1], outputs=[output6])
|
|
|
|
|
83 |
|
84 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic1])
|
85 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic2])
|
@@ -87,6 +134,8 @@ with gr.Blocks() as myface:
|
|
87 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic4])
|
88 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic5])
|
89 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic6])
|
|
|
|
|
90 |
|
91 |
myface.queue(concurrency_count=200)
|
92 |
-
myface.launch(inline=True, show_api=False, max_threads=400)
|
|
|
4 |
from pathlib import Path
|
5 |
|
6 |
models = [
|
7 |
+
{"name": "Anything Midjourney 4.1", "url": "Joeythemonster/anything-midjourney-v-4-1"},
|
8 |
+
{"name": "Chaos and Order", "url": "Guizmus/SDArt_ChaosAndOrder768"},
|
9 |
+
{"name": "Chilloutclara", "url": "Fred99774/chilloutvlara"},
|
10 |
+
{"name": "Comic Diffusion", "url": "ogkalu/Comic-Diffusion"},
|
11 |
+
{"name": "Cosmic Horros 768", "url": "Guizmus/SDArt_cosmichorrors768"},
|
12 |
+
{"name": "Cosmic Horros", "url": "Guizmus/SDArt_cosmichorrors"},
|
13 |
+
{"name": "DGSpitzer", "url": "DGSpitzer/DGSpitzer-Art-Diffusion"},
|
14 |
+
{"name": "Dungeons and Diffusion", "url": "0xJustin/Dungeons-and-Diffusion"},
|
15 |
+
{"name": "Elden Ring", "url": "nitrosocke/elden-ring-diffusion"},
|
16 |
+
{"name": "Epic Diffusion 1.1", "url": "johnslegers/epic-diffusion-v1.1"},
|
17 |
+
{"name": "Epic Diffusion", "url": "johnslegers/epic-diffusion"},
|
18 |
+
{"name": "EpicMix Realism", "url": "Duskfallcrew/EpicMix_Realism"},
|
19 |
+
{"name": "Fantasy Mix", "url": "theintuitiveye/FantasyMix"},
|
20 |
+
{"name": "Girl New 1", "url": "Fred99774/girlnew1"},
|
21 |
+
{"name": "Lit 6B", "url": "hakurei/lit-6B"},
|
22 |
+
{"name": "Luna Diffusion", "url": "proximasanfinetuning/luna-diffusion"},
|
23 |
+
{"name": "Midjourney 4.0", "url": "flax/midjourney-v4-diffusion"},
|
24 |
+
{"name": "Midjourney 4.1", "url": "Joeythemonster/anything-midjourney-v-4-1"},
|
25 |
+
{"name": "Mo-Di Diffusion", "url": "nitrosocke/mo-di-diffusion"},
|
26 |
+
{"name": "Nitro Diffusion", "url": "nitrosocke/Nitro-Diffusion"},
|
27 |
+
{"name": "Openjourney V2", "url": "prompthero/openjourney-v2"},
|
28 |
+
{"name": "Openjourney", "url": "prompthero/openjourney"},
|
29 |
+
{"name": "Seek Art Mega", "url": "coreco/seek.art_MEGA"},
|
30 |
+
{"name": "Something", "url": "Guizmus/SDArt_something"},
|
31 |
+
{"name": "Spider Verse diffusion", "url": "nitrosocke/spider-verse-diffusion"},
|
32 |
+
{"name": "Vintedois 1.0", "url": "22h/vintedois-diffusion-v0-1"},
|
33 |
+
{"name": "Vintedois 2.0", "url": "22h/vintedois-diffusion-v0-2"},
|
34 |
+
{"name": "❤ ART STYLES ==========", "url": "joachimsallstrom/Double-Exposure-Diffusion"},
|
35 |
+
{"name": "Balloon Art", "url": "Fictiverse/Stable_Diffusion_BalloonArt_Model"},
|
36 |
+
{"name": "Double Exposure Diffusion", "url": "joachimsallstrom/Double-Exposure-Diffusion"},
|
37 |
+
{"name": "Fluid Art", "url": "Fictiverse/Stable_Diffusion_FluidArt_Model"},
|
38 |
+
{"name": "GTA5 Artwork Diffusion", "url": "ItsJayQz/GTA5_Artwork_Diffusion"},
|
39 |
+
{"name": "Marvel WhatIf Diffusion", "url": "ItsJayQz/Marvel_WhatIf_Diffusion"},
|
40 |
+
{"name": "Naruto Diffuser", "url": "lambdalabs/sd-naruto-diffusers"},
|
41 |
+
{"name": "Papercut", "url": "Fictiverse/Stable_Diffusion_PaperCut_Model"},
|
42 |
+
{"name": "Pokemon Diffuser", "url": "lambdalabs/sd-pokemon-diffusers"},
|
43 |
+
{"name": "Synthwave Punk 2", "url": "ItsJayQz/SynthwavePunk-v2"},
|
44 |
+
{"name": "Valorant Diffusion", "url": "ItsJayQz/Valorant_Diffusion"},
|
45 |
+
{"name": "Van Gogh Diffusion", "url": "dallinmackay/Van-Gogh-diffusion"},
|
46 |
+
{"name": "Vectorartz Diffusion", "url": "coder119/Vectorartz_Diffusion"},
|
47 |
+
{"name": "VoxelArt", "url": "Fictiverse/Stable_Diffusion_VoxelArt_Model"},
|
48 |
]
|
49 |
|
50 |
current_model = models[0]
|
51 |
|
52 |
+
text_gen = gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion_link")
|
53 |
|
54 |
models2 = []
|
55 |
for model in models:
|
|
|
65 |
def set_model(current_model_index):
|
66 |
global current_model
|
67 |
current_model = models[current_model_index]
|
68 |
+
return gr.update(label=f"{current_model['name']}")
|
69 |
|
70 |
|
71 |
def send_it(inputs, model_choice):
|
|
|
73 |
return proc(inputs)
|
74 |
|
75 |
|
76 |
+
css = """"""
|
77 |
+
|
78 |
+
with gr.Blocks(css=css) as myface:
|
79 |
gr.HTML(
|
80 |
|
81 |
)
|
82 |
|
83 |
with gr.Row():
|
84 |
with gr.Row():
|
85 |
+
input_text = gr.Textbox(label="Prompt idea", lines=1)
|
86 |
# Model selection dropdown
|
87 |
model_name1 = gr.Dropdown(
|
88 |
label="Choose Model",
|
|
|
94 |
with gr.Row():
|
95 |
see_prompts = gr.Button("Generate Prompts")
|
96 |
run = gr.Button("Generate Images", variant="primary")
|
97 |
+
with gr.Tab("Main"):
|
98 |
+
with gr.Row():
|
99 |
+
output1 = gr.Image(label=f"{current_model['name']}")
|
100 |
+
output2 = gr.Image(label=f"{current_model['name']}")
|
101 |
+
output3 = gr.Image(label=f"{current_model['name']}")
|
102 |
+
output4 = gr.Image(label=f"{current_model['name']}")
|
103 |
+
with gr.Row():
|
104 |
+
magic1 = gr.Textbox(lines=4)
|
105 |
+
magic2 = gr.Textbox(lines=4)
|
106 |
+
magic3 = gr.Textbox(lines=4)
|
107 |
+
magic4 = gr.Textbox(lines=4)
|
108 |
+
|
109 |
+
with gr.Row():
|
110 |
+
output5 = gr.Image(label=f"{current_model['name']}")
|
111 |
+
output6 = gr.Image(label=f"{current_model['name']}")
|
112 |
+
output7 = gr.Image(label=f"{current_model['name']}")
|
113 |
+
output8 = gr.Image(label=f"{current_model['name']}")
|
114 |
+
with gr.Row():
|
115 |
+
magic5 = gr.Textbox(lines=4)
|
116 |
+
magic6 = gr.Textbox(lines=4)
|
117 |
+
magic7 = gr.Textbox(lines=4)
|
118 |
+
magic8 = gr.Textbox(lines=4)
|
119 |
|
120 |
+
model_name1.change(set_model, inputs=model_name1, outputs=[output1, output2, output3, output4, output5, output6, output7, output8])
|
121 |
|
122 |
run.click(send_it, inputs=[magic1, model_name1], outputs=[output1])
|
123 |
run.click(send_it, inputs=[magic2, model_name1], outputs=[output2])
|
|
|
125 |
run.click(send_it, inputs=[magic4, model_name1], outputs=[output4])
|
126 |
run.click(send_it, inputs=[magic5, model_name1], outputs=[output5])
|
127 |
run.click(send_it, inputs=[magic6, model_name1], outputs=[output6])
|
128 |
+
run.click(send_it, inputs=[magic7, model_name1], outputs=[output7])
|
129 |
+
run.click(send_it, inputs=[magic8, model_name1], outputs=[output8])
|
130 |
|
131 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic1])
|
132 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic2])
|
|
|
134 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic4])
|
135 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic5])
|
136 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic6])
|
137 |
+
see_prompts.click(text_it, inputs=[input_text], outputs=[magic7])
|
138 |
+
see_prompts.click(text_it, inputs=[input_text], outputs=[magic8])
|
139 |
|
140 |
myface.queue(concurrency_count=200)
|
141 |
+
myface.launch(inline=True, show_api=False, max_threads=400)
|