fix API thread safe issues of txt2img and img2img#14421
Merged
AUTOMATIC1111 merged 5 commits intoAUTOMATIC1111:devfrom Dec 30, 2023
lanyeeee:api_thread_safe
Merged
fix API thread safe issues of txt2img and img2img#14421AUTOMATIC1111 merged 5 commits intoAUTOMATIC1111:devfrom lanyeeee:api_thread_safe
AUTOMATIC1111 merged 5 commits intoAUTOMATIC1111:devfrom
lanyeeee:api_thread_safe
Conversation
Owner
|
I think there might be some issues if you use same |
Contributor
Author
I don't think it will cause a noticeable impact on startup time. But to make sure it doesn't impact startup time. |
Owner
|
Actually, I'm sorry to say it now, but I liked the original version without locks a lot more. If there's no noticeable impact, I'd rather have that, just with two |
AUTOMATIC1111
approved these changes
Dec 30, 2023
Closed
Closed
CastielMa
added a commit
to CastielMa/stable-diffusion-webui
that referenced
this pull request
May 26, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
TL;DR:
Function
ui.create_uiandself.init_default_script_argsare not thread-safe.It causes thread-safety issues of API
txt2imgandimg2img.To ensure the API is thread-safe, I move the code to init
Steps to reproduce the thread-safety issues
1. Run webui with the following command
2. Run the following python script
In most cases you will see the error on the
terminalwhich running webui.If not encounter the error,
ctrl+ccancel the webui then repeat the above steps again until the error appearsFix issue #10884
Checklist: