mcmonkeyprojects/sd-infinity-grid-generator-script

Do variables exist in YAML?

valconius opened this issue · 1 comments

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.

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.