ComfyUI > Nodes > ComfyUI-Creepy_nodes > Sanitize Filename (Creepybits)

ComfyUI Node: Sanitize Filename (Creepybits)

Class Name

SanitizeFilename

Category
Creepybits/Utilities
Author
Creepybits (Account age: 2146days)
Extension
ComfyUI-Creepy_nodes
Latest Updated
2025-12-07
Github Stars
0.02K

How to Install ComfyUI-Creepy_nodes

Install this extension via the ComfyUI Manager by searching for ComfyUI-Creepy_nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Creepy_nodes in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Sanitize Filename (Creepybits) Description

Clean and prepare text strings for filenames by removing or replacing disallowed characters, ensuring compatibility with operating systems.

Sanitize Filename (Creepybits):

The SanitizeFilename node is designed to clean and prepare text strings for use as filenames by removing or replacing characters that are not allowed in file names. This node is particularly useful when you need to ensure that filenames are compatible with various operating systems, which often have restrictions on the characters that can be used. By sanitizing filenames, you can prevent errors that may occur when saving or accessing files with invalid names. The node operates by stripping out newline characters, removing or replacing characters such as backslashes, forward slashes, asterisks, question marks, colons, quotes, angle brackets, and pipes, and trimming any leading or trailing whitespace. This ensures that the resulting filename is clean, concise, and free from problematic characters, making it suitable for file storage and retrieval operations.

Sanitize Filename (Creepybits) Input Parameters:

text

The text parameter is a string input that represents the filename you wish to sanitize. It accepts multiline text, allowing you to input filenames that may contain newline characters or other invalid characters. The function of this parameter is to provide the raw filename that needs to be cleaned up. By processing this input, the node ensures that the output is a valid filename free from characters that could cause issues when saving or accessing files. There are no specific minimum, maximum, or default values for this parameter, as it is designed to handle any string input that requires sanitization.

Sanitize Filename (Creepybits) Output Parameters:

sanitized_text

The sanitized_text output parameter is a string that represents the cleaned and sanitized version of the input filename. This output is crucial as it provides a filename that is free from invalid characters and ready for use in file operations. The sanitized text ensures compatibility with file systems by removing problematic characters and whitespace, thus preventing potential errors related to file naming conventions. The output is a single string that can be directly used as a valid filename.

Sanitize Filename (Creepybits) Usage Tips:

  • Use the SanitizeFilename node whenever you need to generate filenames from user input or dynamically generated text to ensure compatibility with file systems.
  • Consider integrating this node into workflows where filenames are automatically generated, such as when saving images or documents, to prevent errors related to invalid characters.

Sanitize Filename (Creepybits) Common Errors and Solutions:

Invalid characters in filename

  • Explanation: This error occurs when the input text contains characters that are not allowed in filenames, such as \, /, *, ?, :, ", <, >, and |.
  • Solution: Use the SanitizeFilename node to automatically remove or replace these invalid characters, ensuring the output is a valid filename.

Filename contains newline characters

  • Explanation: Newline characters in filenames can cause issues when saving or accessing files, as they are not typically allowed in filenames.
  • Solution: The SanitizeFilename node removes newline characters from the input text, so ensure that the input is processed through this node to produce a valid filename.

Sanitize Filename (Creepybits) Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Creepy_nodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.