Spaces:
Running
Running
app.py
Browse files
app.py
CHANGED
@@ -33,20 +33,21 @@ def gen_fn(model_str, prompt):
|
|
33 |
|
34 |
def make_me():
|
35 |
with gr.Row():
|
|
|
|
|
|
|
36 |
with gr.Column(scale=1):
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
gen_button.click(on_generate_click, inputs=None, outputs=[gen_button, stop_button])
|
49 |
-
stop_button.click(on_stop_click, inputs=None, outputs=[gen_button, stop_button])
|
50 |
|
51 |
with gr.Row():
|
52 |
output = [gr.Image(label=m, min_width=250, height=250, elem_id="custom_image", show_label=True, interactive=False, show_share_button=False) for m in default_models]
|
@@ -67,7 +68,6 @@ custom_css = """
|
|
67 |
:root {
|
68 |
--body-background-fill: #2d3d4f;
|
69 |
}
|
70 |
-
|
71 |
body {
|
72 |
background-color: var(--body-background-fill) !important;
|
73 |
color: #2d3d4f;
|
@@ -77,7 +77,6 @@ body {
|
|
77 |
height: 100vh;
|
78 |
overflow-y: auto;
|
79 |
}
|
80 |
-
|
81 |
.gradio-container {
|
82 |
background-color: #2d3d4f;
|
83 |
color: #c5c6c7;
|
@@ -90,7 +89,6 @@ body {
|
|
90 |
display: block;
|
91 |
min-height: 100vh;
|
92 |
}
|
93 |
-
|
94 |
.app_title {
|
95 |
background-color: #2d3d4f;
|
96 |
color: #c5c6c7;
|
@@ -103,7 +101,6 @@ body {
|
|
103 |
box-sizing: border-box;
|
104 |
margin-bottom: 20px;
|
105 |
}
|
106 |
-
|
107 |
.custom_textbox {
|
108 |
background-color: #2d343f;
|
109 |
border: 1px solid #3b4252;
|
@@ -114,7 +111,6 @@ body {
|
|
114 |
width: 100%;
|
115 |
box-sizing: border-box;
|
116 |
}
|
117 |
-
|
118 |
.custom_gen_button {
|
119 |
background-color: #8b38ff;
|
120 |
border: 1px solid #ffffff;
|
@@ -153,7 +149,6 @@ body {
|
|
153 |
transform: translateY(-2px);
|
154 |
box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
|
155 |
}
|
156 |
-
|
157 |
.custom_image {
|
158 |
border: 1px solid #3b4252;
|
159 |
background-color: #2d343f;
|
@@ -164,7 +159,6 @@ body {
|
|
164 |
width: 100%;
|
165 |
height: auto;
|
166 |
}
|
167 |
-
|
168 |
.custom_accordion {
|
169 |
background-color: #2d3d4f;
|
170 |
color: #7f8184;
|
@@ -175,7 +169,6 @@ body {
|
|
175 |
box-sizing: border-box;
|
176 |
transition: margin 0.2s ease;
|
177 |
}
|
178 |
-
|
179 |
.custom_accordion .gr-accordion-header {
|
180 |
background-color: #2d3d4f;
|
181 |
color: #7f8184;
|
@@ -188,11 +181,9 @@ body {
|
|
188 |
display: flex;
|
189 |
align-items: center;
|
190 |
}
|
191 |
-
|
192 |
.custom_accordion .gr-accordion-header:hover {
|
193 |
background-color: #2d3d4f;
|
194 |
}
|
195 |
-
|
196 |
.custom_accordion .gr-accordion-content {
|
197 |
padding: 10px 20px;
|
198 |
background-color: #2d3d4f;
|
@@ -201,11 +192,9 @@ body {
|
|
201 |
overflow: hidden;
|
202 |
transition: max-height 0.2s ease;
|
203 |
}
|
204 |
-
|
205 |
.custom_accordion .gr-accordion-content.open {
|
206 |
max-height: 500px;
|
207 |
}
|
208 |
-
|
209 |
.custom_checkbox_group {
|
210 |
background-color: #2d343f;
|
211 |
border: 1px solid #3b4252;
|
@@ -215,7 +204,6 @@ body {
|
|
215 |
width: 100%;
|
216 |
box-sizing: border-box;
|
217 |
}
|
218 |
-
|
219 |
@media (max-width: 768px) {
|
220 |
.gradio-container {
|
221 |
width: 100%;
|
|
|
33 |
|
34 |
def make_me():
|
35 |
with gr.Row():
|
36 |
+
with gr.Column(scale=4):
|
37 |
+
txt_input = gr.Textbox(label='Your prompt:', lines=4, container=False, elem_id="custom_textbox", placeholder="Prompt", height=250)
|
38 |
+
|
39 |
with gr.Column(scale=1):
|
40 |
+
gen_button = gr.Button('Generate images', elem_id="custom_gen_button")
|
41 |
+
stop_button = gr.Button('Stop', variant='secondary', interactive=False, elem_id="custom_stop_button")
|
42 |
+
|
43 |
+
def on_generate_click():
|
44 |
+
return gr.Button('Generate images', elem_id="custom_gen_button"), gr.Button('Stop', variant='secondary', interactive=True, elem_id="custom_stop_button")
|
45 |
+
|
46 |
+
def on_stop_click():
|
47 |
+
return gr.Button('Generate images', elem_id="custom_gen_button"), gr.Button('Stop', variant='secondary', interactive=False, elem_id="custom_stop_button")
|
48 |
+
|
49 |
+
gen_button.click(on_generate_click, inputs=None, outputs=[gen_button, stop_button])
|
50 |
+
stop_button.click(on_stop_click, inputs=None, outputs=[gen_button, stop_button])
|
|
|
|
|
51 |
|
52 |
with gr.Row():
|
53 |
output = [gr.Image(label=m, min_width=250, height=250, elem_id="custom_image", show_label=True, interactive=False, show_share_button=False) for m in default_models]
|
|
|
68 |
:root {
|
69 |
--body-background-fill: #2d3d4f;
|
70 |
}
|
|
|
71 |
body {
|
72 |
background-color: var(--body-background-fill) !important;
|
73 |
color: #2d3d4f;
|
|
|
77 |
height: 100vh;
|
78 |
overflow-y: auto;
|
79 |
}
|
|
|
80 |
.gradio-container {
|
81 |
background-color: #2d3d4f;
|
82 |
color: #c5c6c7;
|
|
|
89 |
display: block;
|
90 |
min-height: 100vh;
|
91 |
}
|
|
|
92 |
.app_title {
|
93 |
background-color: #2d3d4f;
|
94 |
color: #c5c6c7;
|
|
|
101 |
box-sizing: border-box;
|
102 |
margin-bottom: 20px;
|
103 |
}
|
|
|
104 |
.custom_textbox {
|
105 |
background-color: #2d343f;
|
106 |
border: 1px solid #3b4252;
|
|
|
111 |
width: 100%;
|
112 |
box-sizing: border-box;
|
113 |
}
|
|
|
114 |
.custom_gen_button {
|
115 |
background-color: #8b38ff;
|
116 |
border: 1px solid #ffffff;
|
|
|
149 |
transform: translateY(-2px);
|
150 |
box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
|
151 |
}
|
|
|
152 |
.custom_image {
|
153 |
border: 1px solid #3b4252;
|
154 |
background-color: #2d343f;
|
|
|
159 |
width: 100%;
|
160 |
height: auto;
|
161 |
}
|
|
|
162 |
.custom_accordion {
|
163 |
background-color: #2d3d4f;
|
164 |
color: #7f8184;
|
|
|
169 |
box-sizing: border-box;
|
170 |
transition: margin 0.2s ease;
|
171 |
}
|
|
|
172 |
.custom_accordion .gr-accordion-header {
|
173 |
background-color: #2d3d4f;
|
174 |
color: #7f8184;
|
|
|
181 |
display: flex;
|
182 |
align-items: center;
|
183 |
}
|
|
|
184 |
.custom_accordion .gr-accordion-header:hover {
|
185 |
background-color: #2d3d4f;
|
186 |
}
|
|
|
187 |
.custom_accordion .gr-accordion-content {
|
188 |
padding: 10px 20px;
|
189 |
background-color: #2d3d4f;
|
|
|
192 |
overflow: hidden;
|
193 |
transition: max-height 0.2s ease;
|
194 |
}
|
|
|
195 |
.custom_accordion .gr-accordion-content.open {
|
196 |
max-height: 500px;
|
197 |
}
|
|
|
198 |
.custom_checkbox_group {
|
199 |
background-color: #2d343f;
|
200 |
border: 1px solid #3b4252;
|
|
|
204 |
width: 100%;
|
205 |
box-sizing: border-box;
|
206 |
}
|
|
|
207 |
@media (max-width: 768px) {
|
208 |
.gradio-container {
|
209 |
width: 100%;
|