This commit is contained in:
lllyasviel
2024-01-27 20:42:38 -08:00
parent 60bd01e378
commit b5805732f1
3 changed files with 33 additions and 0 deletions

View File

@@ -7,6 +7,13 @@ def apply_controlnet_advanced(
end_percent,
positive_advanced_weighting=None,
negative_advanced_weighting=None):
a = 0
unet.control_options = [1, 2, 3]
m = unet.clone()
m.control_options = [4, 5, 6]
return m

View File

@@ -17,6 +17,9 @@ def initialize_forge():
import modules_forge.patch_precision
modules_forge.patch_precision.patch_all_precision()
import modules_forge.patch_basic
modules_forge.patch_basic.patch_all_basics()
if model_management.directml_enabled:
model_management.lowvram_available = True
model_management.OOM_EXCEPTION = Exception

View File

@@ -0,0 +1,23 @@
from ldm_patched.modules.model_patcher import ModelPatcher
og_model_patcher_init = ModelPatcher.__init__
og_model_patcher_clone = ModelPatcher.clone
def patched_model_patcher_init(self, *args, **kwargs):
h = og_model_patcher_init(self, *args, **kwargs)
self.control_options = []
return h
def patched_model_patcher_clone(self):
cloned = og_model_patcher_clone(self)
cloned.control_options = [x for x in self.control_options]
return cloned
def patch_all_basics():
ModelPatcher.__init__ = patched_model_patcher_init
ModelPatcher.clone = patched_model_patcher_clone
return