Skip to content

Commit 093a288

Browse files
committed
prompt is always mandatory
1 parent 237388c commit 093a288

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/server/client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ def parse_arguments():
3131
ap.add_argument("-v", "--verbose", action="store_true",
3232
help="print extra info.")
3333

34-
ap.add_argument("-p", "--prompt", default="",
34+
ap.add_argument("-p", "--prompt", required=True,
3535
help="the prompt to render")
36+
3637
ap.add_argument("-n", "--negative-prompt", dest="negative_prompt", default=None,
3738
help="the negative prompt (default: \"\")")
3839
ap.add_argument("-H", "--height", type=int,
@@ -112,6 +113,9 @@ def parse_arguments():
112113
output_format = 'jpeg'
113114
args_dict["output_format"] = output_format
114115

116+
if not args_dict["prompt"].strip():
117+
ap.error("argument -p/--prompt must be non‑empty")
118+
115119
util_keys = {'verbose', 'server_url', 'output', 'output_begin_idx', 'api'}
116120

117121
util_opts = {k: v for k, v in args_dict.items() if k in util_keys and v is not None}

0 commit comments

Comments
 (0)