Skip to content

Commit

Permalink
fix refiner (#2042)
Browse files Browse the repository at this point in the history
  • Loading branch information
lllyasviel authored Sep 4, 2023
1 parent 753b5bb commit 876667f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions scripts/controlnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import modules.scripts as scripts
from modules import shared, devices, script_callbacks, processing, masking, images
import gradio as gr
import time


from einops import rearrange
Expand Down Expand Up @@ -636,12 +637,7 @@ def bound_check_params(unit: external_code.ControlNetUnit) -> None:
setattr(unit, param, default_value)
logger.warning(f'[{unit.module}.{param}] Invalid value({value}), using default value {default_value}.')

def process(self, p, *args):
"""
This function is called before processing begins for AlwaysVisible scripts.
You can modify the processing object (p) here, inject hooks, etc.
args contains all values returned by components from ui()
"""
def controlnet_main_entry(self, p):
sd_ldm = p.sd_model
unet = sd_ldm.model.diffusion_model
self.noise_modifier = None
Expand Down Expand Up @@ -980,6 +976,10 @@ def before_process_batch(self, p, *args, **kwargs):
noise_modifier=self.noise_modifier,
sd_model=p.sd_model)
self.noise_modifier = None

t = time.time()
self.controlnet_main_entry(p)
logger.info(f'ControlNet Hooked - Time = {time.time() - t}')
return

def postprocess_batch(self, p, *args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion scripts/controlnet_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version_flag = 'v1.1.400'
version_flag = 'v1.1.401'

from scripts.logging import logger

Expand Down

0 comments on commit 876667f

Please sign in to comment.