-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
advanced params refactoring + prevent users from skipping/stopping other users tasks in queue #981
advanced params refactoring + prevent users from skipping/stopping other users tasks in queue #981
Conversation
…ess starts fix inconsistency in behaviour of stop_button and skip_button as it was possible to skip or stop other users processes while still being in queue
yes this is a reasonable problem and should fix. |
shared.last_stop could be handled not in shared but in the AsyncTask object to achieve true separation. Then skip_clicked and stop_clicked could set the property on AsyncTask and the worker could handle the process accordingly. What would be your proposal? |
…ing process starts" This reverts commit d3f9156.
26c0cff
to
f5c17fb
Compare
f5c17fb
to
ebad9ea
Compare
@lllyasviel skipping/stopping is now completely isolated, but a user can't skip/stop before the task is processed. I tried many things but in the end it comes down to the task not being updated while still queued via click on e.g. skip, despite being passed by reference as object. TL;DR: isolation works, stopping/skipping is possible only when processing started Please merge or adjust if you think it's fine or have a different solution in mind, thanks :) |
@@ -81,6 +84,7 @@ def generate_clicked(*args): | |||
css=modules.html.css).queue() | |||
|
|||
with shared.gradio_root: | |||
currentTask = gr.State(worker.AsyncTask(args=[])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi this can also be empty, just to prevent future checks for e.g. processing or last_stop
…g-by-other-users # Conflicts: # webui.py
…ing-by-other-users
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
…ping-and-stopping-by-other-users # Conflicts: # modules/async_worker.py # webui.py
…g-by-other-users # Conflicts: # webui.py
freeu_enabled, freeu_b1, freeu_b2, freeu_s1, freeu_s2
debugging_inpaint_preprocessor, inpaint_disable_initial_latent, inpaint_engine, inpaint_strength, inpaint_respective_field, inpaint_mask_upload_checkbox, invert_mask_checkbox, inpaint_erode_or_dilate
…t-skipping-and-stopping-by-other-users # Conflicts: # webui.py
@lllyasviel i've extracted all advanced_parameters to ctrls and added a PID based handling for class patch.py (overrides) to make it possible to separate the settings for each worker and job. Skipping/stopping is now possible whenever you want, not only when processing. Your feedback is welcome! |
@lllyasviel i saw you just added Fooocus/ldm_patched/modules/args_parser.py Line 115 in 1bcbd65
|
…g-by-other-users # Conflicts: # modules/async_worker.py
…ing other users tasks in queue (#981) * only make stop_button and skip_button interactive when rendering process starts fix inconsistency in behaviour of stop_button and skip_button as it was possible to skip or stop other users processes while still being in queue * use AsyncTask for last_stop handling instead of shared * Revert "only make stop_button and skip_button interactive when rendering process starts" This reverts commit d3f9156. * introduce state for task skipping/stopping * fix return parameters of stop_clicked * code cleanup, do not disable skip/stop on stop_clicked * reset last_stop when skipping for further processing * fix: replace fcbh with ldm_patched * fix: use currentTask instead of ctrls after merging upstream * feat: extract attribute disable_preview * feat: extract attribute adm_scaler_positive * feat: extract attribute adm_scaler_negative * feat: extract attribute adm_scaler_end * feat: extract attribute adaptive_cfg * feat: extract attribute sampler_name * feat: extract attribute scheduler_name * feat: extract attribute generate_image_grid * feat: extract attribute overwrite_step * feat: extract attribute overwrite_switch * feat: extract attribute overwrite_width * feat: extract attribute overwrite_height * feat: extract attribute overwrite_vary_strength * feat: extract attribute overwrite_upscale_strength * feat: extract attribute mixing_image_prompt_and_vary_upscale * feat: extract attribute mixing_image_prompt_and_inpaint * feat: extract attribute debugging_cn_preprocessor * feat: extract attribute skipping_cn_preprocessor * feat: extract attribute canny_low_threshold * feat: extract attribute canny_high_threshold * feat: extract attribute refiner_swap_method * feat: extract freeu_ctrls attributes freeu_enabled, freeu_b1, freeu_b2, freeu_s1, freeu_s2 * feat: extract inpaint_ctrls attributes debugging_inpaint_preprocessor, inpaint_disable_initial_latent, inpaint_engine, inpaint_strength, inpaint_respective_field, inpaint_mask_upload_checkbox, invert_mask_checkbox, inpaint_erode_or_dilate * wip: add TODOs * chore: cleanup code * feat: extract attribute controlnet_softness * feat: extract remaining attributes, do not use globals in patch * fix: resolve circular import, patch_all now in async_worker * chore: cleanup pid code
As an iPad user, the browser page will often refresh when returning to the tab (low memory can’t keep it alive) which prevents me from stopping a task that was running before the refresh. I’d like to somehow be able to stop the activity that I kicked off before the tab refresh. Since im the only remote user, being able to disable the queue isolation entirely would work for me. E.g. via command line arg. Or e.g. if it could allow queue cancellations originating from the same device. Currently, to cancel the queue, I launch Remote Desktop on my iPad then close/restart fooocus. I can enter this as a feature request if that’s preferable. |
@freshp124 I hope you can understand that this is by design so users don't cancel themselves when being in a multi-user environment and isolation was implemented to fix previous behavior. |
Relates to #826
Fixes #713
Fixes #501
fixes inconsistency in behaviour of stop_button and skip_button as it was possible to skip or stop other users processes while still being in queue.
Expected:
sessions are completely separate, no interference or control by other users except yourself
Actual:
one can skip and stop tasks of others
Steps to reproduce:
this is also possible using x tabs, where the last tab clicking "generate" can skip all previous queued tasks