Update legacy_preprocessors.py

This commit is contained in:
lllyasviel 2024-01-29 21:55:02 -08:00
parent 1e90fc83fd
commit c839ba59dd

View File

@ -91,11 +91,11 @@ class LegacyPreprocessor(Preprocessor):
del slider_3
if self.unload_function is not None or self.managed_model is not None:
context = automatic_memory_management()
context = automatic_memory_management
else:
context = contextlib.nullcontext()
context = contextlib.nullcontext
with context:
with context():
result, is_image = self.call_function(img=input_image, res=resolution, thr_a=slider_1, thr_b=slider_2, **kwargs)
if is_image: