modelscope / modelscope/DiffSynth-Studio

local models loading

Open
#1,462 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
13.1k
Forks
1.3k
Avg merge
13h 12m
Merged PRs (30d)
45

Description

Hi, I am trying to load models from local disk using

--model_paths '["models/Wan-AI/Wan2.1-T2V-14B/diffusion_pytorch_model-00001-of-00006.safetensors","models/Wan-AI/Wan2.1-T2V-14B/diffusion_pytorch_model-00002-of-00006.safetensors","models/Wan-AI/Wan2.1-T2V-14B/diffusion_pytorch_model-00003-of-00006.safetensors","models/Wan-AI/Wan2.1-T2V-14B/diffusion_pytorch_model-00004-of-00006.safetensors","models/Wan-AI/Wan2.1-T2V-14B/diffusion_pytorch_model-00005-of-00006.safetensors","models/Wan-AI/Wan2.1-T2V-14B/diffusion_pytorch_model-00006-of-00006.safetensors","models/Wan-AI/Wan2.1-T2V-14B/models_t5_umt5-xxl-enc-bf16.pth","models/Wan-AI/Wan2.1-T2V-14B/Wan2.1_VAE.pth"]' 

but I got the error:

Traceback (most recent call last):
[rank2]:   File "train.py", line 1099, in <module>
[rank2]:     main()
[rank2]:   File "train.py", line 1005, in main
[rank2]:     model = VideoTrainingModule(
[rank2]:             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank2]:   File "train.py", line 475, in __init__
[rank2]:     self.pipe = WanVideoPipeline.from_pretrained(
[rank2]:                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank2]:   File "diffsynth/pipelines/wan_video.py", line 147, in from_pretrained
[rank2]:     model_pool = pipe.download_and_load_models(model_configs, vram_limit)
[rank2]:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank2]:   File "diffsynth/diffusion/base_pipeline.py", line 303, in download_and_load_models
[rank2]:     model_pool.auto_load_model(
[rank2]:   File "diffsynth/models/model_loader.py", line 82, in auto_load_model
[rank2]:     raise ValueError(f"Cannot detect the model type. File: {path}. Model hash: {model_hash}")
[rank2]: ValueError: Cannot detect the model type. File: models/Wan-AI/Wan2.1-T2V-14B/diffusion_pytorch_model-00001-of-00006.safetensors. Model hash: 7607eaaeb524095268b872e4d5189baf

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the failing call chain in train.py, then read WanVideoPipeline.from_pretrained in diffsynth/pipelines/wan_video.py and model loading in diffsynth/diffusion/base_pipeline.py and diffsynth/models/model_loader.py. Reproduce the command with the listed local model files and trace why the first safetensors file cannot be detected. Done means the local Wan model loads without the Cannot detect the model type error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.