mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix --safety_checker arg parsing
and add note to diffusers loader about where safety checker gets called
This commit is contained in:
parent
e32b82a480
commit
0b48f2e801
@ -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',
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user