Nodes/comfyui-sealedcuda/Sealed NATTEN Filter (CUDA)
ComfyUI Node

Sealed NATTEN Filter (CUDA)

A seeded neighborhood-attention filter that runs in its own CUDA sandbox

By pollockjj·Created 2 months ago·Updated 2 months ago· 0
Sealed NATTEN Filter (CUDA)
  • image
  • IMAGE
embed_dim32
num_heads1
kernel_size7
strength0.80
seed0

Sealed NATTEN Filter (CUDA) takes an image, runs it through neighborhood attention, and hands you back a modified image - same size, same shape, just... filtered. It's one of those nodes you reach for when you want an effect rather than a pipeline stage: a deterministic, seedable GPU filter that changes texture and structure in a way a blur or a sharpen never will.

Let's be upfront about what this is and isn't. NATTEN (Neighborhood Attention Transformer) is a real architecture - it's the attention mechanism from DiNAT and friends, and it's notorious for being a pain to install on Windows because it usually has to be compiled from source. This pack ships it as a prebuilt cu126 wheel, which is the nicest thing about it. But the filter itself isn't a trained model: the node builds random projection layers, seeds them, runs your image through, and adds the result back as a residual. So think of it as an experimental texture/structure effect - reproducible per seed, but not "learned" - rather than as a production denoiser.

How it works

The mechanism, straight from the node source: your image is moved to the GPU as B,H,W,C float32, then projected into a small embedding space with a Linear layer. A natten.NeighborhoodAttention2D block processes it - attention over a local kernel_size × kernel_size window instead of the whole image, which is the whole point of neighborhood attention (it stays cheap on big images). A second Linear projects back to your original channel count, and the delta is added to the input scaled by strength, clamped to [0,1]. torch.manual_seed(seed) is called up front, so the same seed gives you the same filter every time.

The inputs that matter

The full set is image, embed_dim, num_heads, kernel_size, strength, and seed. You'll actually touch three of them:

  • strength (float, default 0.8) - how much of the attention delta gets added. 0 means the output is identical to the input. This is your "how much effect" dial.
  • seed (int, default 0) - the whole filter is deterministic per seed. Find a texture you like and it'll reproduce exactly; change the seed and you get a different one.
  • kernel_size (int, default 7, odd values 3–31) - the neighborhood window. Bigger window = attention over a wider area, which changes the character of the effect.

embed_dim (default 32) and num_heads (default 1) are there if you want to poke at the architecture, but the README has a hard constraint worth remembering: NATTEN's attention backends need a per-head dimension of at least 16, so keep embed_dim / num_heads >= 16 or the kernel will refuse to run.

The output is a single IMAGE, same resolution as the input - preview it, save it, or feed it straight into an img2img chain as the source.

Install

ComfyUI Manager is the easy path - search "comfyui-sealedcuda" (or "SealedCuda") and install, then restart. Manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/pollockjj/ComfyUI-SealedCuda

Then restart and run the node once. This pack is a sealed worker: it provisions its own conda environment with its own torch (2.8.0+cu126) plus the NATTEN wheel from the cuda-wheels index, completely decoupled from your host ComfyUI torch. That's the clever bit - this is a CUDA-heavy node that cannot break your main environment, which is a refreshing change from the usual dependency-hell roulette of custom node installs. The catch is that first run downloads a full cu126 torch into the sealed env (several gigabytes), so budget some time and network. No model files, no compiler needed.

Gotchas

  • Your ComfyUI needs sealed-worker support. If your ComfyUI predates isolation, this node won't provision - it'll error rather than fall back to a normal install.
  • You need a cu126-compatible GPU - compute capability sm_50 through sm_90. Blackwell (RTX 50-series, sm_120) is explicitly skipped by the node's device picker because the cu126 wheels have no kernels for it.
  • Conda must be available - the sealed environment is provisioned with conda (Python 3.12).

Is this the one you'd reach for in a serious workflow? For most people, no - it's a niche, demo-flavored filter from a 0.1.0 pack. But if you want a reproducible attention-based texture effect, or you just want to see ComfyUI's isolation machinery do real CUDA work without touching your host setup, it's worth a play.

Categorysealedcuda

Inputs (6)

NameTypeDefaultDescription
imageIMAGE
embed_dimINT328–256
num_headsINT11–16
kernel_sizeINT73–31
strengthFLOAT0.800–4
seedINT00–4294967295

Outputs (1)

NameTypeDescription
IMAGEIMAGE