After 493b81e (#10591) swapped the argument order of `merge_nested_dicts`,
the merge call in `_calc_cond_batch` ended up assembling list-valued patch
keys (e.g. `attn2_patch`) as `[hook_patches, model_patches]` instead of
`[model_patches, hook_patches]`. This breaks combinations where a hook
needs to run *after* a model-level attention patch — for example NegPip
(model patch via `set_model_attn2_patch`) + AttentionCouple (registered
as a `TransformerOptionsHook` by asagi4/comfyui-prompt-control). With
the wrong order, couple's masked-attention math runs on un-NegPip'd
values and per-region weighting is washed out.
Fix: swap the merge args so model's `transformer_options` is dict1 and
the hook-derived dict is dict2. This restores `attn2_patch =
[model_patches, hook_patches]`. `copy_dict1=True` is required because
dict1 is now a reference to persistent model state.
Reported and root-caused in asagi4/comfyui-prompt-control#135. Patch
authored and locally tested by @asagi4 in that thread.
Co-authored-by: Booyaka101 <cbosch101@gmail.com>
2026-05-02 16:28:11 +08:00
7 changed files with 83 additions and 30 deletions
tone_instructions:"Only comment on issues introduced by this PR's changes. Do not flag pre-existing problems in moved, re-indented, or reformatted code."
reviews:
profile:"chill"
request_changes_workflow:false
profile:"assertive"
request_changes_workflow:true
high_level_summary:false
poem:false
review_status:false
review_details:false
review_details:true
commit_status:true
collapse_walkthrough:true
changed_files_summary:false
@ -39,6 +39,14 @@ reviews:
- path:"**"
instructions:|
IMPORTANT:Only comment on issues directly introduced by this PR's code changes.
Treat AGENTS.md as mandatory repository policy, not optional style guidance.
Flag PR changes that violate AGENTS.md even when the code is otherwise functional.
In particular, enforce architecture boundaries, dtype/device/memory rules,
interface contracts, import style, no unnecessary try/except blocks, no inline
imports, no outbound internet paths in core ComfyUI, and narrow scoped fixes.
Prefer direct findings over suggestions when a rule is violated. Only ignore
AGENTS.md when it clearly conflicts with a newer explicit maintainer instruction
in the PR.
Do NOT flag pre-existing issues in code that was merely moved, re-indented,
de-indented, or reformatted without logic changes. If code appears in the diff
only due to whitespace or structural reformatting (e.g., removing a `with:` block),
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.