MCPcopy Index your code
hub / github.com/modelscope/DiffSynth-Studio / download_customized_models

Function download_customized_models

diffsynth/models/downloader.py:53–69  ·  view source on GitHub ↗
(
    model_id,
    origin_file_path,
    local_dir,
    downloading_priority: List[Preset_model_website] = ["ModelScope", "HuggingFace"],
)

Source from the content-addressed store, hash-verified

51
52
53def download_customized_models(
54 model_id,
55 origin_file_path,
56 local_dir,
57 downloading_priority: List[Preset_model_website] = ["ModelScope", "HuggingFace"],
58):
59 downloaded_files = []
60 for website in downloading_priority:
61 # Check if the file is downloaded.
62 file_to_download = os.path.join(local_dir, os.path.basename(origin_file_path))
63 if file_to_download in downloaded_files:
64 continue
65 # Download
66 website_to_download_fn[website](model_id, origin_file_path, local_dir)
67 if os.path.basename(origin_file_path) in os.listdir(local_dir):
68 downloaded_files.append(file_to_download)
69 return downloaded_files
70
71
72def download_models(

Callers 13

load_modelFunction · 0.90
hunyuanvideo_6G.pyFile · 0.90
entity_control.pyFile · 0.90
build_pipelineFunction · 0.90
entity_inpaint.pyFile · 0.90
artaug_flux.pyFile · 0.90
flux_controlnet.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected