Fix loading old stable diffusion ckpt files on newer numpy. (#10333)

This commit is contained in:
comfyanonymous 2025-10-13 19:18:58 -07:00 committed by GitHub
parent c8674bc6e9
commit e4ea393666
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,7 +39,11 @@ if hasattr(torch.serialization, "add_safe_globals"): # TODO: this was added in
pass pass
ModelCheckpoint.__module__ = "pytorch_lightning.callbacks.model_checkpoint" ModelCheckpoint.__module__ = "pytorch_lightning.callbacks.model_checkpoint"
from numpy.core.multiarray import scalar def scalar(*args, **kwargs):
from numpy.core.multiarray import scalar as sc
return sc(*args, **kwargs)
scalar.__module__ = "numpy.core.multiarray"
from numpy import dtype from numpy import dtype
from numpy.dtypes import Float64DType from numpy.dtypes import Float64DType
from _codecs import encode from _codecs import encode