Skip to content

Prompt Average

ljleb edited this page Dec 10, 2023 · 3 revisions

Prompt average makes it possible to merge prompts at a constant rate during denoising:

[prompt1:prompt2:prompt3:...:weight1,weight2,weight3,...:mean]

prompt1, prompt2, prompt3 and so on are separate prompts, and each of weight1, weight2, weight3 and so on correspond to one prompt and indicate how important it is. The larger a weight is, the more its prompt contributes to the generation. The weights are always normalized to sum up to 1.

As opposed to prompt interpolation, prompt average does not dynamically change the prompt at each denoising step, the same merged prompt is used for all denoising steps.

Here is an example with prompts p1, p2, p3 weighted as 1, 2, 3:

[p1 : p2 : p3 : 1, 2, 3 : mean]

Corner Cases

  • [a:1:mean] : exactly the same as a
  • [a::mean] : same as above
  • [a:b:1,1:mean] : average between a and b
  • [a:b::mean] : same as above
  • [a:b:c:1,1,1:mean] : average between a, b, c
  • [a:b:c::mean] : same as above
  • [a:b:1,4:mean] : weighted sum between a (weighted as 1/5) and b (weighted as 4/5)
Clone this wiki locally