From c35fcc6964ca305ee64a4b1b401444dcdf8ed435 Mon Sep 17 00:00:00 2001 From: Jacky Lee <39754370+jla524@users.noreply.github.com> Date: Sun, 12 Feb 2023 09:04:44 -0800 Subject: [PATCH] Replace phrase for prompt (#555) --- examples/stable_diffusion.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/stable_diffusion.py b/examples/stable_diffusion.py index 77a1006e6c..3c0ed0c147 100644 --- a/examples/stable_diffusion.py +++ b/examples/stable_diffusion.py @@ -605,7 +605,7 @@ FILENAME = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../weights/ if __name__ == "__main__": parser = argparse.ArgumentParser(description='Run Stable Diffusion', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--steps', type=int, default=5, help="Number of steps in diffusion") - parser.add_argument('--phrase', type=str, default="a horse sized cat eating a bagel", help="Phrase to render") + parser.add_argument('--prompt', type=str, default="a horse sized cat eating a bagel", help="Phrase to render") parser.add_argument('--out', type=str, default="/tmp/rendered.png", help="Output filename") args = parser.parse_args() @@ -633,12 +633,12 @@ if __name__ == "__main__": # run through CLIP to get context tokenizer = ClipTokenizer() - phrase = tokenizer.encode(args.phrase) - context = model.cond_stage_model.transformer.text_model(phrase).realize() + prompt = tokenizer.encode(args.prompt) + context = model.cond_stage_model.transformer.text_model(prompt).realize() print("got CLIP context", context.shape) - phrase = tokenizer.encode("") - unconditional_context = model.cond_stage_model.transformer.text_model(phrase).realize() + prompt = tokenizer.encode("") + unconditional_context = model.cond_stage_model.transformer.text_model(prompt).realize() print("got unconditional CLIP context", unconditional_context.shape) # done with clip model