feat: plumb lora strength and active flags through workflow analysis for accurate model resolution
This commit is contained in:
@@ -629,6 +629,9 @@ class ModelResolverExtension:
|
||||
strength = 1.0
|
||||
break
|
||||
|
||||
if ref.get("strength") is not None:
|
||||
strength = ref.get("strength")
|
||||
|
||||
# For text-based lora loaders (LoraLoaderV2, LoraManager), get strength from ref
|
||||
if ref.get("is_lora_v2"):
|
||||
strength = ref.get("strength")
|
||||
|
||||
+26
-15
@@ -393,21 +393,32 @@ def get_node_model_info(
|
||||
full_path = None
|
||||
exists = False
|
||||
|
||||
model_refs.append(
|
||||
{
|
||||
"node_id": node_id,
|
||||
"node_type": node_type,
|
||||
"widget_index": idx,
|
||||
"original_path": value_str,
|
||||
"node_title": node_title,
|
||||
"category": category,
|
||||
"full_path": full_path,
|
||||
"exists": exists,
|
||||
"is_urn": False,
|
||||
"connected": is_active,
|
||||
"nested_key": nested_key, # Track nested key for updates
|
||||
}
|
||||
)
|
||||
ref = {
|
||||
"node_id": node_id,
|
||||
"node_type": node_type,
|
||||
"widget_index": idx,
|
||||
"original_path": value_str,
|
||||
"node_title": node_title,
|
||||
"category": category,
|
||||
"full_path": full_path,
|
||||
"exists": exists,
|
||||
"is_urn": False,
|
||||
"connected": is_active,
|
||||
"nested_key": nested_key, # Track nested key for updates
|
||||
}
|
||||
|
||||
if nested_key == "lora":
|
||||
strength = value.get("strength")
|
||||
if strength is not None:
|
||||
try:
|
||||
ref["strength"] = float(strength)
|
||||
except (TypeError, ValueError):
|
||||
pass
|
||||
|
||||
if isinstance(value.get("on"), bool):
|
||||
ref["active"] = value.get("on")
|
||||
|
||||
model_refs.append(ref)
|
||||
continue
|
||||
|
||||
value_str = str(value).strip()
|
||||
|
||||
@@ -129,17 +129,9 @@ export const tabsLoadedMethods = {
|
||||
byCategory[cat] = { active: [], inactive: [] };
|
||||
}
|
||||
|
||||
// Determine if model is active or inactive
|
||||
// For LoraLoaderV2/LoraManager: check model.active field
|
||||
// For other nodes: check model.connected field (false means not connected or bypassed)
|
||||
let isActive = true;
|
||||
if (model.is_lora_v2) {
|
||||
// For text-based lora loaders, check both active flag AND connected status
|
||||
isActive = model.active !== false && model.connected !== false;
|
||||
} else {
|
||||
// For regular nodes, check connected status
|
||||
isActive = model.connected !== false;
|
||||
}
|
||||
// Some loaders expose per-model enablement, e.g. LoraManager's
|
||||
// active flag and rgthree Power Lora Loader's on flag.
|
||||
const isActive = model.active !== false && model.connected !== false;
|
||||
|
||||
if (isActive) {
|
||||
byCategory[cat].active.push(model);
|
||||
|
||||
Reference in New Issue
Block a user