Fooocus icon indicating copy to clipboard operation
Fooocus copied to clipboard

add nsfw image censoring via config and checkbox

Open mashb1t opened this issue 1 year ago • 12 comments

activatable via config, uses CompVis/stable-diffusion-safety-checker

closes https://github.com/lllyasviel/Fooocus/issues/950

mashb1t avatar Nov 15 '23 21:11 mashb1t

now has config path support as mentioned in https://github.com/lllyasviel/Fooocus/pull/1418

mashb1t avatar Dec 16 '23 20:12 mashb1t

guys when will be this ready to pull? thanks a lot, appreciate ur job

R080T avatar Dec 21 '23 17:12 R080T

guys when will be this ready to pull? thanks a lot, appreciate ur job

@R080T Waiting for the review, probably mid/end of January as mentioned in https://github.com/lllyasviel/Fooocus/blob/8e62a72a63b30a3067d1a1bc3f8d226824bd9283/update_log.md?plain=1#L1

mashb1t avatar Dec 30 '23 23:12 mashb1t

Thanks guys, I will be also available for testing as I work as a qa automation engineer for 3 years, feel free to contact me if you’re interested. Regards,RobiOn 31 Dec 2023, at 00:31, Manuel Schmid @.***> wrote:

guys when will be this ready to pull? thanks a lot, appreciate ur job

@R080T Waiting for the review, probably mid/end of January as mentioned in https://github.com/lllyasviel/Fooocus/blob/8e62a72a63b30a3067d1a1bc3f8d226824bd9283/update_log.md?plain=1#L1

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

R080T avatar Dec 30 '23 23:12 R080T

Any plans to merge? Seems to be useful. Thanks

ke1ne avatar Feb 06 '24 02:02 ke1ne

Hey im trying to use the censor but im not sure how to add it to my file i created censor .py and add the lines on the other files but im still able to generate nsfw

Msumri avatar Feb 14 '24 18:02 Msumri

@Msumri please check if you've activated the feature either using the config or the checkbox in the developer debug mode.

mashb1t avatar Feb 14 '24 18:02 mashb1t

config

how do i activate it using config. im sorry im new to all this

Just editing this. I totally overlooked the False value on the config file sorry

Msumri avatar Feb 14 '24 18:02 Msumri

i activated it but im still able to generate NSFW

Msumri avatar Feb 14 '24 18:02 Msumri

@Msumri first of all: it's important to note that you can activate this feature by using either config or checkbox.

Second: is the text "Checking for NSFW content" shown as last step of each image generation? If not, ensure you have applied the necessary code adjustments to all 8 affected files.

You can go to https://colab.research.google.com/github/lllyasviel/Fooocus/blob/main/fooocus_colab.ipynb and replace the content of the playbook with the following code to spin up a Colab instance with all changes of this feature branch:

!pip install pygit2==1.12.2
%cd /content
!git clone --branch feature/add-nsfw-filter https://github.com/mashb1t/Fooocus.git
%cd /content/Fooocus
!python entry_with_update.py --share

If this works you've missed some changes (i've already double checked, works fine for me after checking the checkbox "Black Out NSFW").

Screenshot_20240214-203010

mashb1t avatar Feb 14 '24 19:02 mashb1t

@Msumri first of all: it's important to note that you can activate this feature by using either config or checkbox.

Second: is the text "Checking for NSFW content" shown as last step of each image generation? If not, ensure you have applied the necessary code adjustments to all 8 affected files.

You can go to https://colab.research.google.com/github/lllyasviel/Fooocus/blob/main/fooocus_colab.ipynb and replace the content of the playbook with the following code to spin up a Colab instance with all changes of this feature branch:

!pip install pygit2==1.12.2
%cd /content
!git clone --branch feature/add-nsfw-filter https://github.com/mashb1t/Fooocus.git
%cd /content/Fooocus
!python entry_with_update.py --share

If this works you've missed some changes (i've already double checked, works fine for me after checking the checkbox "Black Out NSFW").

Screenshot_20240214-203010

Thanks it worked

Msumri avatar Feb 15 '24 13:02 Msumri

fyi I was able to remove the dependency of diffusers by extracting the needed classes into extras.

mashb1t avatar May 17 '24 21:05 mashb1t

Description:

We have successfully integrated the Fooocus API and are now attempting to incorporate NSFW models into our API built from the repo-- Fooocus-API. We have added the new models by replacing the existing folders in our repository with extras, idm_patched, models, modules, presets, sdxl_styles, wildcards, args_manager.py, and fooocus_version.py. We currently have an issue where the app does not generate any images.

Expected Behavior: The new NSFW models should load within a reasonable time frame and generate images with the integrated nsfw code.

Actual Behavior: The models take an excessively long time to load and often do not load at all.

Attachments: Screen recording

Additional Context: We are using the following environment setup:

  • OS: Ubuntu 22.04 Ampere A100 (40 GB GPU memory)
  • Python Version: 3.10

DisantHoridnt avatar May 23 '24 15:05 DisantHoridnt

@PrinceDisant please open an issue / discussion in Fooocus-API repository as this as nothing to do with Fooocus, where the feature has been implemented in develop and is working correctly in 2.4.0-RC1/2 as well as in my fork.

mashb1t avatar May 23 '24 15:05 mashb1t

@mashb1t Thank you for the prompt response, I will certainly open an issue there. I implemented your code for the foocus library into my foocus api, but it didnt work. I did it as there is no default NSFW for the foocus api.

DisantHoridnt avatar May 23 '24 15:05 DisantHoridnt