Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- app.py +5 -4
- externalmod.py +1 -1
app.py
CHANGED
|
@@ -153,7 +153,7 @@ with gr.Blocks(theme='Nymbo/Nymbo_Theme', fill_width=True, css=CSS) as demo:
|
|
| 153 |
|
| 154 |
for m, o in zip(current_models, output):
|
| 155 |
gen_event = gr.on(triggers=[gen_button.click, txt_input.submit], fn=gen_fn,
|
| 156 |
-
inputs=[m, txt_input, neg_input, height, width, steps, cfg, seed], outputs=[o])
|
| 157 |
o.change(add_gallery, [o, m, gallery], [gallery])
|
| 158 |
stop_button.click(lambda: gr.update(interactive=False), None, stop_button, cancels=[gen_event])
|
| 159 |
|
|
@@ -197,12 +197,12 @@ with gr.Blocks(theme='Nymbo/Nymbo_Theme', fill_width=True, css=CSS) as demo:
|
|
| 197 |
preview=True, object_fit="cover", columns=2, rows=2)
|
| 198 |
|
| 199 |
for i, o in enumerate(output2):
|
| 200 |
-
img_i = gr.Number(i, visible
|
| 201 |
-
num_images.change(lambda i, n: gr.update(visible = (i < n)), [img_i, num_images], o)
|
| 202 |
gen_event2 = gr.on(triggers=[gen_button2.click, txt_input2.submit],
|
| 203 |
fn=lambda i, n, m, t1, t2, n1, n2, n3, n4, n5: gen_fn(m, t1, t2, n1, n2, n3, n4, n5) if (i < n) else None,
|
| 204 |
inputs=[img_i, num_images, model_choice2, txt_input2, neg_input2,
|
| 205 |
-
height2, width2, steps2, cfg2, seed2], outputs=[o])
|
| 206 |
o.change(add_gallery, [o, model_choice2, gallery2], [gallery2])
|
| 207 |
stop_button2.click(lambda: gr.update(interactive=False), None, stop_button2, cancels=[gen_event2])
|
| 208 |
|
|
@@ -210,3 +210,4 @@ with gr.Blocks(theme='Nymbo/Nymbo_Theme', fill_width=True, css=CSS) as demo:
|
|
| 210 |
|
| 211 |
demo.queue(default_concurrency_limit=200, max_size=200)
|
| 212 |
demo.launch(show_api=False, max_threads=400)
|
|
|
|
|
|
| 153 |
|
| 154 |
for m, o in zip(current_models, output):
|
| 155 |
gen_event = gr.on(triggers=[gen_button.click, txt_input.submit], fn=gen_fn,
|
| 156 |
+
inputs=[m, txt_input, neg_input, height, width, steps, cfg, seed], outputs=[o], concurrency_limit=None)
|
| 157 |
o.change(add_gallery, [o, m, gallery], [gallery])
|
| 158 |
stop_button.click(lambda: gr.update(interactive=False), None, stop_button, cancels=[gen_event])
|
| 159 |
|
|
|
|
| 197 |
preview=True, object_fit="cover", columns=2, rows=2)
|
| 198 |
|
| 199 |
for i, o in enumerate(output2):
|
| 200 |
+
img_i = gr.Number(i, visible=False)
|
| 201 |
+
num_images.change(lambda i, n: gr.update(visible = (i < n)), [img_i, num_images], o, queue=False)
|
| 202 |
gen_event2 = gr.on(triggers=[gen_button2.click, txt_input2.submit],
|
| 203 |
fn=lambda i, n, m, t1, t2, n1, n2, n3, n4, n5: gen_fn(m, t1, t2, n1, n2, n3, n4, n5) if (i < n) else None,
|
| 204 |
inputs=[img_i, num_images, model_choice2, txt_input2, neg_input2,
|
| 205 |
+
height2, width2, steps2, cfg2, seed2], outputs=[o], concurrency_limit=None)
|
| 206 |
o.change(add_gallery, [o, model_choice2, gallery2], [gallery2])
|
| 207 |
stop_button2.click(lambda: gr.update(interactive=False), None, stop_button2, cancels=[gen_event2])
|
| 208 |
|
|
|
|
| 210 |
|
| 211 |
demo.queue(default_concurrency_limit=200, max_size=200)
|
| 212 |
demo.launch(show_api=False, max_threads=400)
|
| 213 |
+
# https://github.com/gradio-app/gradio/issues/6339
|
externalmod.py
CHANGED
|
@@ -570,7 +570,7 @@ def find_model_list(author: str="", tags: list[str]=[], not_tag="", sort: str="l
|
|
| 570 |
limit = limit * 20 if check_status and force_gpu else limit * 5
|
| 571 |
models = []
|
| 572 |
try:
|
| 573 |
-
model_infos = api.list_models(author=author, task="text-to-image",
|
| 574 |
tags=list_uniq(default_tags + tags), cardData=True, sort=sort, limit=limit)
|
| 575 |
except Exception as e:
|
| 576 |
print(f"Error: Failed to list models.")
|
|
|
|
| 570 |
limit = limit * 20 if check_status and force_gpu else limit * 5
|
| 571 |
models = []
|
| 572 |
try:
|
| 573 |
+
model_infos = api.list_models(author=author, #task="text-to-image",
|
| 574 |
tags=list_uniq(default_tags + tags), cardData=True, sort=sort, limit=limit)
|
| 575 |
except Exception as e:
|
| 576 |
print(f"Error: Failed to list models.")
|