ljleb / prompt-fusion-extension

auto1111 webui extension for all sorts of prompt interpolations!
MIT License
259 stars 16 forks source link

weighted average V1 #76

Closed ljleb closed 8 months ago

ljleb commented 8 months ago

Adds syntax support for static weighted average of conditions:

[a : b : c : 1, 1 : mean]

This will merge a 0.5 and b 0.5 for the entire schedule. The schedule is always normalized to sum up to 1. For example, this is equivalent to the above:

[a : b : c : 10, 10 : mean]

This will merge a 0.3333... and b 0.6666... for the entire schedule:

[a : b : c : 5, 10 : mean]

It is possible to omit weights, they default to the inverse of the number of subprompts. For example:

[a : b : c : d : e : , , , , : mean]

will give a weight of 1/5 to each of a, b, c, etc. This is equivalent but shorter:

[a : b : c : d : e :: mean]

related: #75