mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-08-02 15:04:50 +08:00
Add a node to set the model compute dtype for debugging.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import hashlib
|
||||
import torch
|
||||
|
||||
from comfy.cli_args import args
|
||||
|
||||
@@ -35,3 +36,11 @@ def hasher():
|
||||
"sha512": hashlib.sha512
|
||||
}
|
||||
return hashfuncs[args.default_hashing_function]
|
||||
|
||||
def string_to_torch_dtype(string):
|
||||
if string == "fp32":
|
||||
return torch.float32
|
||||
if string == "fp16":
|
||||
return torch.float16
|
||||
if string == "bf16":
|
||||
return torch.bfloat16
|
||||
|
Reference in New Issue
Block a user