From 44974ef2ca6365bb80651e1f89bf84f87fdffd17 Mon Sep 17 00:00:00 2001 From: Johannes Stelzer Date: Wed, 23 Nov 2022 14:36:33 +0100 Subject: [PATCH] negative prompts --- latent_blending.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/latent_blending.py b/latent_blending.py index 4c24a9c..508a49b 100644 --- a/latent_blending.py +++ b/latent_blending.py @@ -659,8 +659,13 @@ class LatentBlending(): Args: prompt: str ABC trending on artstation painted by Old Greg. - """ - uncond_tokens = [""] + """ + if self.negative_prompt is None: + uncond_tokens = [""] + else: + if isinstance(self.negative_prompt, str): + uncond_tokens = [self.negative_prompt] + batch_size = 1 num_images_per_prompt = 1 do_classifier_free_guidance = True @@ -972,7 +977,8 @@ if __name__ == "__main__": fixed_seeds = [993621550, 280335986] lb = LatentBlending(pipe, device, height, width, num_inference_steps, guidance_scale) - prompt1 = "photo of a beautiful forest covered in white flowers, ambient light, very detailed, magic" + lb.negative_prompt = 'text, letters' + prompt1 = "photo of a beautiful newspaper covered in white flowers, ambient light, very detailed, magic" prompt2 = "photo of an eerie statue surrounded by ferns and vines, analog photograph kodak portra, mystical ambience, incredible detail" lb.set_prompt1(prompt1) lb.set_prompt2(prompt2)