nftnik commited on
Commit
57ecc99
verified
1 Parent(s): e656061

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -1
app.py CHANGED
@@ -15,8 +15,36 @@ from comfy import model_management
15
  # Configura莽茫o de diret贸rios
16
  BASE_DIR = os.path.dirname(os.path.realpath(__file__))
17
  output_dir = os.path.join(BASE_DIR, "output")
 
18
  os.makedirs(output_dir, exist_ok=True)
19
- folder_paths.set_output_directory(output_dir)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  # Diagn贸stico CUDA
22
  print("Python version:", sys.version)
 
15
  # Configura莽茫o de diret贸rios
16
  BASE_DIR = os.path.dirname(os.path.realpath(__file__))
17
  output_dir = os.path.join(BASE_DIR, "output")
18
+ models_dir = os.path.join(BASE_DIR, "models")
19
  os.makedirs(output_dir, exist_ok=True)
20
+ os.makedirs(models_dir, exist_ok=True)
21
+
22
+ # Configurar caminhos dos modelos
23
+ for model_folder in ["style_models", "text_encoders", "vae", "diffusion_models", "clip_vision"]:
24
+ folder_path = os.path.join(models_dir, model_folder)
25
+ os.makedirs(folder_path, exist_ok=True)
26
+ folder_paths.add_model_folder_path(model_folder, folder_path)
27
+
28
+ # Download dos modelos
29
+ print("Baixando modelos necess谩rios...")
30
+ hf_hub_download(repo_id="black-forest-labs/FLUX.1-Redux-dev",
31
+ filename="flux1-redux-dev.safetensors",
32
+ local_dir=os.path.join(models_dir, "style_models"))
33
+ hf_hub_download(repo_id="comfyanonymous/flux_text_encoders",
34
+ filename="t5xxl_fp16.safetensors",
35
+ local_dir=os.path.join(models_dir, "text_encoders"))
36
+ hf_hub_download(repo_id="zer0int/CLIP-GmP-ViT-L-14",
37
+ filename="ViT-L-14-TEXT-detail-improved-hiT-GmP-TE-only-HF.safetensors",
38
+ local_dir=os.path.join(models_dir, "text_encoders"))
39
+ hf_hub_download(repo_id="black-forest-labs/FLUX.1-dev",
40
+ filename="ae.safetensors",
41
+ local_dir=os.path.join(models_dir, "vae"))
42
+ hf_hub_download(repo_id="black-forest-labs/FLUX.1-dev",
43
+ filename="flux1-dev.sft",
44
+ local_dir=os.path.join(models_dir, "diffusion_models"))
45
+ hf_hub_download(repo_id="google/siglip-so400m-patch14-384",
46
+ filename="model.safetensors",
47
+ local_dir=os.path.join(models_dir, "clip_vision"))
48
 
49
  # Diagn贸stico CUDA
50
  print("Python version:", sys.version)