Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -6,11 +6,18 @@ import torch
|
|
6 |
import gradio as gr
|
7 |
from huggingface_hub import hf_hub_download
|
8 |
import spaces
|
9 |
-
from comfy import model_management
|
10 |
-
from nodes import NODE_CLASS_MAPPINGS
|
11 |
from PIL import Image
|
12 |
from folder_paths import folder_paths
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
# Helper function to get values from objects
|
15 |
def get_value_at_index(obj: Union[Sequence, Mapping], index: int) -> Any:
|
16 |
try:
|
|
|
6 |
import gradio as gr
|
7 |
from huggingface_hub import hf_hub_download
|
8 |
import spaces
|
|
|
|
|
9 |
from PIL import Image
|
10 |
from folder_paths import folder_paths
|
11 |
|
12 |
+
# Append ComfyUI path to sys.path
|
13 |
+
current_dir = os.path.dirname(os.path.abspath(__file__))
|
14 |
+
comfyui_path = os.path.join(current_dir, "ComfyUI")
|
15 |
+
sys.path.append(comfyui_path)
|
16 |
+
|
17 |
+
# Import Comfy modules
|
18 |
+
from comfy import model_management
|
19 |
+
from nodes import NODE_CLASS_MAPPINGS
|
20 |
+
|
21 |
# Helper function to get values from objects
|
22 |
def get_value_at_index(obj: Union[Sequence, Mapping], index: int) -> Any:
|
23 |
try:
|