From beba2be6d51264fbf6c1f339946955bab8b8e3a3 Mon Sep 17 00:00:00 2001 From: Bryce Date: Thu, 6 Oct 2022 17:21:01 -0700 Subject: [PATCH] fix: set fidelity default if None is passed in Addresses #48 --- imaginairy/schema.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/imaginairy/schema.py b/imaginairy/schema.py index b270d5e..79ce27d 100644 --- a/imaginairy/schema.py +++ b/imaginairy/schema.py @@ -86,6 +86,8 @@ class ImaginePrompt: KEEP = "keep" REPLACE = "replace" + DEFAULT_FACE_FIDELITY = 0.2 + def __init__( self, prompt=None, @@ -102,12 +104,15 @@ class ImaginePrompt: width=512, upscale=False, fix_faces=False, - fix_faces_fidelity=0.2, + fix_faces_fidelity=DEFAULT_FACE_FIDELITY, sampler_type="PLMS", conditioning=None, 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): self.prompts = [WeightedPrompt(prompt, 1)] else: