mirror of
https://git.datalinker.icu/kijai/ComfyUI-CogVideoXWrapper.git
synced 2025-12-10 05:14:22 +08:00
Update nodes.py
This commit is contained in:
parent
5a6bcfd612
commit
860aaf6cb8
9
nodes.py
9
nodes.py
@ -57,9 +57,6 @@ class DownloadAndLoadCogVideoModel:
|
|||||||
offload_device = mm.unet_offload_device()
|
offload_device = mm.unet_offload_device()
|
||||||
mm.soft_empty_cache()
|
mm.soft_empty_cache()
|
||||||
|
|
||||||
#if "I2V" in model and fp8_transformer != "disabled":
|
|
||||||
# raise NotImplementedError("fp8_transformer is not implemented yet for I2V -model")
|
|
||||||
|
|
||||||
dtype = {"bf16": torch.bfloat16, "fp16": torch.float16, "fp32": torch.float32}[precision]
|
dtype = {"bf16": torch.bfloat16, "fp16": torch.float16, "fp32": torch.float32}[precision]
|
||||||
|
|
||||||
if "Fun" in model:
|
if "Fun" in model:
|
||||||
@ -100,15 +97,9 @@ class DownloadAndLoadCogVideoModel:
|
|||||||
param.data = param.data.to(torch.float8_e4m3fn)
|
param.data = param.data.to(torch.float8_e4m3fn)
|
||||||
else:
|
else:
|
||||||
for name, param in transformer.named_parameters():
|
for name, param in transformer.named_parameters():
|
||||||
|
|
||||||
if "patch_embed" not in name:
|
if "patch_embed" not in name:
|
||||||
param.data = param.data.to(torch.float8_e4m3fn)
|
param.data = param.data.to(torch.float8_e4m3fn)
|
||||||
|
|
||||||
else:
|
|
||||||
print(name)
|
|
||||||
print(param.data.dtype)
|
|
||||||
#transformer.to(torch.float8_e4m3fn)
|
|
||||||
|
|
||||||
if fp8_transformer == "fastmode":
|
if fp8_transformer == "fastmode":
|
||||||
from .fp8_optimization import convert_fp8_linear
|
from .fp8_optimization import convert_fp8_linear
|
||||||
convert_fp8_linear(transformer, dtype)
|
convert_fp8_linear(transformer, dtype)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user