Forge webui support (#517)

* Forge support

* Separate Forge implementation

* Remove debug print
This commit is contained in:
catboxanon
2024-02-27 07:19:36 -05:00
committed by GitHub
parent ac0bb9ab00
commit 1441b55d6f
6 changed files with 171 additions and 37 deletions

View File

@@ -1,7 +1,6 @@
from __future__ import annotations
import importlib
import re
import sys
from functools import lru_cache
from pathlib import Path
@@ -9,6 +8,8 @@ from textwrap import dedent
from modules import extensions, sd_models, shared
from .common import cn_model_regex
try:
from modules.paths import extensions_builtin_dir, extensions_dir, models_path
except ImportError as e:
@@ -22,6 +23,7 @@ except ImportError as e:
ext_path = Path(extensions_dir)
ext_builtin_path = Path(extensions_builtin_dir)
controlnet_exists = False
controlnet_forge = False
controlnet_path = None
cn_base_path = ""
@@ -42,16 +44,6 @@ if controlnet_path is not None:
if target_path not in sys.path:
sys.path.append(target_path)
cn_model_module = {
"inpaint": "inpaint_global_harmonious",
"scribble": "t2ia_sketch_pidi",
"lineart": "lineart_coarse",
"openpose": "openpose_full",
"tile": "tile_resample",
"depth": "depth_midas",
}
cn_model_regex = re.compile("|".join(cn_model_module.keys()))
class ControlNetExt:
def __init__(self):