mirror of
https://github.com/vladmandic/automatic
synced 2026-09-04 12:00:46 +02:00
fa8bf0b5cd
Only the modular path had a per-forward kwargs hook, so a classic pipeline had no layout and the selector sparsified its whole sequence, prompt conditioning included. A denoiser pre-hook installed per generation now reads whichever convention the model uses: the *_indices tensors, or the txt_ids and img_ids a joint transformer is given. Packing order is not derivable from the call and differs between architectures, so only classes verified to pack text first publish; anything else falls back as before rather than pinning the wrong half of the sequence dense.
9 lines
724 B
Python
9 lines
724 B
Python
"""Block-sparse attention: the selector, the token layout it respects, and the consumers that apply it."""
|
|
from modules.attention.sparse.selector import BlockSelection, SparseSpec, block_count, radial_blocks, schedule, select_blocks
|
|
from modules.attention.sparse.layout import Span, TokenLayout, block_pins, layout_from_index_kwargs, layout_from_kwargs, layout_from_prefix, layout_from_segments, publish_segments, segments_from_live
|
|
|
|
__all__ = [
|
|
'BlockSelection', 'SparseSpec', 'block_count', 'radial_blocks', 'schedule', 'select_blocks',
|
|
'Span', 'TokenLayout', 'block_pins', 'layout_from_index_kwargs', 'layout_from_kwargs', 'layout_from_prefix', 'layout_from_segments', 'publish_segments', 'segments_from_live',
|
|
]
|