1.6 KiB
1.6 KiB
FilenameAppendSuffix
Overview
FilenameAppendSuffix builds a new filename by appending a suffix to an existing path. It supports removing multi-part extensions (e.g., .tar.gz), trimming whitespace, and optionally preserving the original directory component.
Inputs
filename(STRING, default empty): Original filename or path.suffix(STRING, default empty): Text appended to the base name. Leave empty to omit the suffix altogether.separator(STRING, default"-"): Separator inserted between the base name andsuffixwhen needed.strip_all_extensions(BOOLEAN, defaultTrue): WhenTrue, removes every trailing extension component (useful for multi-part archives). WhenFalse, only strips the final extension.preserve_directory(BOOLEAN, defaultTrue): When enabled, reattaches the original directory path to the generated filename.trim_whitespace(BOOLEAN, defaultTrue): Trims leading/trailing whitespace from the filename, suffix, and separator before processing.
Outputs
filename(STRING): The rewritten filename/path.
Processing Notes
- If the base name already ends with the separator, the suffix is appended without duplicating it.
- When
suffixis empty, the base name is returned as-is (subject to extension stripping). - Directory handling uses
os.path.join, so platform-specific separators are respected.
Tips
- Chain this node after
LoadImageCombinedorPairedImageLoaderto build save paths that mirror the input file names. - Disable
preserve_directorywhen you want to relocate files into a new output folder without carrying over their original path.