mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-09 07:10:16 +08:00
even more powerfull fix
This commit is contained in:
parent
54fa613c83
commit
fa2ea648db
@ -60,8 +60,13 @@ def _load_tf_and_return_tags(pil_image, threshold):
|
||||
return ', '.join(result_tags_out).replace('_', ' ').replace(':', ' ')
|
||||
|
||||
|
||||
def subprocess_init_no_cuda():
|
||||
import os
|
||||
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
|
||||
|
||||
|
||||
def get_deepbooru_tags(pil_image, threshold=0.5):
|
||||
with ProcessPoolExecutor() as executor:
|
||||
f = executor.submit(_load_tf_and_return_tags, pil_image, threshold)
|
||||
with ProcessPoolExecutor(initializer=subprocess_init_no_cuda) as executor:
|
||||
f = executor.submit(_load_tf_and_return_tags, pil_image, threshold, )
|
||||
ret = f.result() # will rethrow any exceptions
|
||||
return ret
|
Loading…
Reference in New Issue
Block a user