mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-04-22 15:29:25 +00:00
i
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
23
modules_forge/patch_basic.py
Normal file
23
modules_forge/patch_basic.py
Normal 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
|
||||
Reference in New Issue
Block a user