Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,19 @@
|
|
|
|
1 |
import random
|
|
|
2 |
import torch
|
3 |
import numpy as np
|
4 |
from PIL import Image
|
5 |
import gradio as gr
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
# Import nodes and custom modules
|
8 |
import nodes
|
9 |
from nodes import NODE_CLASS_MAPPINGS
|
|
|
1 |
+
import os
|
2 |
import random
|
3 |
+
import subprocess
|
4 |
import torch
|
5 |
import numpy as np
|
6 |
from PIL import Image
|
7 |
import gradio as gr
|
8 |
|
9 |
+
# Clone the repository if not already present
|
10 |
+
if not os.path.exists('ComfyUI'):
|
11 |
+
subprocess.run(['git', 'clone', '-b', 'totoro4', 'https://github.com/camenduru/ComfyUI.git'])
|
12 |
+
|
13 |
+
# Append paths to sys.path for imports
|
14 |
+
import sys
|
15 |
+
sys.path.append('./ComfyUI/totoro_extras')
|
16 |
+
|
17 |
# Import nodes and custom modules
|
18 |
import nodes
|
19 |
from nodes import NODE_CLASS_MAPPINGS
|