Skip to content

Commit

Permalink
fix(api): handle empty prompts (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Apr 22, 2023
1 parent 6e7f202 commit 9bb612f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/onnx_web/server/params.py
Expand Up @@ -62,13 +62,14 @@ def pipeline_from_request(
if scheduler is None:
scheduler = get_config_value("scheduler")

# image params
prompt = get_not_empty(request.args, "prompt", get_config_value("prompt"))
# prompt does not come from config
prompt = request.args.get("prompt", "")
negative_prompt = request.args.get("negativePrompt", None)

if negative_prompt is not None and negative_prompt.strip() == "":
negative_prompt = None

# image params
batch = get_and_clamp_int(
request.args,
"batch",
Expand Down

0 comments on commit 9bb612f

Please sign in to comment.