Skip to content

Commit 41db129

Browse files
committed
Node updates
1 parent 8a87039 commit 41db129

17 files changed

Lines changed: 103 additions & 20 deletions

README.md

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
11
# String Essentials - Custom nodes for ComfyUI
22

3-
Easy to use string manipulation nodes for ComfyUI (strip/remove multiple text strings or search and replace text strings). Particularly useful for modifying text from LLM outputs (Ollama, Claude.ai, OpenAI ChatGPT), such as prompts or image-to-text description results. Nodes will be located under standard `Add Node` > `utils` menu.
3+
Simple string manipulation nodes for ComfyUI (strip/remove text strings, search and replace text strings, preview modified string outputs). Particularly useful for modifying text from LLM outputs (Ollama, Claude.ai, OpenAI ChatGPT), such as prompts or image-to-text description results. No bloat/additional Python dependencies or external modules required. Nodes use a small amount of basic Python and Javascript code.
4+
5+
## Nodes included:
6+
7+
- String Textbox
8+
- String Strip
9+
- String Replace
10+
- String Preview
11+
12+
***Once added nodes can be found under the `Add Node` > `utils` menu.***
413

514
## Features
615
- Remove or replace text, words, numbers in input strings
716
- Handle multi-word strings (partial sentences/phrases)
817
- Case-sensitive/insensitive matching
918
- Whole string matching option
1019

11-
## String Strip Node
12-
Removes specified strings from input text. Each line should contain the string to be searched. The string can contain multiple words. To match individual words/strings place on separate lines.
20+
## String Textbox
21+
A simple multiline textbox for free form text.
22+
23+
![stringtextbox](images/stringtextbox.png)
24+
25+
## String Strip
26+
Removes specified strings from input text. Each line should contain the string to be searched. The string can contain multiple words. To strip multiple individual words/strings place on separate lines.
1327

14-
![stringstrip](stringstrip.png)
28+
![stringstrip](images/stringstrip.png)
1529

1630
### Inputs
1731
- **`input_string`**: The string or text to process
@@ -20,13 +34,10 @@ Removes specified strings from input text. Each line should contain the string t
2034
- **`match_whole_string`**: Ensure only exact matches are removed (default: enabled)
2135
- **`remove_extra_spaces`**: Clean up extra spaces after removal (default: enabled)
2236

23-
### String Strip Example Usage:
24-
![examplestrip](examplestrip.png)
25-
26-
## String Replace Node
27-
Replaces text strings with new strings. Each line should contain a search and replace pair separated by the replacement_delimiter (default is double colon `::`).
37+
## String Replace
38+
Replaces text strings with new strings (replace/swap words etc.). Each line should contain a search and replace pair separated by the replacement_delimiter (default is double colon `::`). Example to replace dog with cat `dog::cat`. Supports mulitple string replacements, just add one replacement per line.
2839

29-
![stringreplace](stringreplace.png)
40+
![stringreplace](images/stringreplace.png)
3041

3142
### Inputs
3243
- **`input_string`**: The string or text to process
@@ -36,8 +47,15 @@ Replaces text strings with new strings. Each line should contain a search and re
3647
- **`match_whole_string`**: Ensure only exact matches are replaced (default: disabled)
3748
- **`remove_extra_spaces`**: Clean up extra spaces after replacement (default: enabled)
3849

39-
### String Replace Example Usage:
40-
![examplereplace](examplereplace.png)
50+
## String Preview
51+
Simply displays a string output. Can be used to view the results/changes to the input_string by the `String Strip` or `String Replace`.
52+
53+
![stringpreview](images/stringpreview.png)
54+
55+
## Example Usage
56+
57+
![exampleusage](images/exampleusage.png)
58+
4159

4260
## Installation
4361
1. Navigate to the `custom_nodes` directory in your ComfyUI installation path.
@@ -46,4 +64,7 @@ Replaces text strings with new strings. Each line should contain a search and re
4664
git clone https://github.com/bradsec/ComfyUI_StringEssentials.git
4765
```
4866
3. Restart ComfyUI or refresh your nodes.
49-
4. Select node from the utils menu. `Add Node > utils >` `String Strip` or `String Replace`
67+
4. Select node from the `Add Node` > `utils` menu.
68+
69+
70+
### If you found these nodes useful please star the repo.

__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
"""String manipulation nodes for ComfyUI"""
22

3+
from .string_textbox_node import StringTextboxNode
34
from .string_strip_node import StringStripNode
4-
from .string_replace_node import StringReplaceNode
5+
from .string_replace_node import StringReplaceNode
6+
from .string_preview_node import StringPreviewNode
57

68
NODE_CLASS_MAPPINGS = {
9+
"StringTextbox": StringTextboxNode,
710
"StringStrip": StringStripNode,
8-
"StringReplace": StringReplaceNode
11+
"StringReplace": StringReplaceNode,
12+
"StringPreview": StringPreviewNode
913
}
1014

1115
NODE_DISPLAY_NAME_MAPPINGS = {
16+
"StringTextbox": "String Textbox",
1217
"StringStrip": "String Strip",
13-
"StringReplace": "String Replace"
18+
"StringReplace": "String Replace",
19+
"StringPreview": "String Preview"
1420
}
1521

1622
WEB_DIRECTORY = "./js"

examplereplace.png

-96.4 KB
Binary file not shown.

examplestrip.png

-83.1 KB
Binary file not shown.

images/exampleusage.png

140 KB
Loading

images/stringpreview.png

8.12 KB
Loading

images/stringreplace.png

24.4 KB
Loading

images/stringstrip.png

20.6 KB
Loading

images/stringtextbox.png

7.61 KB
Loading

images/utilsmenu.png

29.2 KB
Loading

0 commit comments

Comments
 (0)