Skip to content
Discussion options

You must be logged in to vote

I found the answer.

📂 ComfyUI/
└── 📂 custom_nodes/
    ├── 📝 __init__.py
    ├── 📝 your_routes1.py
    ├── 📝 your_routes2.py
    └── ...
# __init__.py

import os
import importlib
from pathlib import Path

current_dir = Path(__file__).parent

for file in current_dir.glob("*.py"):
    if file.name != "__init__.py":
        module_name = file.stem
        importlib.import_module(f".{module_name}", package=__package__)

NODE_CLASS_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS = {}
# your_routes.py

import os
import asyncio

from aiohttp import web
import folder_paths
import server

import logging

logger = logging.getLogger(__name__)

routes = server.PromptServer.instance.routes

@routes.get("/you…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by CodingOctocat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant