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:
@ -81,18 +81,18 @@ with metadata_from_png():
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import argparse
|
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 base64
|
||||||
|
import copy
|
||||||
import functools
|
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
|
import ldm.invoke.pngwriter
|
||||||
from ldm.invoke.globals import Globals
|
from ldm.invoke.globals import Globals
|
||||||
from ldm.invoke.prompt_parser import split_weighted_subprompts
|
from ldm.invoke.prompt_parser import split_weighted_subprompts
|
||||||
@ -477,7 +477,7 @@ class Args(object):
|
|||||||
default='auto',
|
default='auto',
|
||||||
)
|
)
|
||||||
model_group.add_argument(
|
model_group.add_argument(
|
||||||
'--nsfw_checker'
|
'--nsfw_checker',
|
||||||
'--safety_checker',
|
'--safety_checker',
|
||||||
action=argparse.BooleanOptionalAction,
|
action=argparse.BooleanOptionalAction,
|
||||||
dest='safety_checker',
|
dest='safety_checker',
|
||||||
|
@ -356,7 +356,12 @@ class ModelCache(object):
|
|||||||
|
|
||||||
pipeline = StableDiffusionGeneratorPipeline.from_pretrained(
|
pipeline = StableDiffusionGeneratorPipeline.from_pretrained(
|
||||||
name_or_path,
|
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: alternate VAE
|
||||||
# TODO: local_files_only=True
|
# TODO: local_files_only=True
|
||||||
**pipeline_args
|
**pipeline_args
|
||||||
|
Reference in New Issue
Block a user