From 540893fc4ce47eb5a05a7e5d1d1e4e2a62024859 Mon Sep 17 00:00:00 2001 From: LUCAS M MORGAN Date: Wed, 22 Apr 2026 20:26:28 -0500 Subject: [PATCH] Initial Enviral Design utility node pack --- .github/FUNDING.yml | 5 ++ .github/workflows/publish_action.yml | 21 +++++++ README.md | 43 ++++++++++++++ __init__.py | 3 + pyproject.toml | 24 ++++++++ text_nodes.py | 85 ++++++++++++++++++++++++++++ 6 files changed, 181 insertions(+) create mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/publish_action.yml create mode 100644 README.md create mode 100644 __init__.py create mode 100644 pyproject.toml create mode 100644 text_nodes.py diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..b530c9d --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,5 @@ +# These are supported funding model platforms + +github: EnviralDesign +patreon: EnviralDesign +custom: https://www.paypal.com/donate?hosted_button_id=RP8EJAHSDTZ86 diff --git a/.github/workflows/publish_action.yml b/.github/workflows/publish_action.yml new file mode 100644 index 0000000..4d4421c --- /dev/null +++ b/.github/workflows/publish_action.yml @@ -0,0 +1,21 @@ +name: Publish to Comfy registry + +on: + workflow_dispatch: + push: + branches: + - main + paths: + - "pyproject.toml" + +jobs: + publish-node: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Publish Custom Node + uses: Comfy-Org/publish-node-action@main + with: + personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }} diff --git a/README.md b/README.md new file mode 100644 index 0000000..9698f72 --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# comfyUI-enviral-design-node-pack + +Small, dependency-light ComfyUI utility nodes from Enviral Design. + +The goal of this pack is to keep genuinely useful glue nodes in one place +without pulling in a large third-party custom-node bundle just to get one tiny +piece of functionality. + +## Included + +### `Text Split (Delimiter)` + +Splits an input string using a delimiter and returns: + +- `part_1` through `part_8` +- `remainder` +- `count` + +Behavior: + +- `output_count` controls how many leading parts are emitted before overflow is + collected into `remainder` +- `strip_parts` trims whitespace around each part +- `skip_empty` removes empty parts after splitting + +This node intentionally uses a fixed socket layout instead of dynamic outputs so +saved workflows stay predictable and easy to debug. + +## Install + +Clone this repo into `ComfyUI/custom_nodes` and restart ComfyUI. + +```text +ComfyUI/custom_nodes/comfyUI-enviral-design-node-pack +``` + +## Donations & Support + +If this saves you time, you can support the work here: + +- [Patreon](https://www.patreon.com/EnviralDesign) +- [GitHub Sponsors](https://github.com/sponsors/EnviralDesign) +- [PayPal](https://www.paypal.com/donate?hosted_button_id=RP8EJAHSDTZ86) diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..a4331af --- /dev/null +++ b/__init__.py @@ -0,0 +1,3 @@ +from .text_nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS + +__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..0335ac0 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,24 @@ +[build-system] +requires = ["setuptools>=68", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "enviral-design-node-pack" +version = "0.1.0" +description = "Small, dependency-light ComfyUI utility nodes from Enviral Design." +readme = "README.md" +requires-python = ">=3.10" +dependencies = [] +classifiers = [ + "Programming Language :: Python :: 3", + "Operating System :: OS Independent", +] + +[project.urls] +Repository = "https://github.com/EnviralDesign/comfyUI-enviral-design-node-pack" +Documentation = "https://github.com/EnviralDesign/comfyUI-enviral-design-node-pack#readme" +Issues = "https://github.com/EnviralDesign/comfyUI-enviral-design-node-pack/issues" + +[tool.comfy] +PublisherId = "enviral-design" +DisplayName = "Enviral Design Node Pack" diff --git a/text_nodes.py b/text_nodes.py new file mode 100644 index 0000000..d380e54 --- /dev/null +++ b/text_nodes.py @@ -0,0 +1,85 @@ +class TextSplitByDelimiter: + MAX_OUTPUTS = 8 + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "text": ("STRING", { + "multiline": True, + "default": "", + "tooltip": "Input text to split." + }), + "delimiter": ("STRING", { + "default": ",", + "tooltip": "Delimiter used to split the input text." + }), + "output_count": ("INT", { + "default": 4, + "min": 1, + "max": cls.MAX_OUTPUTS, + "step": 1, + "tooltip": "How many leading parts to expose before the remainder bucket." + }), + "strip_parts": ("BOOLEAN", { + "default": True, + "tooltip": "Trim whitespace around each split part." + }), + "skip_empty": ("BOOLEAN", { + "default": True, + "tooltip": "Drop empty parts after splitting." + }), + } + } + + RETURN_TYPES = ("STRING",) * MAX_OUTPUTS + ("STRING", "INT") + RETURN_NAMES = ( + "part_1", + "part_2", + "part_3", + "part_4", + "part_5", + "part_6", + "part_7", + "part_8", + "remainder", + "count", + ) + FUNCTION = "split_text" + CATEGORY = "EnviralDesign/text" + + def split_text(self, text, delimiter, output_count, strip_parts, skip_empty): + if delimiter == "": + parts = [text] + join_delimiter = "" + else: + parts = text.split(delimiter) + join_delimiter = delimiter + + if strip_parts: + parts = [part.strip() for part in parts] + + if skip_empty: + parts = [part for part in parts if part != ""] + + count = len(parts) + output_count = max(1, min(int(output_count), self.MAX_OUTPUTS)) + + visible_parts = list(parts[:output_count]) + remainder_parts = parts[output_count:] + + while len(visible_parts) < self.MAX_OUTPUTS: + visible_parts.append("") + + remainder = join_delimiter.join(remainder_parts) if remainder_parts else "" + + return (*visible_parts, remainder, count) + + +NODE_CLASS_MAPPINGS = { + "EnviralTextSplitByDelimiter": TextSplitByDelimiter, +} + +NODE_DISPLAY_NAME_MAPPINGS = { + "EnviralTextSplitByDelimiter": "Text Split (Delimiter)", +}