mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-05-07 00:46:44 -03:00
fix(trigger-words): propagate LORA_STACK updates through combiners (#881)
This commit is contained in:
@@ -18,7 +18,22 @@ export const LORA_PROVIDER_NODE_TYPES = [
|
||||
"Lora Cycler (LoraManager)",
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Nodes that do not own LoRA state themselves, but merge or forward LORA_STACK
|
||||
* inputs so downstream trigger-word updates must traverse through them.
|
||||
*/
|
||||
export const LORA_STACK_AGGREGATOR_NODE_TYPES = [
|
||||
"Lora Stack Combiner (LoraManager)",
|
||||
] as const;
|
||||
|
||||
export const LORA_CHAIN_NODE_TYPES = [
|
||||
...LORA_PROVIDER_NODE_TYPES,
|
||||
...LORA_STACK_AGGREGATOR_NODE_TYPES,
|
||||
] as const;
|
||||
|
||||
export type LoraProviderNodeType = typeof LORA_PROVIDER_NODE_TYPES[number];
|
||||
export type LoraStackAggregatorNodeType = typeof LORA_STACK_AGGREGATOR_NODE_TYPES[number];
|
||||
export type LoraChainNodeType = typeof LORA_CHAIN_NODE_TYPES[number];
|
||||
|
||||
/**
|
||||
* Check if a node class is a LoRA provider node.
|
||||
@@ -27,6 +42,16 @@ export function isLoraProviderNode(comfyClass: string): comfyClass is LoraProvid
|
||||
return LORA_PROVIDER_NODE_TYPES.includes(comfyClass as LoraProviderNodeType);
|
||||
}
|
||||
|
||||
export function isLoraStackAggregatorNode(
|
||||
comfyClass: string
|
||||
): comfyClass is LoraStackAggregatorNodeType {
|
||||
return LORA_STACK_AGGREGATOR_NODE_TYPES.includes(comfyClass as LoraStackAggregatorNodeType);
|
||||
}
|
||||
|
||||
export function isLoraChainNode(comfyClass: string): comfyClass is LoraChainNodeType {
|
||||
return LORA_CHAIN_NODE_TYPES.includes(comfyClass as LoraChainNodeType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract active LoRA filenames from a node based on its type.
|
||||
*
|
||||
@@ -40,6 +65,10 @@ export function getActiveLorasFromNodeByType(node: any): Set<string> {
|
||||
return extractFromCyclerConfig(node);
|
||||
}
|
||||
|
||||
if (isLoraStackAggregatorNode(comfyClass)) {
|
||||
return new Set<string>();
|
||||
}
|
||||
|
||||
// Default: use lorasWidget (works for Stacker and Randomizer)
|
||||
return extractFromLorasWidget(node);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user