Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quantifying Wildcard Issue? #47

Open
gobshyte opened this issue Jun 28, 2024 · 2 comments
Open

Quantifying Wildcard Issue? #47

gobshyte opened this issue Jun 28, 2024 · 2 comments

Comments

@gobshyte
Copy link

gobshyte commented Jun 28, 2024

Hi

I'm trying to use the quantifying wildcard, as described here:
https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/ImpactWildcard.md#syntax

Qunatifying wildcard: $$count#wildcards repeats wildcards many as count
   {2$$, $$5#__wildcards__} turns into {2$$, $$__wildcards__|__wildcards__|__wildcards__|__wildcards__|__wildcards__}

In my initial testing, I had a simple file with colours in, and I wanted to randomly select 1-4 colors, so I did this:

{1-4$$4#__colour__}
Light Grey Amber

This is the same as if I did this:

{1-4$$__color__|__color__|__color__|__color__}
Blue White Red

However, if I want to put commas between them...

This works:

{1-4$$__color__,|__color__,|__color__,|__color__,}
Yellow, Purple, Tan

But this behaves a little unexpectedly:

{1-4$$4#__color__,}
Green Grey Magenta, Yellow
Dark Purple, Light Grey Dark Grey Rainbow
Dark Grey, Violet Navy Blue
Dark Green Magenta

It seems off with multiple quantifiers also:

{4$$2#__color__ color,|2#__shape__ shape,}
sphere square shape, Aqua Light Grey color,
Purple Orange color, diamond shape, cube

It's like any constant value in each wildcard is only included once and is not being picked up by the quantifier?

@ltdrdata
Copy link
Owner

ltdrdata commented Jun 28, 2024

As explained in the syntax description, $$count#wildcards is syntax that affects only a single wildcard.

The current wildcard system is borrowed from an existing wildcard system for convenience. While it works fine for simple wildcards, its intuitiveness significantly diminishes as more complex syntax is introduced.
TBH, since it is not well-formed syntax, it's hard to know where grammatical conflicts might occur.

So, I believe it is appropriate to devise a separate prompt description language for any syntactic elements other than __xxx__ or {||}.

@gobshyte
Copy link
Author

Yeah I was under the impression the 'wildcard' was anything between || rather than xxx, and agreed it is confusing. I love using them regardless!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@gobshyte @ltdrdata and others