adieyal / comfyui-dynamicprompts

ComfyUI custom nodes for Dynamic Prompts
MIT License
187 stars 20 forks source link

YAML File Weights Documentation #30

Open Kinglord opened 8 months ago

Kinglord commented 8 months ago

Hi,

This isn't really a bug for you but the guide you link to for random weights in YAML files is missing some key syntax and probably causing a lot of headaches, the listed syntax for random weights is

color:
- {2::red
  | 3::blue
  | 1::green
  }

Which does not work and actually breaks the wildcard key. To properly use weights it needs to be wrapped in quotes like

color:
    - "{8::red
        | 3:blue
        | 1::green
       }"

For anyone trying to do this note you don't use the normal list format because then you'd have to add a list entry for everytime you want an item weighted.

adieyal commented 7 months ago

Thanks for that. We have just added explicit support for weights in yaml and json. The official documentation will be updated soon, but you can see examples here: https://github.com/adieyal/dynamicprompts/pull/97

Kinglord commented 7 months ago

This is awesome, thanks so much for adding that! Feel free to close this out I will once the docs are updated.