yolain / ComfyUI-Easy-Use

In order to make it easier to use the ComfyUI, I have made some optimizations and integrations to some commonly used nodes.
GNU General Public License v3.0
1.08k stars 77 forks source link

Custom style with prompt containing { } #495

Open dirtyapenz opened 4 weeks ago

dirtyapenz commented 4 weeks ago

When I use a custom style which has {braces} embedded in the prompt it causes an error. Is there a way to escape them?

[
    {
        "name": "cat|dog",
        "prompt": "{prompt} holding a {cat|dog}",
        "negative_prompt": "goat"
     }
]

Error:

  File "/home/yomomma/github/ComfyUI/custom_nodes/ComfyUI-Easy-Use/py/easyNodes.py", line 189, in run
    positive_prompt = all_styles[val]['prompt'].format(prompt=positive)
yolain commented 4 weeks ago
截屏2024-10-28 20 04 07
dirtyapenz commented 4 weeks ago

Using double {{braces}} works adequately.

[
    {
        "name": "cat|dog",
        "prompt": "{prompt} holding a {{cat|dog}}",
        "negative_prompt": "goat"
     }
]