1
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:
comfyanonymous
2025-02-15 04:15:37 -05:00
parent 1cd6cd6080
commit 2e21122aab
2 changed files with 30 additions and 0 deletions

View File

@@ -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