mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-01-26 19:29:54 +00:00
fix: replace CNHijackRestore with nullcontext for forge
This commit is contained in:
@@ -13,8 +13,17 @@ except ImportError:
|
||||
get_cn_models,
|
||||
)
|
||||
|
||||
from .restore import cn_allow_script_control
|
||||
|
||||
if controlnet_type == "forge":
|
||||
from contextlib import nullcontext as CNHijackRestore # noqa: N812
|
||||
else:
|
||||
from .restore import CNHijackRestore
|
||||
|
||||
__all__ = [
|
||||
"ControlNetExt",
|
||||
"CNHijackRestore",
|
||||
"cn_allow_script_control",
|
||||
"controlnet_exists",
|
||||
"controlnet_type",
|
||||
"get_cn_models",
|
||||
|
||||
@@ -39,15 +39,13 @@ from adetailer.mask import (
|
||||
from adetailer.traceback import rich_traceback
|
||||
from adetailer.ui import WebuiInfo, adui, ordinal, suffix
|
||||
from controlnet_ext import (
|
||||
CNHijackRestore,
|
||||
ControlNetExt,
|
||||
cn_allow_script_control,
|
||||
controlnet_exists,
|
||||
controlnet_type,
|
||||
get_cn_models,
|
||||
)
|
||||
from controlnet_ext.restore import (
|
||||
CNHijackRestore,
|
||||
cn_allow_script_control,
|
||||
)
|
||||
from modules import images, paths, safe, script_callbacks, scripts, shared
|
||||
from modules.devices import NansException
|
||||
from modules.processing import (
|
||||
|
||||
Reference in New Issue
Block a user