Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,36 +1,16 @@
|
|
| 1 |
-
import os
|
| 2 |
-
import subprocess
|
| 3 |
import gradio as gr
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
# Cambiar al directorio del proyecto
|
| 11 |
-
os.chdir(project_dir)
|
| 12 |
-
|
| 13 |
-
# Crear y activar un entorno virtual (esto es para asegurarte de que los paquetes se instalen correctamente)
|
| 14 |
-
subprocess.run(["python3", "-m", "venv", "venv"])
|
| 15 |
-
subprocess.run(["source", "venv/bin/activate"], shell=True)
|
| 16 |
-
|
| 17 |
-
# Instalar dependencias
|
| 18 |
-
subprocess.run(["pip", "install", "--upgrade", "pip", "setuptools", "wheel"])
|
| 19 |
-
subprocess.run(["pip", "install", "pygit2==1.15.1", "packaging", "gitpython", "requests", "numpy", "pandas"])
|
| 20 |
-
|
| 21 |
-
# Clonar el repositorio desde GitHub
|
| 22 |
-
if not os.path.exists("Fooocus"):
|
| 23 |
-
subprocess.run(["git", "clone", "https://github.com/lllyasviel/Fooocus.git"])
|
| 24 |
-
|
| 25 |
-
# Cambiar al directorio del repositorio clonado
|
| 26 |
-
os.chdir("Fooocus")
|
| 27 |
|
| 28 |
-
|
| 29 |
-
subprocess.run(["python", "entry_with_update.py", "--share", "--always-high-vram"])
|
| 30 |
|
| 31 |
-
#
|
| 32 |
-
|
| 33 |
-
return f"Hello {name}!!"
|
| 34 |
|
| 35 |
-
|
| 36 |
demo.launch()
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import subprocess
|
| 3 |
|
| 4 |
+
def run_fooocus():
|
| 5 |
+
# Ejecutar comandos de instalaci贸n y configuraci贸n
|
| 6 |
+
subprocess.run(['pip', 'install', 'pygit2==1.15.1'], check=True)
|
| 7 |
+
subprocess.run(['git', 'clone', 'https://github.com/lllyasviel/Fooocus.git'], check=True)
|
| 8 |
+
subprocess.run(['python', 'Fooocus/entry_with_update.py', '--share', '--always-high-vram'], check=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
return "Fooocus est谩 en ejecuci贸n."
|
|
|
|
| 11 |
|
| 12 |
+
# Crear la interfaz de Gradio
|
| 13 |
+
demo = gr.Interface(fn=run_fooocus, inputs=[], outputs="text")
|
|
|
|
| 14 |
|
| 15 |
+
# Lanzar la aplicaci贸n Gradio
|
| 16 |
demo.launch()
|