MCPcopy
hub / github.com/modelscope/DiffSynth-Studio / from_pretrained

Method from_pretrained

diffsynth/models/cog_dit.py:333–338  ·  view source on GitHub ↗
(file_path, torch_dtype=torch.bfloat16)

Source from the content-addressed store, hash-verified

331
332 @staticmethod
333 def from_pretrained(file_path, torch_dtype=torch.bfloat16):
334 model = CogDiT().to(torch_dtype)
335 state_dict = load_state_dict_from_folder(file_path, torch_dtype=torch_dtype)
336 state_dict = CogDiT.state_dict_converter().from_diffusers(state_dict)
337 model.load_state_dict(state_dict)
338 return model
339
340
341

Callers 15

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
init_tokenizerFunction · 0.45
load_processorMethod · 0.45
load_modelFunction · 0.45
__init__Method · 0.45

Calls 5

CogDiTClass · 0.85
toMethod · 0.45
from_diffusersMethod · 0.45
state_dict_converterMethod · 0.45

Tested by

no test coverage detected