This commit is contained in:
Haoming 2025-07-28 10:21:55 +08:00
parent fb998d1eda
commit d1199529c0
2 changed files with 6 additions and 65 deletions

View File

@ -1,24 +0,0 @@
import os
import shutil
from diffusers.loaders.single_file_utils import DIFFUSERS_DEFAULT_PIPELINE_PATHS
from huggingface_hub import snapshot_download
token = None
DIFFUSERS_DEFAULT_PIPELINE_PATHS['Kolor'] = {"pretrained_model_name_or_path": "Kwai-Kolors/Kolors"}
DIFFUSERS_DEFAULT_PIPELINE_PATHS['hunyuan'] = {"pretrained_model_name_or_path": "Tencent-Hunyuan/HunyuanDiT-Diffusers"}
DIFFUSERS_DEFAULT_PIPELINE_PATHS['flux'] = {"pretrained_model_name_or_path": "black-forest-labs/FLUX.1-dev"}
DIFFUSERS_DEFAULT_PIPELINE_PATHS['flux_schnell'] = {"pretrained_model_name_or_path": "black-forest-labs/FLUX.1-schnell"}
for config_name, config in DIFFUSERS_DEFAULT_PIPELINE_PATHS.items():
try:
pretrained_model_name_or_path = config["pretrained_model_name_or_path"]
local_dir = os.path.join('backend', 'huggingface', pretrained_model_name_or_path)
os.makedirs(local_dir, exist_ok=True)
snapshot_download(pretrained_model_name_or_path, local_dir=local_dir, allow_patterns=['*.json', '*.txt'],
token=token, force_download=True)
shutil.rmtree(os.path.join(local_dir, '.cache'))
print(pretrained_model_name_or_path)
except Exception as e:
print(e)

View File

@ -1,42 +1,7 @@
[tool.black]
line-length = 1024
[tool.ruff]
target-version = "py39"
[tool.ruff.lint]
extend-select = [
"B",
"C",
"I",
"W",
]
exclude = [
"extensions",
"extensions-disabled",
"modules_forge",
"modules",
"ldm_patched",
"extensions-builtin",
]
ignore = [
"E501", # Line too long
"E721", # Do not compare types, use `isinstance`
"E731", # Do not assign a `lambda` expression, use a `def`
"I001", # Import block is un-sorted or un-formatted
"C901", # Function is too complex
"C408", # Rewrite as a literal
"W605", # invalid escape sequence, messes with some docstrings
]
[tool.ruff.lint.per-file-ignores]
"webui.py" = ["E402"] # Module level import not at top of file
[tool.ruff.lint.flake8-bugbear]
# Allow default arguments like, e.g., `data: List[str] = fastapi.Query(None)`.
extend-immutable-calls = ["fastapi.Depends", "fastapi.security.HTTPBasic"]
[tool.pytest.ini_options]
base_url = "http://127.0.0.1:7860"
target-version = "py311"
exclude = ["extensions"]
lint.select = ["N805", "S307", "S102", "T", "W", "F"]