Comfy-Org / Comfy-Org/ComfyUI

BlockSparseAttention node: execute() missing 1 required positional argument: 'selection'

Open Beginner friendly
#16,236 1 comment 0 reactions 0 assignees View on GitHub
Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

### Custom Node Testing

- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)

### Expected Behavior

The native Block Sparse Attention node (added in PR #16072, comfy_extras/nodes_sparse_attention.py) should execute normally when placed on the MODEL connection and run through a sampler, the same way other model-patch nodes do, producing sparse-attention-accelerated output for a MiniMax H3 video generation workflow.

### Actual Behavior

The node fails immediately when the workflow reaches it, raising:

TypeError: BlockSparseAttention.execute() missing 1 required positional argument: 'selection'

The node's execute() method appears to require a selection argument that is not being supplied by the standard V3 node execution wrapper (EXECUTE_NORMALIZED in comfy_api/latest/_io.py). This suggests either:

the node's INPUT_TYPES/schema does not correctly declare selection as an input (so the wrapper never collects a value for it), or
selection should have a default value in the function signature but does not.

No custom node is involved in the failing node itself — this is the stock core BlockSparseAttention node.

### Steps to Reproduce

Update ComfyUI to the latest version (tested on v0.35.0).
Build/load a MiniMax H3 video generation workflow (e.g. standard MiniMaxH3 T2V/I2V/R2V pipeline with MiniMaxH3 MODEL, VAE, text encoder loaders).
Add the native Block Sparse Attention node (category advanced/model) on the MODEL connection, per the node's documented placement.
Connect it as normal into the sampler pipeline and queue the prompt.
Observe the workflow runs through model loading and an earlier successful pass, then fails at the BlockSparseAttention node with the TypeError above.

Note: In my case the error occurred on a second/upscale pass after a Latent Upscaler (3rd-party) node had already run successfully earlier in the same graph — but the failing node itself (BlockSparseAttention, node ID 398) is native core, not the upscaler.

### Debug Logs

```powershell
2026-09-11T02:56:09.853228 - [MinimaxH3-3D] ✅ Model offloaded to CPU. VRAM released for next node.
2026-09-11T02:56:09.894262 - [ERROR] !!! Exception during processing !!! BlockSparseAttention.execute() missing 1 required positional argument: 'selection'
2026-09-11T02:56:09.895264 - [ERROR] Traceback (most recent call last):
File "D:\AI_Workstation\Data\Packages\ComfyUI\execution.py", line 545, in execute
output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\AI_Workstation\Data\Packages\ComfyUI\execution.py", line 344, in get_output_data
return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\AI_Workstation\Data\Packages\ComfyUI\execution.py", line 318, in _async_map_node_over_list
await process_inputs(input_dict, i)
File "D:\AI_Workstation\Data\Packages\ComfyUI\execution.py", line 306, in process_inputs
result = f(**inputs)
^^^^^^^^^^^
File "D:\AI_Workstation\Data\Packages\ComfyUI\comfy_api\internal\__init__.py", line 149, in wrapped_func
return method(locked_class, **inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\AI_Workstation\Data\Packages\ComfyUI\comfy_api\latest\_io.py", line 2046, in EXECUTE_NORMALIZED
to_return = cls.execute(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: BlockSparseAttention.execute() missing 1 required positional argument: 'selection'

2026-09-11T02:56:09.896265 - [INFO] Prompt executed in 21.46 seconds
```

### Other

ComfyUI Version: 0.35.0
Launch arguments: --preview-method auto --use-pytorch-cross-attention --enable-manager
OS: Windows (win32)
Python: 3.12.11
PyTorch: 2.14.0+cu130
GPU: NVIDIA GeForce RTX 5070 Ti (17,066,033,152 bytes VRAM total)
The Block Sparse Attention node was added in PR #16072 ("comfy-kitchen sparse attention backends"), merged 2026-09-06, and is marked experimental. This may be a very recent regression / incomplete implementation rather than a long-standing bug.
An unrelated ValueError: Unsupported device backend: False from a third-party node (Comfyui_Minimax_h3_latent_Upscaler) also appears earlier in the same session log — this is not part of this bug report and is being reported separately to that node's author, included here only for log completeness.
Workflow JSON: (too large to inline — please attach the .json/.png workflow file directly to the GitHub issue when you submit it.)

Contributor guide

Open the contributing guide

Research direction

Start in comfy_extras/nodes_sparse_attention.py by comparing BlockSparseAttention.execute() with its declared INPUT_TYPES/schema, then trace how EXECUTE_NORMALIZED in comfy_api/latest/_io.py collects arguments. Reproduce with the reported MiniMax H3 workflow and verify that the native node runs through the sampler without the missing-selection TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
ai, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.