Files
DiffSynth-Studio/docs/source_en/tutorial/DownloadModels.md
yrk111222 f6e676cdf9 Add files via upload
再改一次
2024-10-22 09:56:03 +08:00

1.6 KiB

Download Models

We have preset some mainstream Diffusion model download links in DiffSynth-Studio, which you can download and use.

Download Preset Models

You can directly use the download_models function to download the preset model files, where the model ID can refer to the config file.

from diffsynth import download_models

download_models(["FLUX.1-dev"])

For VSCode users, after activating Pylance or other Python language services, typing "" in the code will display all supported model IDs.

image

Download Non-Preset Models

You can select models from two download sources: ModelScope and HuggingFace. Of course, you can also manually download the models you need through browsers or other tools.

from diffsynth import download_customized_models

download_customized_models(
    model_id="Kwai-Kolors/Kolors",
    origin_file_path="vae/diffusion_pytorch_model.fp16.bin",
    local_dir="models/kolors/Kolors/vae",
    downloading_priority=["ModelScope", "HuggingFace"]
)

In this code snippet, we will prioritize downloading from ModelScope according to the download priority, and download the file vae/diffusion_pytorch_model.fp16.bin from the model repository with ID Kwai-Kolors/Kolors in the model library to the local path models/kolors/Kolors/vae.