Merge branch 'main' of https://github.com/hako-mikan/sd-webui-regional-prompter
commit
e23d4e65a4
|
|
@ -95,6 +95,11 @@ def denoiser_callback_s(self, params: CFGDenoiserParams):
|
||||||
self.step = params.sampling_step
|
self.step = params.sampling_step
|
||||||
self.total_step = params.total_sampling_steps
|
self.total_step = params.total_sampling_steps
|
||||||
|
|
||||||
|
self.pn = self.pn_s
|
||||||
|
|
||||||
|
if self.only_r:
|
||||||
|
return
|
||||||
|
|
||||||
if "Pro" in self.mode: # in Prompt mode, make masks from sum of attension maps
|
if "Pro" in self.mode: # in Prompt mode, make masks from sum of attension maps
|
||||||
if self.x == None : cloneparams(params,self) # return to step 0 if mask is ready
|
if self.x == None : cloneparams(params,self) # return to step 0 if mask is ready
|
||||||
self.pfirst = True
|
self.pfirst = True
|
||||||
|
|
|
||||||
|
|
@ -229,6 +229,8 @@ class Script(modules.scripts.Script):
|
||||||
self.count = 0
|
self.count = 0
|
||||||
self.eq = True
|
self.eq = True
|
||||||
self.pn = True
|
self.pn = True
|
||||||
|
self.pn_s = True
|
||||||
|
self.only_r = False
|
||||||
self.hr = False
|
self.hr = False
|
||||||
self.hr_scale = 0
|
self.hr_scale = 0
|
||||||
self.hr_w = 0
|
self.hr_w = 0
|
||||||
|
|
@ -549,6 +551,7 @@ class Script(modules.scripts.Script):
|
||||||
else:
|
else:
|
||||||
shared.batch_cond_uncond = orig_batch_cond_uncond
|
shared.batch_cond_uncond = orig_batch_cond_uncond
|
||||||
unloadlorafowards(p)
|
unloadlorafowards(p)
|
||||||
|
denoiserdealer(self, True)
|
||||||
else:
|
else:
|
||||||
hook_forwards(self, p, remove = True)
|
hook_forwards(self, p, remove = True)
|
||||||
setuploras(self)
|
setuploras(self)
|
||||||
|
|
@ -559,7 +562,7 @@ class Script(modules.scripts.Script):
|
||||||
self.ex = "Ex" in self.mode
|
self.ex = "Ex" in self.mode
|
||||||
if not usebase : bratios = "0"
|
if not usebase : bratios = "0"
|
||||||
hook_forwards(self, p)
|
hook_forwards(self, p)
|
||||||
denoiserdealer(self, p)
|
denoiserdealer(self, False)
|
||||||
|
|
||||||
if OPTCOUT in options: commentouter(p)
|
if OPTCOUT in options: commentouter(p)
|
||||||
neighbor(self,p) #detect other extention
|
neighbor(self,p) #detect other extention
|
||||||
|
|
@ -631,7 +634,7 @@ class Script(modules.scripts.Script):
|
||||||
if self.lora_applied: # SBM Don't override orig twice on batch calls.
|
if self.lora_applied: # SBM Don't override orig twice on batch calls.
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
denoiserdealer(self, p)
|
denoiserdealer(self, False)
|
||||||
self.lora_applied = True
|
self.lora_applied = True
|
||||||
#escape reload loras in hires-fix
|
#escape reload loras in hires-fix
|
||||||
|
|
||||||
|
|
@ -668,7 +671,14 @@ def unloader(self,p):
|
||||||
|
|
||||||
unloadlorafowards(p)
|
unloadlorafowards(p)
|
||||||
|
|
||||||
def denoiserdealer(self, p):
|
def denoiserdealer(self, only_r):
|
||||||
|
if not hasattr(self,"dr_callbacks"):
|
||||||
|
self.dr_callbacks = on_cfg_denoiser(self.denoiser_callback)
|
||||||
|
|
||||||
|
if only_r:
|
||||||
|
self.only_r = True
|
||||||
|
return
|
||||||
|
|
||||||
if self.calc =="Latent": # prompt mode use only denoiser callbacks
|
if self.calc =="Latent": # prompt mode use only denoiser callbacks
|
||||||
if not hasattr(self,"dd_callbacks"):
|
if not hasattr(self,"dd_callbacks"):
|
||||||
self.dd_callbacks = on_cfg_denoised(self.denoised_callback)
|
self.dd_callbacks = on_cfg_denoised(self.denoised_callback)
|
||||||
|
|
@ -677,9 +687,6 @@ def denoiserdealer(self, p):
|
||||||
else:
|
else:
|
||||||
shared.batch_cond_uncond = False
|
shared.batch_cond_uncond = False
|
||||||
|
|
||||||
if not hasattr(self,"dr_callbacks"):
|
|
||||||
self.dr_callbacks = on_cfg_denoiser(self.denoiser_callback)
|
|
||||||
|
|
||||||
if self.diff:
|
if self.diff:
|
||||||
if not hasattr(self,"dd_callbacks"):
|
if not hasattr(self,"dd_callbacks"):
|
||||||
self.dd_callbacks = on_cfg_denoised(self.denoised_callback)
|
self.dd_callbacks = on_cfg_denoised(self.denoised_callback)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue