mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 16:54:33 +02:00
fix activate/deactivate
This commit is contained in:
@@ -12,12 +12,13 @@ class ExtraNetworkLora(extra_networks.ExtraNetwork):
|
||||
|
||||
def activate(self, p, params_list):
|
||||
t0 = time.time()
|
||||
networks.originals = lora_patches.LoraPatches()
|
||||
additional = shared.opts.sd_lora
|
||||
self.errors.clear()
|
||||
if additional != "None" and additional in networks.available_networks and not any(x for x in params_list if x.items[0] == additional):
|
||||
p.all_prompts = [x + f"<lora:{additional}:{shared.opts.extra_networks_default_multiplier}>" for x in p.all_prompts]
|
||||
params_list.append(extra_networks.ExtraNetworkParams(items=[additional, shared.opts.extra_networks_default_multiplier]))
|
||||
if len(params_list) > 0:
|
||||
networks.originals = lora_patches.LoraPatches()
|
||||
names = []
|
||||
te_multipliers = []
|
||||
unet_multipliers = []
|
||||
|
||||
@@ -30,3 +30,4 @@ class LoraPatches:
|
||||
self.LayerNorm_load_state_dict = patches.undo(__name__, torch.nn.LayerNorm, '_load_from_state_dict') # pylint: disable=E1128
|
||||
self.MultiheadAttention_forward = patches.undo(__name__, torch.nn.MultiheadAttention, 'forward') # pylint: disable=E1128
|
||||
self.MultiheadAttention_load_state_dict = patches.undo(__name__, torch.nn.MultiheadAttention, '_load_from_state_dict') # pylint: disable=E1128
|
||||
patches.originals.pop(__name__, None)
|
||||
|
||||
+1
-2
@@ -872,6 +872,7 @@ def check_timestamp():
|
||||
return True
|
||||
ok = True
|
||||
setup_time = -1
|
||||
version_time = -1
|
||||
with open(log_file, 'r', encoding='utf8') as f:
|
||||
lines = f.readlines()
|
||||
for line in lines:
|
||||
@@ -881,8 +882,6 @@ def check_timestamp():
|
||||
version_time = int(git('log -1 --pretty=format:"%at"'))
|
||||
except Exception as e:
|
||||
log.error(f'Error getting local repository version: {e}')
|
||||
if not args.ignore:
|
||||
sys.exit(1)
|
||||
log.debug(f'Repository update time: {time.ctime(int(version_time))}')
|
||||
if setup_time == -1:
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user