Skip to content

Do variables exist in YAML? #16

Closed
Closed

Description

@valconius

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.

Activity

  1. added a commit that references this issue on Jan 9, 2023
  2. mcmonkey4eva commented on Jan 9, 2023

    @mcmonkey4eva
    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CompletedIssue was completed successfully.FeatureSomething new to add.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions