mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
feat: add Text node with autocomplete support
Introduce a new TextLM node to the Lora Manager extension, providing a simple text input with autocomplete functionality for tags and styles. The node is integrated into the module's import system and node class mappings, enabling users to utilize autocomplete features for efficient prompt creation.
This commit is contained in:
@@ -3,6 +3,7 @@ try: # pragma: no cover - import fallback for pytest collection
|
|||||||
from .py.nodes.lora_loader import LoraLoaderLM, LoraTextLoaderLM
|
from .py.nodes.lora_loader import LoraLoaderLM, LoraTextLoaderLM
|
||||||
from .py.nodes.trigger_word_toggle import TriggerWordToggleLM
|
from .py.nodes.trigger_word_toggle import TriggerWordToggleLM
|
||||||
from .py.nodes.prompt import PromptLM
|
from .py.nodes.prompt import PromptLM
|
||||||
|
from .py.nodes.text import TextLM
|
||||||
from .py.nodes.lora_stacker import LoraStackerLM
|
from .py.nodes.lora_stacker import LoraStackerLM
|
||||||
from .py.nodes.save_image import SaveImageLM
|
from .py.nodes.save_image import SaveImageLM
|
||||||
from .py.nodes.debug_metadata import DebugMetadataLM
|
from .py.nodes.debug_metadata import DebugMetadataLM
|
||||||
@@ -24,6 +25,7 @@ except (
|
|||||||
sys.path.append(str(package_root))
|
sys.path.append(str(package_root))
|
||||||
|
|
||||||
PromptLM = importlib.import_module("py.nodes.prompt").PromptLM
|
PromptLM = importlib.import_module("py.nodes.prompt").PromptLM
|
||||||
|
TextLM = importlib.import_module("py.nodes.text").TextLM
|
||||||
LoraManager = importlib.import_module("py.lora_manager").LoraManager
|
LoraManager = importlib.import_module("py.lora_manager").LoraManager
|
||||||
LoraLoaderLM = importlib.import_module(
|
LoraLoaderLM = importlib.import_module(
|
||||||
"py.nodes.lora_loader"
|
"py.nodes.lora_loader"
|
||||||
@@ -54,6 +56,7 @@ except (
|
|||||||
|
|
||||||
NODE_CLASS_MAPPINGS = {
|
NODE_CLASS_MAPPINGS = {
|
||||||
PromptLM.NAME: PromptLM,
|
PromptLM.NAME: PromptLM,
|
||||||
|
TextLM.NAME: TextLM,
|
||||||
LoraLoaderLM.NAME: LoraLoaderLM,
|
LoraLoaderLM.NAME: LoraLoaderLM,
|
||||||
LoraTextLoaderLM.NAME: LoraTextLoaderLM,
|
LoraTextLoaderLM.NAME: LoraTextLoaderLM,
|
||||||
TriggerWordToggleLM.NAME: TriggerWordToggleLM,
|
TriggerWordToggleLM.NAME: TriggerWordToggleLM,
|
||||||
|
|||||||
32
py/nodes/text.py
Normal file
32
py/nodes/text.py
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
class TextLM:
|
||||||
|
"""A simple text node with autocomplete support."""
|
||||||
|
|
||||||
|
NAME = "Text (LoraManager)"
|
||||||
|
CATEGORY = "Lora Manager/utils"
|
||||||
|
DESCRIPTION = (
|
||||||
|
"A simple text input node with autocomplete support for tags and styles."
|
||||||
|
)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(cls):
|
||||||
|
return {
|
||||||
|
"required": {
|
||||||
|
"text": (
|
||||||
|
"AUTOCOMPLETE_TEXT_PROMPT",
|
||||||
|
{
|
||||||
|
"placeholder": "Enter text... /char, /artist for quick tag search",
|
||||||
|
"tooltip": "The text output.",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
RETURN_TYPES = ("STRING",)
|
||||||
|
RETURN_NAMES = ("STRING",)
|
||||||
|
OUTPUT_TOOLTIPS = (
|
||||||
|
"The text output.",
|
||||||
|
)
|
||||||
|
FUNCTION = "process"
|
||||||
|
|
||||||
|
def process(self, text: str):
|
||||||
|
return (text,)
|
||||||
@@ -115,11 +115,3 @@ class WanVideoLoraTextSelectLM:
|
|||||||
active_loras_text = " ".join(formatted_loras)
|
active_loras_text = " ".join(formatted_loras)
|
||||||
|
|
||||||
return (loras_list, trigger_words_text, active_loras_text)
|
return (loras_list, trigger_words_text, active_loras_text)
|
||||||
|
|
||||||
NODE_CLASS_MAPPINGS = {
|
|
||||||
"WanVideoLoraTextSelectLM": WanVideoLoraTextSelectLM
|
|
||||||
}
|
|
||||||
|
|
||||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
|
||||||
"WanVideoLoraTextSelectLM": "WanVideo Lora Select From Text (LoraManager)"
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user