Skip to content

Interrupt after current generation#13653

Merged
AUTOMATIC1111 merged 3 commits intoAUTOMATIC1111:devfrom
antfu:feat/interrupted-end
Jan 1, 2024
Merged

Interrupt after current generation#13653
AUTOMATIC1111 merged 3 commits intoAUTOMATIC1111:devfrom
antfu:feat/interrupted-end

Conversation

@antfu
Copy link
Copy Markdown
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:

@antfu antfu requested a review from AUTOMATIC1111 as a code owner October 16, 2023 06:17
"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
Copy Markdown
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
)

def interrupt_fn():
if shared.state.job_count > 1 and shared.opts.interrupt_after_current:
Copy link
Copy Markdown
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
Copy Markdown
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
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