Spaces:
Running
Running
gunship999
commited on
Commit
•
c09af3e
1
Parent(s):
750b033
Update app.py
Browse files
app.py
CHANGED
@@ -193,14 +193,21 @@ with gr.Blocks(theme='NoCrypt/miku@>=1.2.2', fill_width=True, css=CSS) as demo:
|
|
193 |
</a>""")
|
194 |
|
195 |
with gr.Column(scale=2):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
with gr.Group():
|
197 |
txt_input = gr.Textbox(
|
198 |
label='Your prompt:',
|
199 |
value=preSetPrompt,
|
200 |
lines=3,
|
201 |
-
autofocus=1
|
202 |
-
container=False,
|
203 |
-
elem_classes="modern-input"
|
204 |
)
|
205 |
neg_input = gr.Textbox(
|
206 |
label='Negative prompt:',
|
@@ -257,4 +264,20 @@ with gr.Blocks(theme='NoCrypt/miku@>=1.2.2', fill_width=True, css=CSS) as demo:
|
|
257 |
rows=2
|
258 |
)
|
259 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
260 |
demo.launch(show_api=False, max_threads=400)
|
|
|
193 |
</a>""")
|
194 |
|
195 |
with gr.Column(scale=2):
|
196 |
+
# 모델 선택 부분 추가
|
197 |
+
with gr.Accordion("Model Selection", open=True):
|
198 |
+
model_choice = gr.CheckboxGroup(
|
199 |
+
models,
|
200 |
+
label=f'Choose up to {int(num_models)} models',
|
201 |
+
value=default_models,
|
202 |
+
interactive=True
|
203 |
+
)
|
204 |
+
|
205 |
with gr.Group():
|
206 |
txt_input = gr.Textbox(
|
207 |
label='Your prompt:',
|
208 |
value=preSetPrompt,
|
209 |
lines=3,
|
210 |
+
autofocus=1
|
|
|
|
|
211 |
)
|
212 |
neg_input = gr.Textbox(
|
213 |
label='Negative prompt:',
|
|
|
264 |
rows=2
|
265 |
)
|
266 |
|
267 |
+
# 이벤트 핸들러 추가
|
268 |
+
model_choice.change(update_imgbox, model_choice, output)
|
269 |
+
model_choice.change(extend_choices, model_choice, current_models)
|
270 |
+
random_button.click(random_choices, None, model_choice)
|
271 |
+
|
272 |
+
for m, o in zip(current_models, output):
|
273 |
+
gen_event = gr.on(
|
274 |
+
triggers=[gen_button.click, txt_input.submit],
|
275 |
+
fn=gen_fn,
|
276 |
+
inputs=[m, txt_input, neg_input, height, width, steps, cfg, seed],
|
277 |
+
outputs=[o],
|
278 |
+
concurrency_limit=None,
|
279 |
+
queue=False
|
280 |
+
)
|
281 |
+
o.change(add_gallery, [o, m, gallery], [gallery])
|
282 |
+
|
283 |
demo.launch(show_api=False, max_threads=400)
|