stable-diffusion-webui
stable-diffusion-webui copied to clipboard
initialize extra_network_data before use
Fixes this error:
UnboundLocalError: local variable 'extra_network_data' referenced before assignment
extra_network_data
is defined inside a loop but accessed outside it. if n_iter
is 0 then the loop is never entered and extra_network_data
is never initialized.
also a thing to consider is extra_networks.activate()
is called in each loop but extra_networks.deactivate()
is only called once outside. perhaps this could have undesired side effects? for example if the last extra_network_data
in the loop is different from previous ones, only this extra_network_data
will be deactivated.