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

variables in wildcards doesn't apply to upper scope same-name variable #817

Open
teamolhuang opened this issue Aug 25, 2024 · 1 comment

Comments

@teamolhuang
Copy link

teamolhuang commented Aug 25, 2024

I wrote some generic prompts to combine funny arts, like this

# main-prompt.txt
${character:__characters/**__}, ${default-eyes:{looking at viewer|averting eyes}}
# characters/a.txt
${default-eyes=ahegao}morikubo nono, other tags...

and in UI prompt I wrote it like:

${character=__characters/a__}__main-prompt__

This results in all images are with character A, but ahegao never gets used. Instead it's using the default values in main-prompt. Is this expected behaviour?

When I write it like this in UI prompt:

${character=__characters/a__}${default-eyes:ahegao}__main-prompt__

It's now character A with ahegao always as expected. I wish to exhibit this behavior without defining default-eyes in UI prompt.

I've tried immediate evaluation in characters/a.txt, but still doesn't work.

This can apply to outfits, etc. I want to define default outfits for each character in the character's template, and later in the main prompt decide to use those or not. Current behaviour makes it difficult to achieve.

@teamolhuang
Copy link
Author

teamolhuang commented Aug 25, 2024

With further test, I think this is related to variable scope. If I change to a structure like this,

# main-prompt.txt
${character:__characters/**__}
# eyes-picker.txt
${default-eyes:{looking at viewer|averting eyes}}
# characters/a.txt
${default-eyes=ahegao}morikubo nono, other tags..., __eyes-picker__
# characters/b.txt
kobeni higashiyama, other tags... __eyes-picker__

This works as ahegao is now successfully constantly chosen, but now every character/*.txt has to have eyes-picker. Is there a better way to structure this?

@teamolhuang teamolhuang changed the title variables in wildcards doesn't apply to other wildcard variables in wildcards doesn't apply to upper scope same-name variable Aug 25, 2024
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

1 participant