Skip to content

[Bug]: prompt parser doesn't allow whitespace between number and "]" in prompt editing #11627

@rubberbaron

Description

@rubberbaron

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

The syntax [foo : 0.1] works correctly, but the syntax [foo : 0.1 ] doesn't work correctly.

For example, compare prompts "woman [on beach:0.5]" to "woman [on beach:0.5 ]" with a fixed seed.

The issue is this line of lark grammar: https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/master/modules/prompt_parser.py#L20

   scheduled: "[" [prompt ":"] prompt ":" [WHITESPACE] NUMBER "]"

which should be

   scheduled: "[" [prompt ":"] prompt ":" [WHITESPACE] NUMBER [WHITESPACE] "]"

Corresponding changes must be made to the two scheduled() visitors to account for the extra list item generated by the rule.

Steps to reproduce the problem

x

What should have happened?

x

Version or Commit where the problem happens

394ffa7

What Python version are you running on ?

None

What platforms do you use to access the UI ?

No response

What device are you running WebUI on?

No response

Cross attention optimization

xformers

What browsers do you use to access the UI ?

No response

Command Line Arguments

x

List of extensions

x

Console logs

x

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-reportReport of a bug, yet to be confirmed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions