Skip to content

Commit e4ea393

Browse files
Fix loading old stable diffusion ckpt files on newer numpy. (#10333)
1 parent c8674bc commit e4ea393

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

comfy/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ class ModelCheckpoint:
3939
pass
4040
ModelCheckpoint.__module__ = "pytorch_lightning.callbacks.model_checkpoint"
4141

42-
from numpy.core.multiarray import scalar
42+
def scalar(*args, **kwargs):
43+
from numpy.core.multiarray import scalar as sc
44+
return sc(*args, **kwargs)
45+
scalar.__module__ = "numpy.core.multiarray"
46+
4347
from numpy import dtype
4448
from numpy.dtypes import Float64DType
4549
from _codecs import encode

0 commit comments

Comments
 (0)