Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
#!/usr/bin/env python
|
| 2 |
# -*- coding: utf-8 -*-
|
| 3 |
|
| 4 |
-
import os
|
| 5 |
import random
|
| 6 |
from pathlib import Path
|
| 7 |
|
|
@@ -360,14 +359,26 @@ with gr.Blocks(css="style.css", js=js_func, title="Scribble SDXL — Live") as d
|
|
| 360 |
]
|
| 361 |
outputs = [image_slider]
|
| 362 |
|
| 363 |
-
# Manual run
|
| 364 |
run_button.click(
|
| 365 |
-
fn=randomize_seed_fn,
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 369 |
for comp in [image, prompt, negative_prompt, style, num_steps, guidance_scale,
|
| 370 |
controlnet_conditioning_scale, seed, use_hed, use_canny]:
|
| 371 |
-
comp.change(
|
|
|
|
|
|
|
| 372 |
|
| 373 |
-
|
|
|
|
|
|
| 1 |
#!/usr/bin/env python
|
| 2 |
# -*- coding: utf-8 -*-
|
| 3 |
|
|
|
|
| 4 |
import random
|
| 5 |
from pathlib import Path
|
| 6 |
|
|
|
|
| 359 |
]
|
| 360 |
outputs = [image_slider]
|
| 361 |
|
| 362 |
+
# Manual run (with per-event concurrency limits)
|
| 363 |
run_button.click(
|
| 364 |
+
fn=randomize_seed_fn,
|
| 365 |
+
inputs=[seed, randomize_seed],
|
| 366 |
+
outputs=seed,
|
| 367 |
+
queue=False,
|
| 368 |
+
api_name=False,
|
| 369 |
+
concurrency_limit=2,
|
| 370 |
+
).then(
|
| 371 |
+
lambda: None, inputs=None, outputs=image_slider, concurrency_limit=2
|
| 372 |
+
).then(
|
| 373 |
+
fn=run, inputs=inputs, outputs=outputs, concurrency_limit=2
|
| 374 |
+
)
|
| 375 |
+
|
| 376 |
+
# Live re-inference (debounced; per-event concurrency limits)
|
| 377 |
for comp in [image, prompt, negative_prompt, style, num_steps, guidance_scale,
|
| 378 |
controlnet_conditioning_scale, seed, use_hed, use_canny]:
|
| 379 |
+
comp.change(
|
| 380 |
+
fn=run, inputs=inputs, outputs=outputs, every=0.5, queue=True, concurrency_limit=2
|
| 381 |
+
)
|
| 382 |
|
| 383 |
+
# Enable queue without deprecated args
|
| 384 |
+
demo.queue(max_size=20).launch()
|