mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
fix auto_cast (#622)
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
version = '2.1.36'
|
version = '2.1.37'
|
||||||
|
|||||||
@@ -455,7 +455,20 @@ def text_encoder_device_patched():
|
|||||||
return comfy.model_management.get_torch_device()
|
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():
|
def patch_all():
|
||||||
|
comfy.model_management.get_autocast_device = patched_get_autocast_device
|
||||||
comfy.samplers.SAMPLER_NAMES += ['dpmpp_fooocus_2m_sde_inpaint_seamless']
|
comfy.samplers.SAMPLER_NAMES += ['dpmpp_fooocus_2m_sde_inpaint_seamless']
|
||||||
comfy.model_management.text_encoder_device = text_encoder_device_patched
|
comfy.model_management.text_encoder_device = text_encoder_device_patched
|
||||||
comfy.model_patcher.ModelPatcher.calculate_weight = calculate_weight_patched
|
comfy.model_patcher.ModelPatcher.calculate_weight = calculate_weight_patched
|
||||||
|
|||||||
Reference in New Issue
Block a user