adieyal / sd-dynamic-prompts

A custom script for AUTOMATIC1111/stable-diffusion-webui to implement a tiny template language for random prompt generation
MIT License
1.96k stars 253 forks source link

[BUG] Fails to parse YAML options that start with { #775

Closed sialivi closed 3 weeks ago

sialivi commented 1 month ago
test:
  - {A|B|C}

The above YAML will result in the following error message:

WARNING:dynamicprompts.wildcards.collection.structured:Unsupported list item: {'1|2|3': None}1 [00:00<00:00, 2.92it/s]

Adding anything before the {, for example a non-breaking space, and the line will parse just fine.

Hunt3rseeker commented 1 month ago

I'm having the same problem in Forge. WARNING:dynamicprompts.wildcards.collection.structured:Wildcard file C:\Stable_Diffusion\Forge\webui\extensions\sd-dynamic-prompts\wildcards\womensHairStyles211_v20.json has unsupported value for key modelId WARNING:dynamicprompts.wildcards.collection.structured:Wildcard file C:\Stable_Diffusion\Forge\webui\extensions\sd-dynamic-prompts\wildcards\womensUndergarments_v10.api_info.json has unsupported value for key id WARNING:dynamicprompts.wildcards.collection.structured:Wildcard file C:\Stable_Diffusion\Forge\webui\extensions\sd-dynamic-prompts\wildcards\womensUndergarments_v10.api_info.json has unsupported value for key allowNoCredit WARNING:dynamicprompts.wildcards.collection.structured:Wildcard file C:\Stable_Diffusion\Forge\webui\extensions\sd-dynamic-prompts\wildcards\womensUndergarments_v10.api_info.json has unsupported value for key allowDerivatives WARNING:dynamicprompts.wildcards.collection.structured:Wildcard file C:\Stable_Diffusion\Forge\webui\extensions\sd-dynamic-prompts\wildcards\womensUndergarments_v10.api_info.json has unsupported value for key allowDifferentLicense WARNING:dynamicprompts.wildcards.collection.structured:Wildcard file C:\Stable_Diffusion\Forge\webui\extensions\sd-dynamic-prompts\wildcards\womensUndergarments_v10.api_info.json has unsupported value for key nsfwLevel WARNING:dynamicprompts.wildcards.collection.structured:Wildcard file C:\Stable_Diffusion\Forge\webui\extensions\sd-dynamic-prompts\wildcards\womensUndergarments_v10.api_info.json has unsupported value for key stats/downloadCount WARNING:dynamicprompts.wildcards.collection.structured:Wildcard file C:\Stable_Diffusion\Forge\webui\extensions\sd-dynamic-prompts\wildcards\womensUndergarments_v10.api_info.json has unsupported value for key stats/thumbsUpCount WARNING:dynamicprompts.wildcards.collection.structured:Wildcard file C:\Stable_Diffusion\Forge\webui\extensions\sd-dynamic-prompts\wildcards\womensUndergarments_v10.api_info.json has unsupported value for key stats/commentCount WARNING:dynamicprompts.wildcards.collection.structured:Wildcard file C:\Stable_Diffusion\Forge\webui\extensions\sd-dynamic-prompts\wildcards\womensUndergarments_v10.api_info.json has unsupported value for key stats/tippedAmountCount

bluelovers commented 1 month ago

this is yaml rule

u need

sialivi commented 1 month ago

this is yaml rule

My code snippet is valid YAML, so I don't see why that would be the case.

bluelovers commented 1 month ago

{ will make yaml thinking it is map {key:value} , not item of array [i]

akx commented 1 month ago

Yes, it's valid YAML, but it's not what you mean. Try pasting

test:
  - {A|B|C}

into my data-to-data converter tool (making sure it's YAML on the left and JSON on the right) to see how it's parsed.

Then try

test:
  - "{A|B|C}"

as @bluelovers rightly said above.