Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -52,14 +52,20 @@ def download_models():
|
|
52 |
("comfyanonymous/flux_text_encoders", "t5xxl_fp16.safetensors", "models/text_encoders"),
|
53 |
("zer0int/CLIP-GmP-ViT-L-14", "ViT-L-14-TEXT-detail-improved-hiT-GmP-HF.safetensors", "models/text_encoders"),
|
54 |
("black-forest-labs/FLUX.1-dev", "ae.safetensors", "models/vae"),
|
55 |
-
("black-forest-labs/FLUX.1-dev", "flux1-dev.safetensors
|
56 |
("google/siglip-so400m-patch14-384", "model.safetensors", "models/clip_vision"),
|
57 |
("nftnik/NFTNIK-FLUX.1-dev-LoRA", "NFTNIK_FLUX.1[dev]_LoRA.safetensors", "models/lora")
|
58 |
]
|
59 |
|
60 |
for repo_id, filename, local_dir in models:
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
# Download models antes de inicializar
|
65 |
download_models()
|
|
|
52 |
("comfyanonymous/flux_text_encoders", "t5xxl_fp16.safetensors", "models/text_encoders"),
|
53 |
("zer0int/CLIP-GmP-ViT-L-14", "ViT-L-14-TEXT-detail-improved-hiT-GmP-HF.safetensors", "models/text_encoders"),
|
54 |
("black-forest-labs/FLUX.1-dev", "ae.safetensors", "models/vae"),
|
55 |
+
("black-forest-labs/FLUX.1-dev", "flux1-dev.safetensors", "models/diffusion_models"), # Corrigido aqui
|
56 |
("google/siglip-so400m-patch14-384", "model.safetensors", "models/clip_vision"),
|
57 |
("nftnik/NFTNIK-FLUX.1-dev-LoRA", "NFTNIK_FLUX.1[dev]_LoRA.safetensors", "models/lora")
|
58 |
]
|
59 |
|
60 |
for repo_id, filename, local_dir in models:
|
61 |
+
try:
|
62 |
+
os.makedirs(local_dir, exist_ok=True)
|
63 |
+
print(f"Baixando {filename} de {repo_id}...")
|
64 |
+
hf_hub_download(repo_id=repo_id, filename=filename, local_dir=local_dir)
|
65 |
+
except Exception as e:
|
66 |
+
print(f"Erro ao baixar {filename} de {repo_id}: {str(e)}")
|
67 |
+
# Continue mesmo se um download falhar
|
68 |
+
continue
|
69 |
|
70 |
# Download models antes de inicializar
|
71 |
download_models()
|