numpy opencv-python pillow typing onnxruntime torchvision


The plugin is currently stable, so it hasn’t been updated.
git clone https://github.com/fallingmeteorite/nsfw-image-check-comfyui.git
cd nsfw-image-check-comfyui
pip install -r requirements.txt
or
comfy node registry-install nsfw-image-check-comfyui
Node Name:Nsfw Image Check Node
Block inappropriate content in images and output a warning image
Node Name:Nsfw area coverage
Filter out inappropriate content and output
image_requires_in Input the chart. Usually, VAE decoding or image loading follows.
image_requires_out Used for outputting images, filtering can be done by outputting the original image or the warning
image.
custom_image_out Custom images used to replace images that trigger detection (optional)
corresponding_filter_entries Output the filters triggered by the automatic check mode (optional)
corresponding_filter_entries: Used to indicate the filters that have been triggered
enabled_check: Enable detection?
xxxx threshold: Threshold for triggering detection. The lower the threshold, the stronger the effect, range (0~1)
xxxx enabled: Whether to enable this type of detection during the testing period (effective when filter_choose is
set to auto_nsfw_check)
filter_choose: Which filters are enabled when auto_nsfw_check is selected will run all filters where xxxx enabled
is True.
The images you want to replace are placed in the img folder, with the file extension .jpg, and the file names need
to be changed to sequential numbers.
Libraries used: https://github.com/deepghs/imgutils
Since the code only requires some functions of this library, installing it would need a large number of dependencies,
which somewhat goes against my expectation for it to be lightweight. Therefore, I only kept the necessary code and
removed the online download feature. The model has been downloaded to the plugin folder.
Thanks to this library for completing the core processing part.