fix: set fidelity default if None is passed in

Addresses #48
This commit is contained in:
Bryce 2022-10-06 17:21:01 -07:00 committed by Bryce Drennan
parent 5cc19c460c
commit beba2be6d5

View File

@ -86,6 +86,8 @@ class ImaginePrompt:
KEEP = "keep" KEEP = "keep"
REPLACE = "replace" REPLACE = "replace"
DEFAULT_FACE_FIDELITY = 0.2
def __init__( def __init__(
self, self,
prompt=None, prompt=None,
@ -102,12 +104,15 @@ class ImaginePrompt:
width=512, width=512,
upscale=False, upscale=False,
fix_faces=False, fix_faces=False,
fix_faces_fidelity=0.2, fix_faces_fidelity=DEFAULT_FACE_FIDELITY,
sampler_type="PLMS", sampler_type="PLMS",
conditioning=None, conditioning=None,
tile_mode=False, tile_mode=False,
): ):
prompt = prompt if prompt is not None else "a scenic landscape" prompt = prompt if prompt is not None else ""
fix_faces_fidelity = (
fix_faces_fidelity if fix_faces_fidelity else self.DEFAULT_FACE_FIDELITY
)
if isinstance(prompt, str): if isinstance(prompt, str):
self.prompts = [WeightedPrompt(prompt, 1)] self.prompts = [WeightedPrompt(prompt, 1)]
else: else: