Handle XL/1.5 switch during Hires Fix
parent
5a9ec7fbc7
commit
356a3c05fb
|
|
@ -56,6 +56,8 @@ class Script(scripts.Script):
|
||||||
|
|
||||||
weight = getattr(p, 'NPW_weight', weight)
|
weight = getattr(p, 'NPW_weight', weight)
|
||||||
if weight != 1 : self.print_warning(weight)
|
if weight != 1 : self.print_warning(weight)
|
||||||
|
self.width = p.width
|
||||||
|
self.height = p.height
|
||||||
self.weight = weight
|
self.weight = weight
|
||||||
self.empty_uncond = None
|
self.empty_uncond = None
|
||||||
|
|
||||||
|
|
@ -66,7 +68,7 @@ class Script(scripts.Script):
|
||||||
# print('NPW callback removed')
|
# print('NPW callback removed')
|
||||||
|
|
||||||
if self.weight != 1.0:
|
if self.weight != 1.0:
|
||||||
self.empty_uncond = self.make_empty_uncond(p.width, p.height)
|
self.empty_uncond = self.make_empty_uncond(self.width, self.height)
|
||||||
on_cfg_denoiser(self.denoiser_callback)
|
on_cfg_denoiser(self.denoiser_callback)
|
||||||
# print('NPW callback added')
|
# print('NPW callback added')
|
||||||
self.callbacks_added = True
|
self.callbacks_added = True
|
||||||
|
|
@ -99,8 +101,10 @@ class Script(scripts.Script):
|
||||||
return new_tensor
|
return new_tensor
|
||||||
|
|
||||||
uncond = params.text_uncond
|
uncond = params.text_uncond
|
||||||
empty_uncond = self.empty_uncond
|
|
||||||
is_dict = isinstance(uncond, dict)
|
is_dict = isinstance(uncond, dict)
|
||||||
|
if type(self.empty_uncond) != type(uncond):
|
||||||
|
self.empty_uncond = self.make_empty_uncond(self.width, self.height)
|
||||||
|
empty_uncond = self.empty_uncond
|
||||||
|
|
||||||
if is_dict:
|
if is_dict:
|
||||||
uncond, cross = uncond['vector'], uncond['crossattn']
|
uncond, cross = uncond['vector'], uncond['crossattn']
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue