ComfyUI/comfy/checkpoint_pickle.py

14 lines
286 B
Python
Raw Normal View History

2023-06-13 14:11:33 +00:00
import pickle
load = pickle.load
class Empty:
pass
class Unpickler(pickle.Unpickler):
def find_class(self, module, name):
#TODO: safe unpickle
if module.startswith("pytorch_lightning"):
return Empty
return super().find_class(module, name)