Spaces:
Build error
Build error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import subprocess
|
| 3 |
+
import gradio as gr
|
| 4 |
+
|
| 5 |
+
# Clone ComfyUI repository
|
| 6 |
+
if not os.path.exists("ComfyUI"):
|
| 7 |
+
subprocess.run(["git", "clone", "https://github.com/comfyanonymous/ComfyUI.git"])
|
| 8 |
+
|
| 9 |
+
# Install ComfyUI dependencies
|
| 10 |
+
subprocess.run(["pip", "install", "-r", "ComfyUI/requirements.txt"])
|
| 11 |
+
|
| 12 |
+
# Define a Gradio interface
|
| 13 |
+
def run_comfyui(prompt):
|
| 14 |
+
# Add your ComfyUI logic here
|
| 15 |
+
return f"Generated output for: {prompt}"
|
| 16 |
+
|
| 17 |
+
# Launch Gradio app
|
| 18 |
+
iface = gr.Interface(fn=run_comfyui, inputs="text", outputs="text")
|
| 19 |
+
iface.launch()
|