From 6d821600f92cf769a604bb35c1354bdee2da99ae Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Wed, 30 Nov 2022 17:58:04 +0000 Subject: [PATCH 1/3] disable NSFW checker loading during the CI tests The NSFW filter apparently causes invoke.py to crash during CI testing, possibly due to out of memory errors. This workaround disables NSFW model loading. --- .github/workflows/test-invoke-conda.yml | 1 + .github/workflows/test-invoke-pip.yml | 1 + ldm/invoke/args.py | 7 +++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 69cd7d108da..06c097964cd 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -115,6 +115,7 @@ jobs: run: | time python scripts/invoke.py \ --no-patchmatch \ + --no-nsfw_checker \ --model ${{ matrix.stable-diffusion-model }} \ --from_file ${{ env.TEST_PROMPTS }} \ --root="${{ env.INVOKEAI_ROOT }}" \ diff --git a/.github/workflows/test-invoke-pip.yml b/.github/workflows/test-invoke-pip.yml index 5d6a447021b..f7b53287e0f 100644 --- a/.github/workflows/test-invoke-pip.yml +++ b/.github/workflows/test-invoke-pip.yml @@ -114,6 +114,7 @@ jobs: run: | time ${{ env.pythonLocation }}/bin/python scripts/invoke.py \ --no-patchmatch \ + --no-nsfw_checker \ --model ${{ matrix.stable-diffusion-model }} \ --from_file ${{ env.TEST_PROMPTS }} \ --root="${{ env.INVOKEAI_ROOT }}" \ diff --git a/ldm/invoke/args.py b/ldm/invoke/args.py index be2eb98a5e0..e746e5bab3c 100644 --- a/ldm/invoke/args.py +++ b/ldm/invoke/args.py @@ -463,9 +463,12 @@ def _create_arg_parser(self): default='auto', ) model_group.add_argument( + '--nsfw_checker' '--safety_checker', - action='store_true', - help='Check for and blur potentially NSFW images', + action=argparse.BooleanOptionalAction, + dest='safety_checker', + default=False, + help='Check for and blur potentially NSFW images. Use --no-nsfw_checker to disable.', ) model_group.add_argument( '--patchmatch', From e27d131c71ca5a31dad19c566c502884a1728f3a Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Wed, 30 Nov 2022 18:12:33 +0000 Subject: [PATCH 2/3] doc change --- ldm/invoke/args.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldm/invoke/args.py b/ldm/invoke/args.py index e746e5bab3c..9fd6d730ef0 100644 --- a/ldm/invoke/args.py +++ b/ldm/invoke/args.py @@ -468,7 +468,7 @@ def _create_arg_parser(self): action=argparse.BooleanOptionalAction, dest='safety_checker', default=False, - help='Check for and blur potentially NSFW images. Use --no-nsfw_checker to disable.', + help='Check for and blur potentially NSFW images.', ) model_group.add_argument( '--patchmatch', From ecb87c5e1313c9f053a104930ee7e62af1c9ba57 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Wed, 30 Nov 2022 18:18:14 +0000 Subject: [PATCH 3/3] fix formatting errors in yml files --- .github/workflows/test-invoke-conda.yml | 2 +- .github/workflows/test-invoke-pip.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 06c097964cd..41f72c5a84d 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -115,7 +115,7 @@ jobs: run: | time python scripts/invoke.py \ --no-patchmatch \ - --no-nsfw_checker \ + --no-nsfw_checker \ --model ${{ matrix.stable-diffusion-model }} \ --from_file ${{ env.TEST_PROMPTS }} \ --root="${{ env.INVOKEAI_ROOT }}" \ diff --git a/.github/workflows/test-invoke-pip.yml b/.github/workflows/test-invoke-pip.yml index f7b53287e0f..3866a4c32c1 100644 --- a/.github/workflows/test-invoke-pip.yml +++ b/.github/workflows/test-invoke-pip.yml @@ -114,7 +114,7 @@ jobs: run: | time ${{ env.pythonLocation }}/bin/python scripts/invoke.py \ --no-patchmatch \ - --no-nsfw_checker \ + --no-nsfw_checker \ --model ${{ matrix.stable-diffusion-model }} \ --from_file ${{ env.TEST_PROMPTS }} \ --root="${{ env.INVOKEAI_ROOT }}" \