mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-10 05:22:34 +08:00
Fix fp16 autocast RuntimeError on Macs.
This commit is contained in:
parent
a74c5dbf37
commit
4b471cb8c2
@ -466,7 +466,8 @@ def vae_dtype():
|
||||
|
||||
def get_autocast_device(dev):
|
||||
if hasattr(dev, 'type'):
|
||||
return dev.type
|
||||
return dev.type if not (dev.type == "mps" and should_use_fp16(
|
||||
dev, prioritize_performance=False)) else "cpu"
|
||||
return "cuda"
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user