diff --git a/__init__.py b/__init__.py index 9d2fe9a3..98034007 100644 --- a/__init__.py +++ b/__init__.py @@ -3,6 +3,7 @@ try: # pragma: no cover - import fallback for pytest collection from .py.nodes.lora_loader import LoraLoaderLM, LoraTextLoaderLM from .py.nodes.trigger_word_toggle import TriggerWordToggleLM from .py.nodes.prompt import PromptLM + from .py.nodes.text import TextLM from .py.nodes.lora_stacker import LoraStackerLM from .py.nodes.save_image import SaveImageLM from .py.nodes.debug_metadata import DebugMetadataLM @@ -24,6 +25,7 @@ except ( sys.path.append(str(package_root)) PromptLM = importlib.import_module("py.nodes.prompt").PromptLM + TextLM = importlib.import_module("py.nodes.text").TextLM LoraManager = importlib.import_module("py.lora_manager").LoraManager LoraLoaderLM = importlib.import_module( "py.nodes.lora_loader" @@ -54,6 +56,7 @@ except ( NODE_CLASS_MAPPINGS = { PromptLM.NAME: PromptLM, + TextLM.NAME: TextLM, LoraLoaderLM.NAME: LoraLoaderLM, LoraTextLoaderLM.NAME: LoraTextLoaderLM, TriggerWordToggleLM.NAME: TriggerWordToggleLM, diff --git a/py/nodes/text.py b/py/nodes/text.py new file mode 100644 index 00000000..8e3dcd60 --- /dev/null +++ b/py/nodes/text.py @@ -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,) \ No newline at end of file diff --git a/py/nodes/wanvideo_lora_select_from_text.py b/py/nodes/wanvideo_lora_select_from_text.py index 1fe0f29b..71b9b794 100644 --- a/py/nodes/wanvideo_lora_select_from_text.py +++ b/py/nodes/wanvideo_lora_select_from_text.py @@ -115,11 +115,3 @@ class WanVideoLoraTextSelectLM: active_loras_text = " ".join(formatted_loras) 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)" -}