Upload folder using huggingface_hub
Browse files- requirements.txt +3 -3
- utils/app_utils.py +32 -8
- yaml/file_list.yaml +12 -4
- yaml/model_list.yaml +12 -2
requirements.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
comfyui-frontend-package==1.45.
|
| 2 |
comfyui-workflow-templates==0.10.7
|
| 3 |
-
comfyui-embedded-docs==0.5.
|
| 4 |
torch
|
| 5 |
torchsde
|
| 6 |
torchvision
|
|
@@ -22,7 +22,7 @@ alembic
|
|
| 22 |
SQLAlchemy>=2.0.0
|
| 23 |
filelock
|
| 24 |
av>=16.0.0
|
| 25 |
-
comfy-kitchen==0.2.
|
| 26 |
comfy-aimdo==0.4.10
|
| 27 |
requests
|
| 28 |
simpleeval>=1.0.0
|
|
|
|
| 1 |
+
comfyui-frontend-package==1.45.20
|
| 2 |
comfyui-workflow-templates==0.10.7
|
| 3 |
+
comfyui-embedded-docs==0.5.6
|
| 4 |
torch
|
| 5 |
torchsde
|
| 6 |
torchvision
|
|
|
|
| 22 |
SQLAlchemy>=2.0.0
|
| 23 |
filelock
|
| 24 |
av>=16.0.0
|
| 25 |
+
comfy-kitchen==0.2.15
|
| 26 |
comfy-aimdo==0.4.10
|
| 27 |
requests
|
| 28 |
simpleeval>=1.0.0
|
utils/app_utils.py
CHANGED
|
@@ -129,12 +129,20 @@ def get_civitai_file_info(version_id: str) -> dict | None:
|
|
| 129 |
response.raise_for_status()
|
| 130 |
data = response.json()
|
| 131 |
|
|
|
|
|
|
|
|
|
|
| 132 |
for file_data in data.get('files', []):
|
| 133 |
if file_data.get('type') == 'Model' and file_data['name'].endswith(('.safetensors', '.pt', '.bin')):
|
| 134 |
-
|
|
|
|
| 135 |
|
| 136 |
-
if data.get('files'):
|
| 137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
except Exception:
|
| 139 |
return None
|
| 140 |
|
|
@@ -173,9 +181,15 @@ def get_lora_path(source: str, id_or_url: str, civitai_key: str, progress) -> tu
|
|
| 173 |
version_id = sanitize_id(id_or_url)
|
| 174 |
if not version_id:
|
| 175 |
return None, "Invalid Civitai ID provided. Must be numeric."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
filename = sanitize_filename(f"civitai_{version_id}.safetensors")
|
| 177 |
local_path = os.path.join(LORA_DIR, filename)
|
| 178 |
-
file_info = get_civitai_file_info(version_id)
|
| 179 |
api_key_to_use = civitai_key
|
| 180 |
source_name = f"Civitai ID {version_id}"
|
| 181 |
elif source == "Hugging Face":
|
|
@@ -223,13 +237,18 @@ def get_embedding_path(source: str, id_or_url: str, civitai_key: str, progress)
|
|
| 223 |
|
| 224 |
try:
|
| 225 |
if source == "Civitai":
|
| 226 |
-
file_ext = ".safetensors"
|
| 227 |
version_id = sanitize_id(id_or_url)
|
| 228 |
if not version_id:
|
| 229 |
return None, "Invalid Civitai ID. Must be numeric."
|
| 230 |
|
| 231 |
file_info = get_civitai_file_info(version_id)
|
| 232 |
-
if file_info
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 233 |
file_ext = os.path.splitext(file_info['name'])[1]
|
| 234 |
|
| 235 |
filename = sanitize_filename(f"civitai_{version_id}{file_ext}")
|
|
@@ -280,13 +299,18 @@ def get_vae_path(source: str, id_or_url: str, civitai_key: str, progress) -> tup
|
|
| 280 |
|
| 281 |
try:
|
| 282 |
if source == "Civitai":
|
| 283 |
-
file_ext = ".safetensors"
|
| 284 |
version_id = sanitize_id(id_or_url)
|
| 285 |
if not version_id:
|
| 286 |
return None, "Invalid Civitai ID. Must be numeric."
|
| 287 |
|
| 288 |
file_info = get_civitai_file_info(version_id)
|
| 289 |
-
if file_info
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 290 |
file_ext = os.path.splitext(file_info['name'])[1]
|
| 291 |
|
| 292 |
filename = sanitize_filename(f"civitai_{version_id}{file_ext}")
|
|
|
|
| 129 |
response.raise_for_status()
|
| 130 |
data = response.json()
|
| 131 |
|
| 132 |
+
model_type = data.get('model', {}).get('type')
|
| 133 |
+
|
| 134 |
+
result_file = None
|
| 135 |
for file_data in data.get('files', []):
|
| 136 |
if file_data.get('type') == 'Model' and file_data['name'].endswith(('.safetensors', '.pt', '.bin')):
|
| 137 |
+
result_file = file_data.copy()
|
| 138 |
+
break
|
| 139 |
|
| 140 |
+
if not result_file and data.get('files'):
|
| 141 |
+
result_file = data['files'][0].copy()
|
| 142 |
+
|
| 143 |
+
if result_file:
|
| 144 |
+
result_file['model_type'] = model_type
|
| 145 |
+
return result_file
|
| 146 |
except Exception:
|
| 147 |
return None
|
| 148 |
|
|
|
|
| 181 |
version_id = sanitize_id(id_or_url)
|
| 182 |
if not version_id:
|
| 183 |
return None, "Invalid Civitai ID provided. Must be numeric."
|
| 184 |
+
|
| 185 |
+
file_info = get_civitai_file_info(version_id)
|
| 186 |
+
if file_info:
|
| 187 |
+
model_type = file_info.get('model_type')
|
| 188 |
+
if not model_type or model_type.lower() not in ['lora', 'lycoris', 'dora']:
|
| 189 |
+
return None, f"Invalid Civitai model type '{model_type}' for LoRA. Allowed types: LoRA, LyCORIS, DoRA."
|
| 190 |
+
|
| 191 |
filename = sanitize_filename(f"civitai_{version_id}.safetensors")
|
| 192 |
local_path = os.path.join(LORA_DIR, filename)
|
|
|
|
| 193 |
api_key_to_use = civitai_key
|
| 194 |
source_name = f"Civitai ID {version_id}"
|
| 195 |
elif source == "Hugging Face":
|
|
|
|
| 237 |
|
| 238 |
try:
|
| 239 |
if source == "Civitai":
|
|
|
|
| 240 |
version_id = sanitize_id(id_or_url)
|
| 241 |
if not version_id:
|
| 242 |
return None, "Invalid Civitai ID. Must be numeric."
|
| 243 |
|
| 244 |
file_info = get_civitai_file_info(version_id)
|
| 245 |
+
if file_info:
|
| 246 |
+
model_type = file_info.get('model_type')
|
| 247 |
+
if not model_type or model_type.lower() not in ['embedding', 'textualinversion']:
|
| 248 |
+
return None, f"Invalid Civitai model type '{model_type}' for Embedding. Allowed types: Embedding."
|
| 249 |
+
|
| 250 |
+
file_ext = ".safetensors"
|
| 251 |
+
if file_info and file_info.get('name') and file_info['name'].lower().endswith(('.pt', '.bin')):
|
| 252 |
file_ext = os.path.splitext(file_info['name'])[1]
|
| 253 |
|
| 254 |
filename = sanitize_filename(f"civitai_{version_id}{file_ext}")
|
|
|
|
| 299 |
|
| 300 |
try:
|
| 301 |
if source == "Civitai":
|
|
|
|
| 302 |
version_id = sanitize_id(id_or_url)
|
| 303 |
if not version_id:
|
| 304 |
return None, "Invalid Civitai ID. Must be numeric."
|
| 305 |
|
| 306 |
file_info = get_civitai_file_info(version_id)
|
| 307 |
+
if file_info:
|
| 308 |
+
model_type = file_info.get('model_type')
|
| 309 |
+
if not model_type or model_type.lower() != 'vae':
|
| 310 |
+
return None, f"Invalid Civitai model type '{model_type}' for VAE. Allowed types: VAE."
|
| 311 |
+
|
| 312 |
+
file_ext = ".safetensors"
|
| 313 |
+
if file_info and file_info.get('name') and file_info['name'].lower().endswith(('.pt', '.bin')):
|
| 314 |
file_ext = os.path.splitext(file_info['name'])[1]
|
| 315 |
|
| 316 |
filename = sanitize_filename(f"civitai_{version_id}{file_ext}")
|
yaml/file_list.yaml
CHANGED
|
@@ -475,18 +475,26 @@ file:
|
|
| 475 |
repo_id: "nvidia/Cosmos-Predict2-14B-Text2Image"
|
| 476 |
repository_file_path: "model.pt"
|
| 477 |
# Anima
|
| 478 |
-
- filename: "
|
| 479 |
source: "hf"
|
| 480 |
repo_id: "diffusionmodels1254ani/waiANIMA"
|
| 481 |
-
repository_file_path: "
|
| 482 |
- filename: "anima-base-v1.0.safetensors"
|
| 483 |
source: "hf"
|
| 484 |
repo_id: "circlestone-labs/Anima"
|
| 485 |
repository_file_path: "split_files/diffusion_models/anima-base-v1.0.safetensors"
|
| 486 |
-
- filename: "
|
| 487 |
source: "hf"
|
| 488 |
repo_id: "duongve/AnimaYume"
|
| 489 |
-
repository_file_path: "split_files/diffusion_models/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 490 |
- filename: "anima_pencil-v2.1.0.safetensors"
|
| 491 |
source: "hf"
|
| 492 |
repo_id: "bluepen5805/anima-models"
|
|
|
|
| 475 |
repo_id: "nvidia/Cosmos-Predict2-14B-Text2Image"
|
| 476 |
repository_file_path: "model.pt"
|
| 477 |
# Anima
|
| 478 |
+
- filename: "waiANIMA_v10Base10.safetensors"
|
| 479 |
source: "hf"
|
| 480 |
repo_id: "diffusionmodels1254ani/waiANIMA"
|
| 481 |
+
repository_file_path: "waiANIMA_v10Base10.safetensors"
|
| 482 |
- filename: "anima-base-v1.0.safetensors"
|
| 483 |
source: "hf"
|
| 484 |
repo_id: "circlestone-labs/Anima"
|
| 485 |
repository_file_path: "split_files/diffusion_models/anima-base-v1.0.safetensors"
|
| 486 |
+
- filename: "AnimaYume_v10_final_base.safetensors"
|
| 487 |
source: "hf"
|
| 488 |
repo_id: "duongve/AnimaYume"
|
| 489 |
+
repository_file_path: "split_files/diffusion_models/AnimaYume_v10_final_base.safetensors"
|
| 490 |
+
- filename: "hassakuAnima_v1Style.safetensors"
|
| 491 |
+
source: "hf"
|
| 492 |
+
repo_id: "diffusionmodels1254ani/hassakuAnima"
|
| 493 |
+
repository_file_path: "hassakuAnima_v1Style.safetensors"
|
| 494 |
+
- filename: "kirazuriAnima_v30AnimaBase1.safetensors"
|
| 495 |
+
source: "hf"
|
| 496 |
+
repo_id: "diffusionmodels1254ani/kirazuriAnima_v30AnimaBase1"
|
| 497 |
+
repository_file_path: "kirazuriAnima_v30AnimaBase1.safetensors"
|
| 498 |
- filename: "anima_pencil-v2.1.0.safetensors"
|
| 499 |
source: "hf"
|
| 500 |
repo_id: "bluepen5805/anima-models"
|
yaml/model_list.yaml
CHANGED
|
@@ -156,12 +156,12 @@ Checkpoint:
|
|
| 156 |
models:
|
| 157 |
- display_name: "WAI0731/waiANIMA-v1.0"
|
| 158 |
components:
|
| 159 |
-
unet: "
|
| 160 |
vae: "qwen_image_vae.safetensors"
|
| 161 |
clip: "qwen_3_06b_base.safetensors"
|
| 162 |
- display_name: "duongve/AnimaYume-v1.0"
|
| 163 |
components:
|
| 164 |
-
unet: "
|
| 165 |
vae: "qwen_image_vae.safetensors"
|
| 166 |
clip: "qwen_3_06b_base.safetensors"
|
| 167 |
- display_name: "bluepen5805/Anima-pencil-v2.1"
|
|
@@ -169,6 +169,16 @@ Checkpoint:
|
|
| 169 |
unet: "anima_pencil-v2.1.0.safetensors"
|
| 170 |
vae: "qwen_image_vae.safetensors"
|
| 171 |
clip: "qwen_3_06b_base.safetensors"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
- display_name: "circlestone-labs/Anima-base-v1.0"
|
| 173 |
components:
|
| 174 |
unet: "anima-base-v1.0.safetensors"
|
|
|
|
| 156 |
models:
|
| 157 |
- display_name: "WAI0731/waiANIMA-v1.0"
|
| 158 |
components:
|
| 159 |
+
unet: "waiANIMA_v10Base10.safetensors"
|
| 160 |
vae: "qwen_image_vae.safetensors"
|
| 161 |
clip: "qwen_3_06b_base.safetensors"
|
| 162 |
- display_name: "duongve/AnimaYume-v1.0"
|
| 163 |
components:
|
| 164 |
+
unet: "AnimaYume_v10_final_base.safetensors"
|
| 165 |
vae: "qwen_image_vae.safetensors"
|
| 166 |
clip: "qwen_3_06b_base.safetensors"
|
| 167 |
- display_name: "bluepen5805/Anima-pencil-v2.1"
|
|
|
|
| 169 |
unet: "anima_pencil-v2.1.0.safetensors"
|
| 170 |
vae: "qwen_image_vae.safetensors"
|
| 171 |
clip: "qwen_3_06b_base.safetensors"
|
| 172 |
+
- display_name: "Ikena/Hassaku-Anima-v1-Style"
|
| 173 |
+
components:
|
| 174 |
+
unet: "hassakuAnima_v1Style.safetensors"
|
| 175 |
+
vae: "qwen_image_vae.safetensors"
|
| 176 |
+
clip: "qwen_3_06b_base.safetensors"
|
| 177 |
+
- display_name: "motimalu/Kirazuri (Anima)-v3.0"
|
| 178 |
+
components:
|
| 179 |
+
unet: "hassakuAnima_v1Style.safetensors"
|
| 180 |
+
vae: "qwen_image_vae.safetensors"
|
| 181 |
+
clip: "qwen_3_06b_base.safetensors"
|
| 182 |
- display_name: "circlestone-labs/Anima-base-v1.0"
|
| 183 |
components:
|
| 184 |
unet: "anima-base-v1.0.safetensors"
|