Rename replace node to avoid conflict with ComfyUI base component

This commit is contained in:
WanderingMouse
2025-06-09 00:53:28 -05:00
parent 90c3d6a46b
commit 7e1ea79cef
3 changed files with 9 additions and 9 deletions
+4 -4
View File
@@ -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"]
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]
+3 -3
View File
@@ -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({
};
}
}
});
});
@@ -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,)
return (result,)