diff --git a/README.md b/README.md index 89d29ca..a52d549 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,11 @@ Current `Visionatrix/UI` nodes list: - **VixUi-WorkflowMetadata** - mandatory node to fill the workflow metadata required for each Visionatrix flow for displaying in the UI list of workflows; - **VixUiAspectRatioSelector** - use it to display the desired image aspect ratio for your Flow. +Current `Visionatrix/Text` nodes list: + +- **VixMultilineText** - node to just hold text(code compatible). +- **VixTextConcatenate** - node to concatenate up to 4 different strings with optional delimiter. + ### Incorporated nodes - **StyleAlignedBatchAlign** - from the `style_aligned_comfy` repository diff --git a/__init__.py b/__init__.py index 9de168a..b777fc9 100644 --- a/__init__.py +++ b/__init__.py @@ -417,6 +417,57 @@ class VixCheckboxLogic: return ["input_on_state"] +class VixMultilineText: + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "text": ("STRING", {"default": "", "multiline": True, "dynamicPrompts": False}), + }, + "optional": {}, + } + RETURN_TYPES = ("STRING",) + FUNCTION = "do_it" + CATEGORY = "Visionatrix/Text" + + @classmethod + def do_it(cls, text, **kwargs) -> tuple: + return (text,) + + +class VixTextConcatenate: + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "delimiter": ("STRING", {"default": ", "}), + "clean_whitespace": (["true", "false"],), + }, + "optional": { + "text_a": ("STRING", {"forceInput": True}), + "text_b": ("STRING", {"forceInput": True}), + "text_c": ("STRING", {"forceInput": True}), + "text_d": ("STRING", {"forceInput": True}), + } + } + + RETURN_TYPES = ("STRING",) + FUNCTION = "do_it" + CATEGORY = "Visionatrix/Text" + + @classmethod + def do_it(cls, delimiter: str, clean_whitespace: str, **kwargs): + delim = "\n" if delimiter == "\\n" else delimiter + strip = clean_whitespace.lower() == "true" + parts = ( + (val.strip() if strip else val) + for _, val in sorted(kwargs.items()) + if isinstance(val, str) + ) + return (delim.join(filter(None, parts)),) + + + NODE_CLASS_MAPPINGS = { "VixUiAspectRatioSelector": VixUiAspectRatioSelector, "VixUiCheckbox": VixUiCheckbox, @@ -431,6 +482,8 @@ NODE_CLASS_MAPPINGS = { "VixDynamicLoraDefinition": VixDynamicLoraDefinition, "VixCheckboxLogic": VixCheckboxLogic, "StyleAlignedBatchAlign": StyleAlignedBatchAlign, + "VixMultilineText": VixMultilineText, + "VixTextConcatenate": VixTextConcatenate, } NODE_DISPLAY_NAME_MAPPINGS = { @@ -447,4 +500,6 @@ NODE_DISPLAY_NAME_MAPPINGS = { "VixDynamicLoraDefinition": "Vix-DynamicLoraDefinition", "VixCheckboxLogic": "Vix-CheckboxLogic", "StyleAlignedBatchAlign": "StyleAligned Batch Align", + "VixMultilineText": "Text Multiline", + "VixTextConcatenate": "Text Concatenate", } diff --git a/pyproject.toml b/pyproject.toml index 3265483..7ff05f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-visionatrix" description = "The ComfyUI-Visionatrix nodes are designed for convenient ComfyUI to [a/Visionatrix](https://github.com/Visionatrix/Visionatrix) workflow support migration, in particular to extract prompt input params (input, textarea, checkbox, select, range, file) to be used in simplified Visionatrix UI." -version = "1.0.8" +version = "1.1.0" license = {file = "LICENSE"} urls.Repository = "https://github.com/Visionatrix/ComfyUI-Visionatrix"