diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-12-31 09:23:39 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-31 09:23:39 +0000 |
commit | 26522c7dc87cc6145982d23275941d1691c4b586 (patch) | |
tree | 4960f8a1f87a887f071be840bbb9a8dfd59aad78 /modules/api/api.py | |
parent | 3d8256e40c56d3a1209d53f15c23bc46491762b2 (diff) | |
parent | 5be9387b230794a8c771120577cb213490c940c0 (diff) | |
download | stable-diffusion-webui-gfx803-26522c7dc87cc6145982d23275941d1691c4b586.tar.gz stable-diffusion-webui-gfx803-26522c7dc87cc6145982d23275941d1691c4b586.tar.bz2 stable-diffusion-webui-gfx803-26522c7dc87cc6145982d23275941d1691c4b586.zip |
Merge pull request #6015 from philpax/api-begin-end-in-queue
fix(api): only begin/end state in lock
Diffstat (limited to 'modules/api/api.py')
-rw-r--r-- | modules/api/api.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/modules/api/api.py b/modules/api/api.py index 1ceba75d..59b81c93 100644 --- a/modules/api/api.py +++ b/modules/api/api.py @@ -130,14 +130,12 @@ class Api: if populate.sampler_name: populate.sampler_index = None # prevent a warning later on p = StableDiffusionProcessingTxt2Img(**vars(populate)) - # Override object param - - shared.state.begin() with self.queue_lock: + shared.state.begin() processed = process_images(p) + shared.state.end() - shared.state.end() b64images = list(map(encode_pil_to_base64, processed.images)) @@ -169,12 +167,10 @@ class Api: p.init_images = [decode_base64_to_image(x) for x in init_images] - shared.state.begin() - with self.queue_lock: + shared.state.begin() processed = process_images(p) - - shared.state.end() + shared.state.end() b64images = list(map(encode_pil_to_base64, processed.images)) |