舒适模型下载
0.5.1
该包提供了一种从互联网下载预训练模型以在 Comfy 项目中使用的简单方法。
要安装该软件包,您可以使用 pip:
测试版本:
pip install -i https://test.pypi.org/simple/ comfy-model-download
将接下来的两行添加到测试版本的requirements.txt 文件中:
--index-url https://test.pypi.org/simple/
comfy_model_download
它需要提供一个 yaml 文件,其中包含要下载的模型以及保存模型的路径。该包将使用指定数量的工作人员并行下载模型。
如果必须从 GCS 下载模型,则需要提供密钥文件。
from comfy_model_download import ModelDownload
download = ModelDownload (
config_file = "models_config.yaml" ,
max_workers = 2 ,
model_path = "path/to/save/models" ,
key_file = "path/to/key/file" ,
)
download . start ()
models.yaml 文件应位于项目的根目录中,并且应具有以下结构:
models :
checkpoints :
- name : JuggernautXL.safetensors
url : gs://example_gcs_bucket/JuggernautXL.safetensors
# force_download: true
- name : AnimateLCM_sd15_t2v_lora.safetensors
url : gs://example_gcs_bucket/AnimateLCM_sd15_t2v_lora.safetensors
ipadapter :
- name : ip-adapter-plus_sd15.safetensors
url : gs://example_gcs_bucket/ip-adapter-plus_sd15.safetensors
animatediff_models :
- name : AnimateLCM_sd15_t2v.ckpt
url : gs://example_gcs_bucket/AnimateLCM_sd15_t2v.ckpt
...
如果模型已经下载并且您想强制下载,可以使用force_download
键。
这些模型可以从 GCS 或通过 HTTP 从互联网下载。
MIT License
Copyright (c) 2024 Freepik Company, Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.