stable-diffusion-webui/frontend
cobryan05 b969428590
Job Manager feature - view images before all are complete, cancel ongoing generations (#460)
* Add max-jobs command line argument

Adds a new command line argument, max-jobs, which will set the number
of concurrent jobs the gradio queue will allow. When set to more than
the default of 1 the gradio UI will be able to process additional
UI commands at the same time.

* JobManager: initial txt2img implementation

Initial implementation of JobManager, applied to txt2img.
Adds 'refresh' and 'cancel' buttons to the UI. These are useful when
generating images with large batch counts. The 'refresh' button will
update the gallery with the currently-generated images, and the cancel
button will cause the generation to stop after the current iteration.

The new job manager can be disabled with the parameter
  --no-job-manager

* JobManager: Add status update text

* JobManager: Replace wrapped inputs as well

* JobManager: Per-session unique keys

* JobManager: Pre and Post call funcs, UI updates

Added pre- and post- function call 'dummy objects' to allow updating
the UI before and after a generate run. Update the visuals of the
buttons and status text in these new functions.

* JobManager: enforce maximum jobs

* JobManager: Move 'call' func code block

It just makes more sense between _pre and _post.

* JobManager: Add session management

Adds support for multiple browser sessions.
A single session cannot run the same job twice.

If there are no available jobs when Generate is clicked, the
generation aborts. It does *not* queue.

* JobManager: add session maintenance

Addded the ability for one session to stop all concurrent sessions,
and to free memory from any 'finished' sessions for which the
browser has been closed (as the images will be stored until the
browser does a final 'refresh' after the job finishes, which will
never happen if the browser closed)

* JobManager: Add img2img support

This *should* add JobManager to img2img, but it is untested
since img2img is broken for me even without my changes.

* Fixed img2img functionality on this pr

* Revert "Fixed img2img functionality on this pr"

This reverts commit 649b1e8e65.

* Img2Img: Fix 'image editor' options not visible

* Fix Img2Img Job Manager integration

* Img2Img UI: Move JobManager above Image Actions

It is helpful if it is on the screen when you hit generate, so
you can notice the button light up when generation starts.

* Improve job status text

* JobManager: Free available job on exception

* JobManager: Add queueing

Adds a simple queueing system to JobManager. If max-jobs concurrent
jobs are already active then any subsequent jobs will block until
a slot frees up.

Note: The UI does not give great feedback to this. The JobManager
status box will say "Loading..."

* JobManager: Fix queue accidentally LIFO

Queues should really be first in, first out.

* JobManager: add draw_gradio_ui function

Reduces a lot of boilerplate code in frontend.py

Co-authored-by: hlky <106811348+hlky@users.noreply.github.com>
2022-09-03 08:30:07 +01:00
..
css [Big update] - Dynamic params, Ui rehaul, mobile fixes, and simplification of the txt2img tab (#421) 2022-09-01 14:18:17 +01:00
js refactor: python js interface (#381) 2022-09-01 11:11:22 +01:00
__init__.py Refactored the UI, added a web_playground.py to be run without any models. 2022-08-29 00:41:17 +01:00
CODEOWNERS fixes [CHORE] - add codeowners file for altryne on /frontend #386 (#387) 2022-08-31 20:39:04 +01:00
css_and_js.py [Big update] - Dynamic params, Ui rehaul, mobile fixes, and simplification of the txt2img tab (#421) 2022-09-01 14:18:17 +01:00
frontend.py Job Manager feature - view images before all are complete, cancel ongoing generations (#460) 2022-09-03 08:30:07 +01:00
job_manager.py Job Manager feature - view images before all are complete, cancel ongoing generations (#460) 2022-09-03 08:30:07 +01:00
ui_functions.py Load txt2img setting from files or clipboard (#436) 2022-09-03 08:24:03 +01:00