From 7e1ea79cefe40512b8b778f7cdb2aec7a490ef95 Mon Sep 17 00:00:00 2001 From: WanderingMouse <215439289+WanderingMouse@users.noreply.github.com> Date: Mon, 9 Jun 2025 00:53:13 -0500 Subject: [PATCH] Rename replace node to avoid conflict with ComfyUI base component --- __init__.py | 8 ++++---- js/string_essentials.js | 6 +++--- string_replace_node.py => string_multi_replace_node.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) rename string_replace_node.py => string_multi_replace_node.py (98%) diff --git a/__init__.py b/__init__.py index 660886f..9386357 100644 --- a/__init__.py +++ b/__init__.py @@ -2,23 +2,23 @@ from .string_textbox_node import StringTextboxNode from .string_strip_node import StringStripNode -from .string_replace_node import StringReplaceNode +from .string_multi_replace_node import StringMultiReplaceNode from .string_preview_node import StringPreviewNode NODE_CLASS_MAPPINGS = { "StringTextbox": StringTextboxNode, "StringStrip": StringStripNode, - "StringReplace": StringReplaceNode, + "StringMultiReplace": StringMultiReplaceNode, "StringPreview": StringPreviewNode } NODE_DISPLAY_NAME_MAPPINGS = { "StringTextbox": "String Textbox", "StringStrip": "String Strip", - "StringReplace": "String Replace", + "StringMultiReplace": "String Multi Replace", "StringPreview": "String Preview" } WEB_DIRECTORY = "./js" -__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"] \ No newline at end of file +__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"] diff --git a/js/string_essentials.js b/js/string_essentials.js index 28ac346..ae9e204 100644 --- a/js/string_essentials.js +++ b/js/string_essentials.js @@ -13,9 +13,9 @@ app.registerExtension({ }); app.registerExtension({ - name: "string.replace", + name: "string.multireplace", async beforeRegisterNodeDef(nodeType) { - if (nodeType.comfyClass === "StringReplace") { + if (nodeType.comfyClass === "StringMultiReplace") { nodeType.prototype.onNodeCreated = function() { this.addInput("input_string", "STRING"); }; @@ -43,4 +43,4 @@ app.registerExtension({ }; } } -}); \ No newline at end of file +}); diff --git a/string_replace_node.py b/string_multi_replace_node.py similarity index 98% rename from string_replace_node.py rename to string_multi_replace_node.py index 6c19aed..787886e 100644 --- a/string_replace_node.py +++ b/string_multi_replace_node.py @@ -1,6 +1,6 @@ import re -class StringReplaceNode: +class StringMultiReplaceNode: @classmethod def INPUT_TYPES(cls): return { @@ -66,4 +66,4 @@ class StringReplaceNode: if remove_extra_spaces: result = self.cleanup_text(result) - return (result,) \ No newline at end of file + return (result,)