Skip to content

Do variables exist in YAML? #16

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

Closed
valconius opened this issue Dec 31, 2022 · 1 comment
Closed

Do variables exist in YAML? #16

valconius opened this issue Dec 31, 2022 · 1 comment
Labels
Completed Issue was completed successfully. Feature Something new to add.

Comments

@valconius
Copy link

valconius commented Dec 31, 2022

This is a somewhat silly example but it would be convenient. How would one define a variable x such that …

defineVariablesHere:
  x: city
axes:
  prompt:
    title: The Prompt
    values.prompt: forest near the ${city}
  negative_prompt:
    title: The Negative Prompt
    values.negative prompt: ${city}

…, or it might be used for PromptReplace where numerous PromptReplace operations share many similar substrings.

The only thing I find refers to placeholders and aliases, https://stackoverflow.com/questions/41620674/use-placeholders-in-yaml

Since I want to substitute into a string that won't work.

@mcmonkey4eva mcmonkey4eva added the Feature Something new to add. label Dec 31, 2022
mcmonkey4eva added a commit that referenced this issue Jan 9, 2023
@mcmonkey4eva
Copy link
Member

Eh, why not, adds a bit of convenience for repetitive values. Added^
You can just do like:

variables:
    (type): waffle

and then use prompt: a (type)
You can use literally any format, the parens are just an easy example - it's a simple string replacement, nothing fancy.

@mcmonkey4eva mcmonkey4eva added the Completed Issue was completed successfully. label Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Completed Issue was completed successfully. Feature Something new to add.
Projects
None yet
Development

No branches or pull requests

2 participants