ComfyDeploy: How ComfyUI Safety Checker works in ComfyUI?
What is ComfyUI Safety Checker?
This project provides custom safety checkers for image classification using Falcons AI and CompVis models. The safety checkers are designed to detect and filter out NSFW content from images.
How to install it in ComfyDeploy?
Head over to the machine page
- Click on the "Create a new machine" button
- Select the
Edit
build steps - Add a new step -> Custom Node
- Search for
ComfyUI Safety Checker
and select it - Close the build step dialig and then click on the "Save" button to rebuild the machine
ComfyUI Safety Checker
This project provides custom safety checkers for image classification using Falcons AI and CompVis models. The safety checkers are designed to detect and filter out NSFW content from images.
Features
- Falcons AI Safety Checker
- CompVis Safety Checker
Requirements
- Python 3.8+
- PyTorch
- Transformers
- ComfyUI
Installation
-
Clone the repository:
git clone https://github.com/shabri-arrahim/ComfyUI-Safety-Checker.git cd ComfyUI-Safety-Checker
-
Install the required dependencies:
pip install -r requirements.txt
-
Download the models and place them into the
diffusers
folder in themodels
directory:-
Falcon AI model:
huggingface-cli download Falconsai/nsfw_image_detection --local-dir models/diffusers/Falconsai_nsfw_image_detection
-
CompVis model:
huggingface-cli download CompVis/stable-diffusion-safety-checker --local-dir models/diffusers/CompVis_stable_diffusion_safety_checker
-
Usage
Running with ComfyUI
-
Ensure you have ComfyUI installed and set up. If not, follow the instructions on the ComfyUI GitHub page.
-
Place this cloned repository into the ComfyUI custom nodes directory:
cp -r /path/to/ComfyUI-Safety-Checker /path/to/comfyui/custom_nodes/
-
Start ComfyUI:
cd /path/to/comfyui python main.py
-
In the ComfyUI interface, you should now see the custom nodes
FalconsAISafetyChecker
andCompVisSafetyChecker
available under the "SafetyChecker" category. -
Use these nodes in your ComfyUI workflows to filter images for NSFW content.
License
This project is licensed under the MIT License.