Skip to content

Fix cross-attention factory dispatch and residual layout - #495

Open
zjn20030811 wants to merge 1 commit into
Stability-AI:mainfrom
zjn20030811:fix/cross-attention-dispatch
Open

Fix cross-attention factory dispatch and residual layout#495
zjn20030811 wants to merge 1 commit into
Stability-AI:mainfrom
zjn20030811:fix/cross-attention-dispatch

Conversation

@zjn20030811

Copy link
Copy Markdown

Summary

make_attn accepts memory-efficient-cross-attn, but the factory compared the built-in type object instead of attn_type, so this option silently selected LinAttnBlock. Correct the dispatch, preserve the original spatial residual in the 4-D wrapper, and copy optional kwargs before adding query_dim.

Validation

  • python -m pytest -q tests/test_attention_factory.py — 2 passed
  • python -m py_compile sgm/modules/diffusionmodules/model.py tests/test_attention_factory.py
  • python -m compileall -q sgm
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant