Nodes Browser
ComfyDeploy: How ComfyUI-Regex-Runner works in ComfyUI?
What is ComfyUI-Regex-Runner?
This is a node to run regex for strings.
How to install it in ComfyDeploy?
Head over to the machine page
- Click on the "Create a new machine" button
- Select the
Edit
build steps - Add a new step -> Custom Node
- Search for
ComfyUI-Regex-Runner
and select it - Close the build step dialig and then click on the "Save" button to rebuild the machine
ComfyUI-Regex-Runner
A ComfyUI custom node plugin that allows you to run regular expression operations directly in ComfyUI workflows.
This custom node is powered by ltdrdata and developed by Cursor
Features
- Execute regex matching and replacement in ComfyUI
- Support all standard Python regular expression syntax
- Easy text input and output handling
- Fully integrated into ComfyUI workflows
Installation
- Navigate to your ComfyUI custom nodes directory:
cd ComfyUI/custom_nodes/
- Clone this repository:
git clone https://github.com/ltdrdata/ComfyUI-Regex-Runner
Usage
Available Nodes
The plugin provides the following nodes:
- Regex Match: Performs regular expression matching operations
- Regex Replace: Performs regular expression replacement operations
Node Parameters
Regex Match Node
text
: Input text to matchpattern
: Regular expression patternflags
: Regex flags (optional)- Output: List of matched texts
Regex Replace Node
text
: Input text to processpattern
: Regular expression patternreplacement
: Replacement textflags
: Regex flags (optional)- Output: Replaced text
Examples
- Extract Numbers
Input text: "Image size is 512x512"
Pattern: "\d+"
Output: ["512", "512"]
- Replace Text
Input text: "prompt: a cat"
Pattern: "^prompt: "
Replacement: "negative prompt: "
Output: "negative prompt: a cat"
Common Issues
-
Regex Not Matching?
- Check if the regex syntax is correct
- Verify if you need to use raw strings (r"pattern")
- Ensure special characters are properly escaped
-
How to Use Regex Flags?
- Supports standard Python regex flags
- Examples:
re.IGNORECASE
,re.MULTILINE
, etc.
License
MIT License
Support
If you encounter any issues or have suggestions for improvements:
- Submit an issue on GitHub
- Provide detailed problem description and steps to reproduce
- Include relevant error messages and logs