ComfyUI > Nodes > ComfyUI-LexTools > NSFWClassifierNode

ComfyUI Node: NSFWClassifierNode

Class Name

NSFWClassifierNode

Category
LexTools/ImageProcessing/Classification
Author
SOELexicon (Account age: 4757days)
Extension
ComfyUI-LexTools
Latest Updated
2025-03-28
Github Stars
0.03K

How to Install ComfyUI-LexTools

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

NSFWClassifierNode Description

NSFWClassifierNode evaluates images for SFW or NSFW content using a pre-trained model.

NSFWClassifierNode:

The NSFWClassifierNode is designed to evaluate images and classify them as either Safe For Work (SFW) or Not Safe For Work (NSFW). This node leverages a pre-trained model to analyze the content of an image and determine the likelihood of it being NSFW. The primary benefit of this node is its ability to automate the process of content moderation, which is crucial for platforms that host user-generated content. By providing a probabilistic assessment of an image's content, the node helps in making informed decisions about content filtering and management. The node's functionality is centered around its classify_nsfw method, which processes the image and returns a classification along with confidence scores for both SFW and NSFW categories. This makes it an essential tool for maintaining community standards and ensuring compliance with content guidelines.

NSFWClassifierNode Input Parameters:

image

The image parameter is the input image that you want to classify. It is expected to be in a format that the node can process, typically as a tensor. This parameter is crucial as it is the subject of the classification process. The node converts this image into a format suitable for analysis, which involves transforming it into a numpy array for further processing.

show_on_node

The show_on_node parameter is a boolean that determines whether the classification results should be displayed on the node interface. By default, this is set to False. When set to True, the node will provide a textual output of the classification results directly on the node, which can be useful for quick assessments without needing to delve into detailed outputs.

threshold

The threshold parameter is a float value that sets the minimum probability required for an image to be classified as either SFW or NSFW. It ranges from 0.0 to 1.0, with a default value of 0.5. This threshold is used to determine the boolean states Is SFW and Is NSFW, allowing you to adjust the sensitivity of the classification according to your specific needs. A higher threshold means stricter classification criteria.

NSFWClassifierNode Output Parameters:

Classification

The Classification output is a string that provides a summary of the classification results. It indicates whether the image is predicted to be SFW or NSFW, along with the respective probabilities. This output is essential for understanding the node's decision and is formatted to be easily interpretable.

SFW Score

The SFW Score is a float representing the probability that the image is Safe For Work. This score helps in assessing the confidence level of the SFW classification, providing a quantitative measure that can be used for further decision-making processes.

NSFW Score

The NSFW Score is a float that indicates the probability of the image being Not Safe For Work. Similar to the SFW Score, this output provides a confidence level for the NSFW classification, which is crucial for content moderation and filtering.

Is SFW

The Is SFW output is a boolean that indicates whether the image is classified as Safe For Work based on the specified threshold. This output simplifies the decision-making process by providing a clear yes or no answer to the SFW classification.

Is NSFW

The Is NSFW output is a boolean that shows whether the image is classified as Not Safe For Work, again based on the threshold. This output is particularly useful for automated systems that need to quickly determine the appropriateness of content.

NSFWClassifierNode Usage Tips:

  • Adjust the threshold parameter to fine-tune the sensitivity of the classification. A lower threshold may result in more images being classified as NSFW, while a higher threshold will be more conservative.
  • Use the show_on_node parameter to quickly view classification results during testing or development phases, which can help in understanding how the node is performing with different types of images.
  • Regularly update the model to ensure it remains effective against new types of content that may not have been present in the original training data.

NSFWClassifierNode Common Errors and Solutions:

Error in NSFW classification: <error_message>

  • Explanation: This error occurs when there is an issue during the classification process, which could be due to an invalid image format or a problem with the model.
  • Solution: Ensure that the input image is in the correct format and that the model is properly loaded. Check for any updates or patches that might address compatibility issues.

NSFWClassifierNode Related Nodes

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

NSFWClassifierNode