diff --git a/fooocus_version.py b/fooocus_version.py index 78de3d02..aabdefe9 100644 --- a/fooocus_version.py +++ b/fooocus_version.py @@ -1 +1 @@ -version = '2.1.36' +version = '2.1.37' diff --git a/modules/patch.py b/modules/patch.py index b10eaf8b..d0cca47d 100644 --- a/modules/patch.py +++ b/modules/patch.py @@ -455,7 +455,20 @@ def text_encoder_device_patched(): return comfy.model_management.get_torch_device() +def patched_get_autocast_device(dev): + # https://github.com/lllyasviel/Fooocus/discussions/571 + # https://github.com/lllyasviel/Fooocus/issues/620 + result = '' + if hasattr(dev, 'type'): + result = str(dev.type) + if 'cuda' in result: + return 'cuda' + else: + return 'cpu' + + def patch_all(): + comfy.model_management.get_autocast_device = patched_get_autocast_device comfy.samplers.SAMPLER_NAMES += ['dpmpp_fooocus_2m_sde_inpaint_seamless'] comfy.model_management.text_encoder_device = text_encoder_device_patched comfy.model_patcher.ModelPatcher.calculate_weight = calculate_weight_patched