diff --git a/ldm/invoke/args.py b/ldm/invoke/args.py index aa9b94ffaf..c18a5d3534 100644 --- a/ldm/invoke/args.py +++ b/ldm/invoke/args.py @@ -81,18 +81,18 @@ with metadata_from_png(): """ import argparse -from argparse import Namespace, RawTextHelpFormatter -import pydoc -import json -import hashlib -import os -import re -import sys -import shlex -import copy import base64 +import copy import functools -import warnings +import hashlib +import json +import os +import pydoc +import re +import shlex +import sys +from argparse import Namespace + import ldm.invoke.pngwriter from ldm.invoke.globals import Globals from ldm.invoke.prompt_parser import split_weighted_subprompts @@ -477,7 +477,7 @@ class Args(object): default='auto', ) model_group.add_argument( - '--nsfw_checker' + '--nsfw_checker', '--safety_checker', action=argparse.BooleanOptionalAction, dest='safety_checker', diff --git a/ldm/invoke/model_cache.py b/ldm/invoke/model_cache.py index f57dc6de19..0bfbfe32be 100644 --- a/ldm/invoke/model_cache.py +++ b/ldm/invoke/model_cache.py @@ -356,7 +356,12 @@ class ModelCache(object): pipeline = StableDiffusionGeneratorPipeline.from_pretrained( name_or_path, - safety_checker=None, # TODO + # TODO: Safety checker is currently handled at a different stage in the code: + # ldm.invoke.generator.base.Generator.safety_check + # We might want to move that here for consistency with diffusers API, or we might + # want to leave it as a separate processing node. It ends up using the same diffusers + # code either way, so we can table it for now. + safety_checker=None, # TODO: alternate VAE # TODO: local_files_only=True **pipeline_args