Skip to content

Commit

Permalink
handle lack of negative prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Apr 24, 2023
1 parent 9e9fe90 commit b1aafd2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/onnx_web/diffusers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,11 @@ def parse_prompt(
inversions.extend(neg_inversions)

prompts = expand_alternative_ranges(prompt)
neg_prompts = expand_alternative_ranges(neg_prompt)
if neg_prompt is not None:
neg_prompts = expand_alternative_ranges(neg_prompt)
else:
neg_prompts = [None] * len(prompts)

logger.trace("generated prompts: %s, %s", prompts, neg_prompts)

# count these ahead of time, because they will change
Expand Down

0 comments on commit b1aafd2

Please sign in to comment.