Skip to content

Commit

Permalink
refactor: extract argument parsing into function
Browse files Browse the repository at this point in the history
  • Loading branch information
boriselec authored and fboulnois committed Dec 3, 2023
1 parent e4227b0 commit 7d559de
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docker-entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 7d559de

Please sign in to comment.