Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -62,7 +62,7 @@ def import_custom_nodes() -> None:
|
|
| 62 |
asyncio.set_event_loop(loop)
|
| 63 |
server_instance = server.PromptServer(loop)
|
| 64 |
execution.PromptQueue(server_instance)
|
| 65 |
-
|
| 66 |
|
| 67 |
# Setup ComfyUI and custom nodes
|
| 68 |
if not os.path.exists("ComfyUI"):
|
|
@@ -81,7 +81,6 @@ os.makedirs("ComfyUI/models/diffusion_models", exist_ok=True)
|
|
| 81 |
os.makedirs("ComfyUI/models/clip", exist_ok=True)
|
| 82 |
os.makedirs("ComfyUI/models/vae", exist_ok=True)
|
| 83 |
os.makedirs("ComfyUI/models/upscale_models", exist_ok=True)
|
| 84 |
-
os.makedirs("ComfyUI/input", exist_ok=True)
|
| 85 |
|
| 86 |
# Download models if not present
|
| 87 |
diffusion_path = "ComfyUI/models/diffusion_models/flux1-dev-fp8.safetensors"
|
|
@@ -112,7 +111,8 @@ if not os.path.exists(esrgan_x4_path):
|
|
| 112 |
add_comfyui_directory_to_sys_path()
|
| 113 |
add_extra_model_paths()
|
| 114 |
from folder_paths import add_model_folder_path
|
| 115 |
-
|
|
|
|
| 116 |
import_custom_nodes()
|
| 117 |
|
| 118 |
from nodes import NODE_CLASS_MAPPINGS
|
|
@@ -200,7 +200,8 @@ def enhance_image(
|
|
| 200 |
temp_path = tmp.name
|
| 201 |
|
| 202 |
image_base = os.path.basename(temp_path)
|
| 203 |
-
|
|
|
|
| 204 |
input_image_path = os.path.join(input_dir, image_base)
|
| 205 |
shutil.copy(temp_path, input_image_path)
|
| 206 |
|
|
|
|
| 62 |
asyncio.set_event_loop(loop)
|
| 63 |
server_instance = server.PromptServer(loop)
|
| 64 |
execution.PromptQueue(server_instance)
|
| 65 |
+
init_extra_nodes()
|
| 66 |
|
| 67 |
# Setup ComfyUI and custom nodes
|
| 68 |
if not os.path.exists("ComfyUI"):
|
|
|
|
| 81 |
os.makedirs("ComfyUI/models/clip", exist_ok=True)
|
| 82 |
os.makedirs("ComfyUI/models/vae", exist_ok=True)
|
| 83 |
os.makedirs("ComfyUI/models/upscale_models", exist_ok=True)
|
|
|
|
| 84 |
|
| 85 |
# Download models if not present
|
| 86 |
diffusion_path = "ComfyUI/models/diffusion_models/flux1-dev-fp8.safetensors"
|
|
|
|
| 111 |
add_comfyui_directory_to_sys_path()
|
| 112 |
add_extra_model_paths()
|
| 113 |
from folder_paths import add_model_folder_path
|
| 114 |
+
comfy_dir = find_path("ComfyUI")
|
| 115 |
+
add_model_folder_path("unet", os.path.join(comfy_dir, "models", "diffusion_models"))
|
| 116 |
import_custom_nodes()
|
| 117 |
|
| 118 |
from nodes import NODE_CLASS_MAPPINGS
|
|
|
|
| 200 |
temp_path = tmp.name
|
| 201 |
|
| 202 |
image_base = os.path.basename(temp_path)
|
| 203 |
+
comfy_dir = find_path("ComfyUI")
|
| 204 |
+
input_dir = os.path.join(comfy_dir, "input")
|
| 205 |
input_image_path = os.path.join(input_dir, image_base)
|
| 206 |
shutil.copy(temp_path, input_image_path)
|
| 207 |
|