Nodes/comfyui-sealedcuda/Sealed Fused-SSIM (CUDA)
ComfyUI Node

Sealed Fused-SSIM (CUDA)

SSIM on the GPU without wrecking your ComfyUI environment

By pollockjj·Created 2 months ago·Updated 2 months ago· 0
Sealed Fused-SSIM (CUDA)
  • image_a
  • image_b
  • ssim

If you've ever A/B-tested an upscaler, compared a denoise sweep, or checked whether an img2img pass actually kept the subject's face, you know the pain: you're eyeballing two images and trying to quantify the difference. Sealed Fused-SSIM (CUDA) hands you that number. Feed it two images, get one FLOAT back - a structural-similarity score computed by a CUDA kernel, no eyeballing required.

SSIM is the classic image quality metric. Where MSE just averages per-pixel error (and gets fooled by a uniform haze), structural similarity looks at local luminance, contrast, and structure, so 1.0 means "these are effectively identical" and lower values mean they've diverged. It's the standard tool for measuring how faithfully an img2img pass or an upscaler preserved the original. This node runs that metric as a fused GPU kernel - fused_ssim.fused_ssim(a, b) from the fused_ssim package - which is fast and, more interestingly, lives in its own sandboxed CUDA environment.

Why "sealed" is the whole point

This is the part that sets this pack apart. Most custom nodes pip-install into your host ComfyUI Python and share its torch. The moment a node pins a torch build that clashes with your ComfyUI version, you get the classic dependency hell: one node works, the next breaks, and you're rebuilding the environment. This pack takes the opposite route - it declares a [tool.comfy.isolation] block and runs as a sealed worker. ComfyUI provisions a separate conda environment with its own torch (2.8.0+cu126), installs the native CUDA wheels into that environment, and shuttles tensors back and forth over an RPC boundary. Your host torch never touches it. Nothing this pack installs can break your main ComfyUI setup.

The trade-off: first run is slow. That isolated environment has to download a full cu126 torch (several gigabytes) plus the wheels, and it needs a recent ComfyUI that actually supports sealed-worker isolation. After that it's just a node.

Inputs and output

There are exactly two inputs, both plain images:

  • image_a (IMAGE)
  • image_b (IMAGE)

That's the whole interface - no weights, no kernel-size sliders, no settings to fiddle with. The node converts both to B,H,W,C float32 on the GPU, transposes to B,C,H,W, and calls the kernel. The single output, ssim (FLOAT), is the mean structural-similarity score across the batch. Wire it into a preview or compare node and it'll happily show you the number; wire it into a workflow that branches on quality thresholds and you can auto-route low-fidelity results back for another pass.

Install

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

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

Then restart ComfyUI and run the node once - that first execution is what provisions the sealed conda environment and pulls the wheels from the cuda-wheels index. You'll want a CUDA GPU with compute capability sm_50 through sm_90 (the cu126 build covers those), and conda available on the machine. No model files to download, no local compiler needed - everything comes prebuilt.

Where people get burned

  • Images must match in resolution. The kernel expects image_a and image_b to be the same spatial size; feed it a 1024px and a 512px version of the same picture and it'll throw a shape error rather than guess. Resize or crop first.
  • You get one scalar, not a map. ssim is a single FLOAT - the batch mean. If you need per-region comparison, that's a job for a different tool.
  • Blackwell GPUs won't run this. The cu126 wheels have no kernels for sm_120 (RTX 50-series), and the node's device picker explicitly skips cards with capability above 9.0. On a Blackwell-only machine you'll hit a kernel-load failure.
  • Your ComfyUI has to speak "sealed worker." If your ComfyUI build predates isolation support, the node won't provision its environment - you'll get an error instead of a silent install.

Honestly, for its niche - fast, reproducible GPU SSIM that can't poison your host environment - it's a tidy little node. It's early-days software from a small pack, so expect rough edges, but the isolation pattern it rides on is exactly where ComfyUI's dependency problem is headed.

Categorysealedcuda

Inputs (2)

NameTypeDefaultDescription
image_aIMAGE
image_bIMAGE

Outputs (1)

NameTypeDescription
ssimFLOAT