mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
support lora inside prompt selector
Signed-off-by: vladmandic <mandic00@live.com>
This commit is contained in:
+3
-1
@@ -2,9 +2,10 @@
|
||||
|
||||
## Todo
|
||||
|
||||
- upstream `torch/rocm` slowdown
|
||||
- update `rocm/windows`
|
||||
|
||||
## Update for 2026-01-24
|
||||
## Update for 2026-01-25
|
||||
|
||||
- **Features**
|
||||
- **caption** tab support for Booru tagger models, thanks @CalamitousFelicitousness
|
||||
@@ -32,6 +33,7 @@
|
||||
- add video ui elem_ids, thanks @ryanmeador
|
||||
- use base steps as-is for non sd/sdxl models
|
||||
- ui css fixes for modernui
|
||||
- support lora inside prompt selector
|
||||
|
||||
## Update for 2026-01-22
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ def network_load(names, te_multipliers=None, unet_multipliers=None, dyn_dims=Non
|
||||
continue
|
||||
if net is None:
|
||||
failed_to_load_networks.append(name)
|
||||
shared.log.error(f'Network load: type=LoRA name="{name}" detected={network_on_disk.sd_version if network_on_disk is not None else None} failed')
|
||||
shared.log.error(f'Network load: type=LoRA name="{name}" detected={network_on_disk.sd_version if network_on_disk is not None else None} not found')
|
||||
continue
|
||||
if hasattr(sd_model, 'embedding_db'):
|
||||
sd_model.embedding_db.load_diffusers_embedding(None, net.bundle_embeddings)
|
||||
|
||||
+8
-7
@@ -54,7 +54,11 @@ def select_from_weighted_list(inner: str) -> str:
|
||||
unweighted = []
|
||||
|
||||
for p in parts:
|
||||
if ':' in p and not p.startswith('(') and not p.endswith(')'):
|
||||
is_list = (p.startswith('(') and p.endswith(')')) or \
|
||||
(p.startswith('[') and p.endswith(']')) or \
|
||||
(p.startswith('{') and p.endswith('}')) or \
|
||||
(p.startswith('<') and p.endswith('>'))
|
||||
if (':' in p) and not is_list:
|
||||
name, wstr = p.split(':', 1)
|
||||
name = name.strip()
|
||||
try:
|
||||
@@ -69,8 +73,7 @@ def select_from_weighted_list(inner: str) -> str:
|
||||
W = sum(weighted.values())
|
||||
U = len(unweighted)
|
||||
|
||||
if U == 0:
|
||||
# Only weighted options
|
||||
if U == 0: # only weighted options
|
||||
keys = list(weighted.keys())
|
||||
if not keys:
|
||||
return ''
|
||||
@@ -79,10 +82,8 @@ def select_from_weighted_list(inner: str) -> str:
|
||||
if abs(W - 1.0) > 1e-12:
|
||||
for k in weighted:
|
||||
weighted[k] = weighted[k] / W
|
||||
else:
|
||||
# Mix of weighted and unweighted
|
||||
if W >= 1.0:
|
||||
# Weighted probabilities consume whole mass -> normalize them, unweighted get 0
|
||||
else: # mix of weighted and unweighted
|
||||
if W >= 1.0: # weighted probabilities consume whole mass -> normalize them, unweighted get 0
|
||||
for k in weighted:
|
||||
weighted[k] = weighted[k] / W
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user