def forward(self, x, multiplier=None):
print(HypernetworkModule)
print(inspect.getmodule(HypernetworkModule))
print(f"multiplier = {multiplier}, HypernetworkModule.multiplier = {HypernetworkModule.multiplier}")
#traceback.print_stack()
if multiplier is None or not isinstance(multiplier, (int, float)):
return x + self.linear(x) * (HypernetworkModule.multiplier if not self.training else 1)
return x + self.linear(x) * multiplier
def apply_strength(value=None):
print(f'apply_strength(value={value}), shared.opts.sd_hypernetwork_strength: {shared.opts.sd_hypernetwork_strength}. Current: {HypernetworkModule.multiplier}')
print(inspect.getmodule(HypernetworkModule))
traceback.print_stack()
HypernetworkModule.multiplier = value if value is not None else shared.opts.sd_hypernetwork_strength
print(f'After: {HypernetworkModule.multiplier}')
apply_strength(value=None), shared.opts.sd_hypernetwork_strength: 0.556. Current: 0.75
<module 'extensions.Hypernetwork-MonkeyPatch-Extension.patches.hypernetwork' from '/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/Hypernetwork-MonkeyPatch-Extension/patches/hypernetwork.py'>
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/webui.py", line 213, in <module>
webui()
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/webui.py", line 150, in webui
initialize()
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/webui.py", line 85, in initialize
shared.opts.onchange("sd_hypernetwork_strength", modules.hypernetworks.hypernetwork.apply_strength)
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/shared.py", line 554, in onchange
func()
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/Hypernetwork-MonkeyPatch-Extension/patches/hypernetwork.py", line 645, in apply_strength
traceback.print_stack()
After: 0.556
Running on local URL: https://***.loca.lt:443
Connected
apply_strength(value=None), shared.opts.sd_hypernetwork_strength: 0.556. Current: 0.556
<module 'extensions.Hypernetwork-MonkeyPatch-Extension.patches.hypernetwork' from '/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/Hypernetwork-MonkeyPatch-Extension/patches/hypernetwork.py'>
File "/usr/lib/python3.8/threading.py", line 890, in _bootstrap
self._bootstrap_inner()
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/generation_parameters_copypaste.py", line 305, in paste_func
v = key(params)
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/generation_parameters_copypaste.py", line 88, in <lambda>
(component_dict[k], lambda d, k=k, v=v: ui.apply_setting(k, d.get(v, None)))
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/ui.py", line 419, in apply_setting
opts.data_labels[key].onchange()
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/Hypernetwork-MonkeyPatch-Extension/patches/hypernetwork.py", line 645, in apply_strength
traceback.print_stack()
After: 0.556
0% 0/20 [00:00<?, ?it/s]
>>> forward called here <<<
<class 'patches.hypernetwork.HypernetworkModule'>
<module 'patches.hypernetwork' from '/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/Hypernetwork-MonkeyPatch-Extension/patches/hypernetwork.py'>
multiplier = None, HypernetworkModule.multiplier = 0.75, self.training: False, cond: True mult: 0.75
<class 'patches.hypernetwork.HypernetworkModule'>
Always used default value multiplier = 1.0
i'm tried add logs in to methods
https://github.com/aria1th/Hypernetwork-MonkeyPatch-Extension/blob/4c87144b5dc67f00784cb35aa52fe30d96e49da0/patches/hypernetwork.py#L125
https://github.com/aria1th/Hypernetwork-MonkeyPatch-Extension/blob/4c87144b5dc67f00784cb35aa52fe30d96e49da0/patches/hypernetwork.py#L637
And output when i'm set strength and then start generating image
I'm change default value to 0.75 in .py file
Actual value HypernetworkModule.multiplier = 0.556, but inside forward method it's return default value = 0.75