Skip to content
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

Interrupt after current generation #13653

Merged
merged 3 commits into from
Jan 1, 2024

Conversation

antfu
Copy link
Contributor

@antfu antfu commented Oct 16, 2023

Description

resolves #7488, resolves #8898

And an option (in the System tab) to Interrupt after the current generation when doing batch.

Alternative

  • A new button "Interrupt on next" alongside with "Interrupt" and "Skip" buttons

Screenshots/videos:

Screen.Recording.2023-10-16.at.14.14.40.mov

Checklist:

@@ -113,6 +113,7 @@
"disable_mmap_load_safetensors": OptionInfo(False, "Disable memmapping for loading .safetensors files.").info("fixes very slow loading speed in some cases"),
"hide_ldm_prints": OptionInfo(True, "Prevent Stability-AI's ldm/sgm modules from printing noise to console."),
"dump_stacks_on_signal": OptionInfo(False, "Print stack traces before exiting the program with ctrl+c."),
"interrupt_after_current": OptionInfo(False, "Interrupt generation after current image is finished on batch processing"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default to False for now, to avoid behavior changes.

But honestly, I personally would have this always on. Would you consider making it default to true?

modules/ui.py Outdated
@@ -216,8 +216,14 @@ def __init__(self, is_img2img):
outputs=[],
)

def interrupt_fn():
if shared.state.job_count > 1 and shared.opts.interrupt_after_current:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About the self.job_count > 1 condition, I think that's the intuitive behavior that:

  • Interrupt right away when generating single image
  • Interrupt on next when doing batch
  • To interrupt right away in batch, the user could do "Interrupt" and then "Skip".

@AUTOMATIC1111
Copy link
Owner

I think this can be done without adding interrupted_next - just by checking for the setting in some places with if state.interrupted:

@AUTOMATIC1111 AUTOMATIC1111 merged commit 2a7ad70 into AUTOMATIC1111:dev Jan 1, 2024
2 of 3 checks passed
AUTOMATIC1111 added a commit that referenced this pull request Jan 1, 2024
@antfu antfu deleted the feat/interrupted-end branch January 1, 2024 14:13
@w-e-w w-e-w mentioned this pull request Feb 17, 2024
@pawel665j pawel665j mentioned this pull request Apr 16, 2024
ruchej pushed a commit to ruchej/stable-diffusion-webui that referenced this pull request Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants