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

Code change suggestions to handle interrupted generations #10

Open
kryztoval opened this issue Oct 27, 2022 · 0 comments
Open

Code change suggestions to handle interrupted generations #10

kryztoval opened this issue Oct 27, 2022 · 0 comments

Comments

@kryztoval
Copy link

Can we change this line https://github.com/yfszzx/stable-diffusion-webui-inspiration/blob/main/scripts/inspiration.py#L47 to

            while len(line) > 0 and shared.state.interrupted == False:

so if the generation is interrupted we do not continue reading from the file?

And this line https://github.com/yfszzx/stable-diffusion-webui-inspiration/blob/main/scripts/inspiration.py#L53 to

                if len(os.listdir(artist_path)) > (batch_count-1)*batch_size:

in such a way that if we generate a batch_size lot it will not go over the batch_size * batch_count. So if you want to make 2 batches of 5 you can. or 5 batches of 2. and finally 10 batches of 1 and you will be sure that the ending folders will have 10 files each at least.

I would love this line https://github.com/yfszzx/stable-diffusion-webui-inspiration/blob/main/scripts/inspiration.py#L58 to be nested inside a if shared.state.interrupted == False: so if I cancel a batch the partially generated images are not written and I do not have to go clean up the folder the execution was stopped at.

I am loving the generation script, have not tried the browser yet.

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

No branches or pull requests

1 participant