* Support for the cyclical sampler ("@").

* Support for attention merging wheen sending to negative prompt.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Antonio Cordero Balcazar
2026-05-02 17:18:44 +02:00
co-authored by Copilot
parent 8e38265b04
commit 0970afb018
10 changed files with 303 additions and 147 deletions
+2 -9
View File
@@ -266,7 +266,7 @@ You can also specify a weight multiplier directly in the command - if both the c
## Send-to-negative with attention modifiers
When a send-to-negative command sits inside an attention modifier, the weight is carried over to the negative prompt. There is one important distinction:
When a send-to-negative command sits inside an attention modifier, the weight is carried over to the negative prompt.
```text
(red apple<ppp:stn>round shape<ppp:/stn>:1.4)
@@ -276,17 +276,10 @@ Result in the negative: `(round shape:1.4)` - the surrounding weight is applied.
```text
(red apple<ppp:stn>[round shape]<ppp:/stn>:1.4)
```
Result in the negative: `([round shape]:1.4)` - the weight is **not** merged into the inner brackets, because the content of the negative tag is copied as-is and the merge happens before the tag is processed.
```text
(red [apple<ppp:stn>round shape<ppp:/stn>]:1.4)
```
Result in the negative: `(round shape:1.26)` - if merge attention is enabled, `1.4 × 0.9 = 1.26` is applied.
Keep this in mind when writing choices in wildcards that combine attention brackets with send-to-negative.
For both cases, the result in the negative is: `(round shape:1.26)` - the weight is merged, if merge attention is enabled.
## Array variables
+2 -2
View File
@@ -37,7 +37,7 @@ There is also a format where instead of `parameters$$` you just put the sampler,
The construct parameters can be written with the following options (all are optional):
* "**~**" or "**@**": sampler (for compatibility with *Dynamic Prompts*), but only "**~**" (random) is supported.
* "**~**" (random) or "**@**" (cyclical): sampler (for compatibility with *Dynamic Prompts*). The cyclical sampler cycles through all combinations in order across consecutive `process_prompt` calls, resuming where the previous call left off (as long as the input prompt and negative prompt do not change).
* "**r**": means it allows repetition of the choices.
* "**o**": means it is "optional", and no error will be raised if there are no choices to select from.
* "**n**" or "**n-m**" or "**n-**" or "**-m**": number or range of choices to select. Allows zero as the start of a range. Default is 1.
@@ -471,7 +471,7 @@ They will be translated to the negative prompt. For example:
* `(red<ppp:stn>square<ppp:/stn>:1.5)` will end up as `(square:1.5)` in the negative prompt
* `(red[<ppp:stn>square<ppp:/stn>]:1.5)` will end up as `(square:1.35)` in the negative prompt (weight=1.5*0.9) if the merge attention option is enabled or `([square]:1.5)` otherwise.
* However `(red<ppp:stn>[square]<ppp:/stn>:1.5)` will end up as `([square]:1.5)` in the negative prompt. The content of the negative tag is copied as is, and is not merged with the surrounding modifier because the insertions happen after the attention merging.
* `(red<ppp:stn>[square]<ppp:/stn>:1.5)` will also end up as `(square:1.35)` in the negative prompt if the merge attention option is enabled, because the content of the negative tag is a single attention construct whose weight is merged with the surrounding modifier.
### Prompt editing constructs (alternation and scheduling)