1 Star 0 Fork 0

tansunyj/ComfyUI_UltimateSDUpscale

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
__init__.py 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
ssit 提交于 2023-08-15 17:22 . Refactoring
import sys
import os
repo_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, repo_dir)
original_modules = sys.modules.copy()
# Place aside potentially conflicting modules
modules_used = [
"modules",
"modules.devices",
"modules.images",
"modules.processing",
"modules.scripts",
"modules.shared",
"modules.upscaler",
"utils",
]
original_imported_modules = {}
for module in modules_used:
if module in sys.modules:
original_imported_modules[module] = sys.modules.pop(module)
# Proceed with node setup
from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]
# Clean up imports
# Remove repo directory from path
sys.path.remove(repo_dir)
# Remove any new modules
modules_to_remove = []
for module in sys.modules:
if module not in original_modules:
modules_to_remove.append(module)
for module in modules_to_remove:
del sys.modules[module]
# Restore original modules
sys.modules.update(original_imported_modules)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/tansunyj/ComfyUI_UltimateSDUpscale.git
[email protected]:tansunyj/ComfyUI_UltimateSDUpscale.git
tansunyj
ComfyUI_UltimateSDUpscale
ComfyUI_UltimateSDUpscale
15-import-failed-with-the-latest-ulimatesdupscale

搜索帮助