ComfyUI > Nodes > COMFYUI_PROMPTMODELS > 🛡️ Text Prompt Blocker

ComfyUI Node: 🛡️ Text Prompt Blocker

Class Name

TextPromptBlocker

Category
Text/Security
Author
cdanielp (Account age: 0days)
Extension
COMFYUI_PROMPTMODELS
Latest Updated
2026-03-17
Github Stars
0.02K

How to Install COMFYUI_PROMPTMODELS

Install this extension via the ComfyUI Manager by searching for COMFYUI_PROMPTMODELS
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter COMFYUI_PROMPTMODELS 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

🛡️ Text Prompt Blocker Description

TextPromptBlocker filters prompts with prohibited words, ensuring content safety and compliance.

🛡️ Text Prompt Blocker:

The TextPromptBlocker is a security-focused node designed for ComfyUI that helps filter or block prompts containing prohibited words or their variations. Its primary purpose is to ensure that any text input adheres to specified content guidelines by detecting and managing the presence of undesirable terms. This node is particularly beneficial for maintaining content safety and compliance, as it can automatically identify and handle prompts that include sensitive or inappropriate language. By offering both hard and soft blocking modes, it provides flexibility in how detected issues are managed, either by halting the workflow or by allowing it to continue with modifications. The TextPromptBlocker is an essential tool for users who need to enforce strict content policies in their AI-generated outputs.

🛡️ Text Prompt Blocker Input Parameters:

prompt

The prompt parameter is the text input that you want to validate against the list of blocked words. It is a multiline string, allowing for comprehensive text entries. This parameter is crucial as it is the primary content being analyzed for prohibited terms. There is no specific minimum or maximum length, but it defaults to an empty string.

blocked_words

The blocked_words parameter is a multiline string that contains a comma-separated list of words that are considered prohibited. This list serves as the basis for filtering the prompt. By default, it includes terms like "child," "kid," "baby," and others related to underage themes. This parameter is essential for defining what constitutes inappropriate content.

case_sensitive

The case_sensitive parameter is a boolean that determines whether the word detection should consider case differences. If set to True, the node will differentiate between uppercase and lowercase letters, while False (the default) will treat them as equivalent. This setting impacts the sensitivity of the word detection process.

hard_block

The hard_block parameter is a boolean that specifies the blocking mode. When True, the node will raise an exception and stop the workflow if a prohibited word is detected, ensuring strict enforcement. If False, it will return an empty string but allow the workflow to continue, providing a softer approach. The default is True.

detect_contained

The detect_contained parameter is a boolean that indicates whether the node should detect prohibited words within compound words. When True (the default), it will identify words even if they are part of larger terms. If False, only exact matches will be detected, which can reduce false positives.

expand_variations

The expand_variations parameter is a boolean that controls whether the node should automatically expand the list of blocked words to include variations. When True (the default), it increases the likelihood of detecting prohibited content by considering different forms of the words. If False, only the exact words in the list are checked.

🛡️ Text Prompt Blocker Output Parameters:

original_prompt

The original_prompt output returns the initial text input provided to the node. This output is useful for reference and comparison, especially when analyzing the results of the prompt validation process.

status

The status output provides a string indicating the result of the prompt analysis. It will either confirm that no prohibited words were detected or specify the number of such words found. This output is crucial for understanding the outcome of the validation and any necessary actions.

detected_words

The detected_words output lists the prohibited words that were found in the prompt, limited to the first ten to avoid overwhelming the user. This output helps identify specific issues within the text and guides any required modifications.

🛡️ Text Prompt Blocker Usage Tips:

  • Use the hard_block mode for strict content enforcement when you need to ensure that no prohibited words are present in the final output.
  • Enable expand_variations to catch more variations of prohibited words, which is useful for comprehensive content filtering.
  • Utilize the TextPromptBlockerPreview node for testing and debugging purposes to see what words would be detected without actually blocking the prompt.

🛡️ Text Prompt Blocker Common Errors and Solutions:

🚫 PROMPT BLOQUEADO

  • Explanation: This error occurs when a prohibited word is detected in the prompt while the hard_block mode is enabled, causing the workflow to stop.
  • Solution: Review the prompt and remove or replace the detected prohibited words. Alternatively, switch to soft_block mode if stopping the workflow is not desired.

No se detectaron palabras prohibidas

  • Explanation: This message indicates that no prohibited words were found in the prompt, and it is considered clean.
  • Solution: No action is needed as the prompt meets the content guidelines.

🛡️ Text Prompt Blocker Related Nodes

Go back to the extension to check out more related nodes.
COMFYUI_PROMPTMODELS
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.

🛡️ Text Prompt Blocker