comfyUI IPAdapter 安装之后,无法看到Ipadapter的菜单解决办法

我们在手动安装comfyUI IPAdapter安装之后,很有可能重启之后,仍然无法看到Ipadapter的菜单,而且启动信息窗口也不报错,怎么解决这个问题呢?

解决办法,需要手工修改python 代码:

此时需要改写ComfyUI/custom_nodes/ComfyUI_IPAdapter_plus/__init__.py的代码,这是因为这个代码有遗漏,根本没有加载功能菜单到comfyUI菜单上来

整个修改后/__init__.py的代码如下:

原本这个程序 只有两行代码:

from .IPAdapterPlus import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS

__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']

修改后完整代码如下:

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 existing modules if using a1111 web ui

modules_used = [

"IPAdapterModelLoader",

"IPAdapterApply",

"IPAdapterApplyEncoded",

"PrepImageForClipVision",

"IPAdapterEncoder",

"IPAdapterSaveEmbeds",

"IPAdapterLoadEmbeds",

]

original_webui_modules = {}

for module in modules_used:

if module in sys.modules:

original_webui_modules[module] = sys.modules.pop(module)

# Proceed with node setup

from .IPAdapterPlus 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_webui_modules)

保存重启,就能看到IPApter的菜单了

编辑于 2023-11-03 15:40・IP 属地上海

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值