Carlexxx commited on
Commit
6f75721
·
1 Parent(s): 1f32e37

[Sincronização Automática] - 2025-09-23 17:16:34

Browse files
Files changed (5) hide show
  1. Dockerfile +2 -1
  2. download_models.py +2 -2
  3. packages.txt +0 -1
  4. run.py +0 -20
  5. setup.py +0 -63
Dockerfile CHANGED
@@ -88,10 +88,11 @@ RUN pip install -r requirements.txt
88
  # =============================================================================
89
  # CLONAGEM E INSTALAÇÃO DOS REPOSITÓRIOS DA APLICAÇÃO
90
  # =============================================================================
91
- RUN git clone https://github.com/Lightricks/LTX-Video.git && cd LTX-Video && pip install -e .[inference]
92
  RUN git clone https://github.com/Wan-Video/Wan2.2.git && cd Wan2.2 && pip install -r requirements.txt && pip install -r requirements_s2v.txt
93
  RUN git clone https://github.com/bytedance-seed/SeedVR.git && cd SeedVR && pip install -r requirements.txt
94
  RUN git clone https://github.com/hkchengrex/MMAudio.git && cd MMAudio && pip install -e .
 
95
 
96
  # =============================================================================
97
  # COPIA O CÓDIGO DA APLICAÇÃO E CONFIGURA PERMISSÕES
 
88
  # =============================================================================
89
  # CLONAGEM E INSTALAÇÃO DOS REPOSITÓRIOS DA APLICAÇÃO
90
  # =============================================================================
91
+
92
  RUN git clone https://github.com/Wan-Video/Wan2.2.git && cd Wan2.2 && pip install -r requirements.txt && pip install -r requirements_s2v.txt
93
  RUN git clone https://github.com/bytedance-seed/SeedVR.git && cd SeedVR && pip install -r requirements.txt
94
  RUN git clone https://github.com/hkchengrex/MMAudio.git && cd MMAudio && pip install -e .
95
+ RUN git clone https://github.com/Lightricks/LTX-Video.git && cd LTX-Video && pip install -e .[inference]
96
 
97
  # =============================================================================
98
  # COPIA O CÓDIGO DA APLICAÇÃO E CONFIGURA PERMISSÕES
download_models.py CHANGED
@@ -27,7 +27,7 @@ def download_model(repo_id, filename, local_dir, desc):
27
  filename=filename,
28
  local_dir=local_dir,
29
  #local_dir_use_symlinks=False, # Importante para ambientes de contêiner
30
- resume_download=True
31
  )
32
  logging.info(f"Download de '{desc}' concluído com sucesso.")
33
  except Exception as e:
@@ -43,7 +43,7 @@ def main():
43
 
44
  # 1. Modelos para LTX-Video
45
  # Usando o modelo FP8 otimizado, como solicitado
46
- ltx_models_dir = "/app/LTX-Video/models_downloaded"
47
  download_model(
48
  repo_id="Lightricks/LTX-Video",
49
  filename="ltxv-13b-0.9.8-dev-fp8.safetensors",
 
27
  filename=filename,
28
  local_dir=local_dir,
29
  #local_dir_use_symlinks=False, # Importante para ambientes de contêiner
30
+ #resume_download=True
31
  )
32
  logging.info(f"Download de '{desc}' concluído com sucesso.")
33
  except Exception as e:
 
43
 
44
  # 1. Modelos para LTX-Video
45
  # Usando o modelo FP8 otimizado, como solicitado
46
+ ltx_models_dir = "/app/ckpts"
47
  download_model(
48
  repo_id="Lightricks/LTX-Video",
49
  filename="ltxv-13b-0.9.8-dev-fp8.safetensors",
packages.txt DELETED
@@ -1 +0,0 @@
1
- ffmpeg
 
 
run.py DELETED
@@ -1,20 +0,0 @@
1
- import argparse
2
- import uvicorn
3
- import os
4
-
5
- def main():
6
- parser = argparse.ArgumentParser(description="Executor do Aduc-Sdr")
7
- parser.add_argument("mode", choices=["gradio", "api"], help="Modo de execução: 'gradio' para a UI, 'api' para o servidor FastAPI.")
8
- args = parser.parse_args()
9
-
10
- if args.mode == "gradio":
11
- print("Iniciando a interface Gradio...")
12
- # Importa e executa a lógica de lançamento que está no final de app_gradio.py
13
- from app_gradio import demo
14
- demo.queue().launch()
15
- elif args.mode == "api":
16
- print("Iniciando o servidor FastAPI em http://127.0.0.1:8000")
17
- uvicorn.run("app_api:app", host="127.0.0.1", port=8000, reload=True)
18
-
19
- if __name__ == "__main__":
20
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
setup.py DELETED
@@ -1,63 +0,0 @@
1
- # setup.py
2
- #
3
- # Copyright (C) August 4, 2025 Carlos Rodrigues dos Santos
4
- #
5
- # Versão 2.0.0 (Clonagem Anônima e Robusta)
6
- # - Usa URLs HTTPS explícitas e anônimas para evitar que o Git tente
7
- # usar credenciais em cache desnecessariamente para repositórios públicos.
8
-
9
- import os
10
- import subprocess
11
- import sys
12
- from pathlib import Path
13
-
14
- # --- Configuração ---
15
- DEPS_DIR = Path("./deps")
16
-
17
- # URLs explícitas e anônimas para os repositórios públicos
18
- REPOS_TO_CLONE = {
19
- "LTX-Video": "https://huggingface.co/spaces/Lightricks/ltx-video-distilled",
20
- "SeedVR_Space": "https://huggingface.co/spaces/ByteDance-Seed/SeedVR2-3B",
21
- "MMAudio": "https://github.com/hkchengrex/MMAudio.git"
22
- }
23
-
24
- def run_command(command, cwd=None):
25
- """Executa um comando no terminal e lida com erros."""
26
- print(f"Executando: {' '.join(command)}")
27
- try:
28
- # Redireciona o stdin para DEVNULL para garantir que o git não tente pedir senha
29
- subprocess.run(
30
- command,
31
- check=True,
32
- cwd=cwd,
33
- stdin=subprocess.DEVNULL,
34
- )
35
- except subprocess.CalledProcessError as e:
36
- print(f"ERRO: O comando falhou com o código de saída {e.returncode}")
37
- # stderr é capturado automaticamente se check=True falhar
38
- print(f"Stderr: {e.stderr}")
39
- sys.exit(1)
40
- except FileNotFoundError:
41
- print(f"ERRO: O comando '{command[0]}' não foi encontrado. Certifique-se de que o git está instalado e no seu PATH.")
42
- sys.exit(1)
43
-
44
- def main():
45
- print("--- Iniciando Setup do Ambiente ADUC-SDR ---")
46
-
47
- DEPS_DIR.mkdir(exist_ok=True)
48
-
49
- for repo_name, repo_url in REPOS_TO_CLONE.items():
50
- repo_path = DEPS_DIR / repo_name
51
- if repo_path.exists():
52
- print(f"Repositório '{repo_name}' já existe. Pulando a clonagem.")
53
- else:
54
- print(f"Clonando '{repo_name}' de {repo_url}...")
55
- run_command(["git", "clone", "--depth", "1", repo_url, str(repo_path)])
56
- print(f"'{repo_name}' clonado com sucesso.")
57
-
58
- print("\n--- Setup do Ambiente Concluído com Sucesso! ---")
59
- print("Você agora pode iniciar a aplicação principal (ex: python app.py).")
60
-
61
- if __name__ == "__main__":
62
- main()
63
-