Strip
The 15-line node that cleans your filenames before they hit the disk
- cleaned text
Some nodes are instruments; this one is a scraper. Strip takes a string and trims digits and whitespace from both ends. That's the whole node. It exists because model names, filenames, and extracted labels accumulate junk at their edges - leading zeros, trailing spaces, a stray hyphen - and that junk makes your output filenames ugly, your comparisons wrong, and your labels inconsistent. One tiny node, one tiny job, done well.
What it does
Input text, output cleaned text. The node strips leading and trailing digits, spaces, and hyphens - so " 12345 model_01 " becomes "model". It's a strip() call with a character set (0-9, space, -) rather than the default whitespace-only version, which is the detail that makes it useful for the AUN world: numeric prefixes and suffixes that commonly leak into names get scrubbed along with the whitespace.
Inputs and outputs
text(required) - the string to clean. It'sforceInput-enabled, meaning it expects to be wired from another node rather than typed, though you can still type into it.- Output:
cleaned text(STRING) - the trimmed result.
How it works
Trivially, under the hood: text.strip("-0123456789 "). Both ends, characters from that set, in one pass. There's no regex, no options, no mode - which means there's also nothing to misconfigure. If you need more surgical control over what gets trimmed, this isn't the node; it's a blunt instrument by design.
Where it fits
The AUN pack is big on automatic naming - the path/filename builder nodes, the save nodes, the label outputs everywhere. Strip is the janitor for all of that. Wire it between a model-name extractor and a filename builder, and the %model_short% token stops carrying hidden spaces or trailing digits that turn into double spaces and ugly names. Use it on a label output before it lands in a filename template, and your files stay consistent.
It's also handy for cleaning user-entered text: strip a prompt or a tag string before comparing it, and "cinematic " stops being a different value from "cinematic". If you've ever chased a bug where two supposedly-identical strings didn't match, you know why this exists.
Honestly, it's a node you might never think to search for - but once it's in your workflow between a name source and a saver, you'll notice its absence the moment you borrow a workflow that lacks it.
Installing
It's part of the AUN ComfyUI Nodes pack:
cd ComfyUI/custom_nodes
git clone https://github.com/loz2754/AUN-ComfyUI-Nodes
Restart ComfyUI, or install via ComfyUI Manager (search "AUN"). No models, no heavy dependencies - pack-standard requirements only, auto-installed by Manager or with pip install -r custom_nodes/AUN-ComfyUI-Nodes/requirements.txt after a manual clone.
The only thing to know: it's aggressive. It strips leading and trailing digits too, so if a meaningful part of your string is a number at the edge (like a version "2" that matters), it'll be removed. Feed it filenames, not data you care about preserving digit-for-digit.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | Text to trim. Removes leading/trailing digits and spaces. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| cleaned text | STRING | — |