Spaces:
Runtime error
Runtime error
Brian Watson
commited on
Commit
•
270c82d
1
Parent(s):
3420192
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ models = [
|
|
14 |
|
15 |
current_model = models[0]
|
16 |
|
17 |
-
text_gen = gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion_link")
|
18 |
|
19 |
models2 = []
|
20 |
for model in models:
|
@@ -30,7 +30,7 @@ def text_it(inputs, text_gen=text_gen):
|
|
30 |
def set_model(current_model_index):
|
31 |
global current_model
|
32 |
current_model = models[current_model_index]
|
33 |
-
return gr.update(
|
34 |
|
35 |
|
36 |
def send_it(inputs, model_choice):
|
@@ -38,27 +38,9 @@ def send_it(inputs, model_choice):
|
|
38 |
return proc(inputs)
|
39 |
|
40 |
|
41 |
-
|
42 |
-
|
43 |
-
with gr.Blocks(css=css) as myface:
|
44 |
gr.HTML(
|
45 |
-
|
46 |
-
<html lang="en">
|
47 |
-
<head>
|
48 |
-
<meta charset="utf-8" />
|
49 |
-
<meta name="twitter:card" content="player"/>
|
50 |
-
<meta name="twitter:site" content=""/>
|
51 |
-
<meta name="twitter:player" content="https://omnibus-maximum-multiplier-places.hf.space"/>
|
52 |
-
<meta name="twitter:player:stream" content="https://omnibus-maximum-multiplier-places.hf.space"/>
|
53 |
-
<meta name="twitter:player:width" content="100%"/>
|
54 |
-
<meta name="twitter:player:height" content="600"/>
|
55 |
-
<meta property="og:title" content="Embedded Live Viewer"/>
|
56 |
-
<meta property="og:description" content="Tweet Genie - A Huggingface Space"/>
|
57 |
-
<meta property="og:image" content="https://cdn.glitch.global/80dbe92e-ce75-44af-84d5-74a2e21e9e55/omnicard.png?v=1676772531627"/>
|
58 |
-
<!--<meta http-equiv="refresh" content="0; url=https://huggingface.co/spaces/corbt/tweet-genie">-->
|
59 |
-
</head>
|
60 |
-
</html>
|
61 |
-
"""
|
62 |
)
|
63 |
|
64 |
with gr.Row():
|
@@ -75,28 +57,31 @@ with gr.Blocks(css=css) as myface:
|
|
75 |
with gr.Row():
|
76 |
see_prompts = gr.Button("Generate Prompts")
|
77 |
run = gr.Button("Generate Images", variant="primary")
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
|
|
|
|
|
|
100 |
|
101 |
model_name1.change(set_model, inputs=model_name1, outputs=[output1, output2, output3, output4, output5, output6, output7, output8])
|
102 |
|
@@ -119,4 +104,4 @@ with gr.Blocks(css=css) as myface:
|
|
119 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic8])
|
120 |
|
121 |
myface.queue(concurrency_count=200)
|
122 |
-
myface.launch(inline=True, show_api=False, max_threads=400)
|
|
|
14 |
|
15 |
current_model = models[0]
|
16 |
|
17 |
+
text_gen = gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion_link")
|
18 |
|
19 |
models2 = []
|
20 |
for model in models:
|
|
|
30 |
def set_model(current_model_index):
|
31 |
global current_model
|
32 |
current_model = models[current_model_index]
|
33 |
+
return gr.update(value=f"{current_model['name']}")
|
34 |
|
35 |
|
36 |
def send_it(inputs, model_choice):
|
|
|
38 |
return proc(inputs)
|
39 |
|
40 |
|
41 |
+
with gr.Blocks() as myface:
|
|
|
|
|
42 |
gr.HTML(
|
43 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
)
|
45 |
|
46 |
with gr.Row():
|
|
|
57 |
with gr.Row():
|
58 |
see_prompts = gr.Button("Generate Prompts")
|
59 |
run = gr.Button("Generate Images", variant="primary")
|
60 |
+
|
61 |
+
with gr.Row():
|
62 |
+
output1 = gr.Image(label="")
|
63 |
+
output2 = gr.Image(label="")
|
64 |
+
with gr.Row():
|
65 |
+
magic1 = gr.Textbox(lines=2)
|
66 |
+
magic2 = gr.Textbox(lines=2)
|
67 |
+
with gr.Row():
|
68 |
+
output3 = gr.Image(label="")
|
69 |
+
output4 = gr.Image(label="")
|
70 |
+
with gr.Row():
|
71 |
+
magic3 = gr.Textbox(lines=2)
|
72 |
+
magic4 = gr.Textbox(lines=2)
|
73 |
+
with gr.Row():
|
74 |
+
output5 = gr.Image(label="")
|
75 |
+
output6 = gr.Image(label="")
|
76 |
+
with gr.Row():
|
77 |
+
magic5 = gr.Textbox(lines=2)
|
78 |
+
magic6 = gr.Textbox(lines=2)
|
79 |
+
with gr.Row():
|
80 |
+
output7 = gr.Image(label="")
|
81 |
+
output8 = gr.Image(label="")
|
82 |
+
with gr.Row():
|
83 |
+
magic7 = gr.Textbox(lines=2)
|
84 |
+
magic8 = gr.Textbox(lines=2)
|
85 |
|
86 |
model_name1.change(set_model, inputs=model_name1, outputs=[output1, output2, output3, output4, output5, output6, output7, output8])
|
87 |
|
|
|
104 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic8])
|
105 |
|
106 |
myface.queue(concurrency_count=200)
|
107 |
+
myface.launch(inline=True, show_api=False, max_threads=400)
|