From 7d559de42ec20831516fb2dd88b4c9c259a1ae06 Mon Sep 17 00:00:00 2001 From: boriselec Date: Tue, 21 Mar 2023 20:09:09 +0300 Subject: [PATCH] refactor: extract argument parsing into function --- docker-entrypoint.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docker-entrypoint.py b/docker-entrypoint.py index 4f95391..ec289c9 100755 --- a/docker-entrypoint.py +++ b/docker-entrypoint.py @@ -150,7 +150,7 @@ def stable_diffusion_inference(p): print("completed pipeline:", iso_date_time(), flush=True) -def main(): +def parse_args(): parser = argparse.ArgumentParser(description="Create images from a text prompt.") parser.add_argument( "--attention-slicing", @@ -289,6 +289,10 @@ def main(): if args.prompt0 is not None: args.prompt = args.prompt0 + return args + +def main(): + args = parse_args() pipeline = stable_diffusion_pipeline(args) stable_diffusion_inference(pipeline)