6 Star 70 Fork 15

yanlang0123/ComfyUI_Lam

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
__init__.py 1.30 KB
一键复制 编辑 原始数据 按行查看 历史
马噥 提交于 2025-03-01 17:05 +08:00 . 功能优化升级
import importlib.util
import glob
import os
import sys
from .lam import init, get_ext_dir
import time
from server import PromptServer
repo_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, repo_dir)
original_modules = sys.modules.copy()
NODE_CLASS_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS = {}
if init():
print("Loading ComfyUI-Lam")
py = get_ext_dir("py")
files = os.listdir(py)
for file in files:
if not file.endswith(".py"):
continue
name = os.path.splitext(file)[0]
try:
imported_module = importlib.import_module(".py.{}".format(name), __name__)
NODE_CLASS_MAPPINGS = {**NODE_CLASS_MAPPINGS, **imported_module.NODE_CLASS_MAPPINGS}
NODE_DISPLAY_NAME_MAPPINGS = {**NODE_DISPLAY_NAME_MAPPINGS, **imported_module.NODE_DISPLAY_NAME_MAPPINGS}
except Exception as e:
print("节点:'"+name+"'导入异常",e)
WEB_DIRECTORY = "./js"
file_directory = os.path.dirname(os.path.abspath(__file__))
PromptServer.instance.app.router.add_static("/wechatauth/static", file_directory+"/pages/static")
PromptServer.instance.app.router.add_static("/paint-board", file_directory+"/pages/paint-board")
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS","WEB_DIRECTORY"]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yanlang0123/ComfyUI_Lam.git
git@gitee.com:yanlang0123/ComfyUI_Lam.git
yanlang0123
ComfyUI_Lam
ComfyUI_Lam
cu121

搜索帮助