Nodes/ComfyUI-SwinIR/SwinIR Upscale/Denoise
ComfyUI Node

SwinIR Upscale/Denoise

The half of this pack that actually does the work

By alexcong·Created 8 months ago·Updated 7 months ago· 4
SwinIR Upscale/Denoise
  • swinir_model
  • images
  • IMAGE
tile_size512
overlap32

This is the node that makes the pack worth having. The loader just builds the model - SwinIRRun is where your image actually gets upscaled or denoised, and it's the only thing you'll touch twice after you've got a workflow running.

SwinIR is a 2021 transformer for image restoration (super-resolution and denoising), and this is a faithful port of it. Where does it sit in the modern upscaling ladder? On the deterministic rung. It's a "more pixels and cleaner pixels" tool, not a "the model invents a face" tool. SeedVR2 and SUPIR will hallucinate plausible detail on a soft image; SwinIR classical SR won't - it reconstructs toward what the model learned, fast and predictably, on modest VRAM. That makes it the right call when you want a clean upscale without risking the source being rewritten, and its denoising mode covers a job (fixing noisy JPEG-ish sources) that the generative upscalers barely touch.

How it works

You feed it a SWINIR_MODEL from SwinIR Model Loader plus an IMAGE, and it runs a forward pass. Nothing exotic under the hood: the tensor goes to the GPU, gets transposed to channel-first, and if the image fits in one tile_size chunk it processes it whole. Anything bigger gets tiled - the node chops the image into overlapping patches, runs each through the model, and averages the overlapping regions with a weighted blend so the seams mostly disappear. Output is clamped to 0–1 and the model is shoved back to CPU afterwards to free your VRAM. It'll also churn through a whole batch of images in one go if that's what you feed it.

Inputs and outputs

Only four inputs, and only two you'll normally touch:

  • swinir_model - the model from the Loader. Non-negotiable.
  • images - any IMAGE: a VAE-decoded latent, a Load Image node, whatever.
  • tile_size (default 512) - the sweet spot. Bigger tiles mean fewer blend seams and slightly better quality, but more VRAM. If you OOM, this is the first knob you pull, down to 64.
  • overlap (default 32) - how much adjacent tiles overlap so the blend has something to work with. Drop it to 0 and you'll see visible tile boundaries on high-contrast images. Leave it alone unless you have a reason.

Output is a single IMAGE - same batch size as the input - which you wire straight into a Save Image node or on into a detail pass. The node isn't an output node itself, so don't forget the save.

Install

Via ComfyUI Manager, search "ComfyUI-SwinIR". Or the manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/alexcong/ComfyUI-SwinIR.git
cd ComfyUI-SwinIR
pip install -r requirements.txt

The requirements are just timm, numpy, and torch - timm is the only notable one, and it's needed for the SwinIR architecture. You also need the actual model files (see the loader's page) dropped into ComfyUI/models/upscale_models/. Restart ComfyUI after installing.

Common issues

The classic failure mode here isn't in this node at all - it's a Loader config that doesn't match the model file, which produces soft or garbage output that looks like a run problem. Get the loader right first. Beyond that: OOM on a big image → lower tile_size. Visible seams → raise overlap. And if you're using a denoising model, make sure the loader's upscale is 1 - SwinIR denoising doesn't upscale, and it'll warn you about that in the console if you set it wrong. Tiled output can show slightly softer patches at blend boundaries on a demanding image, but at the default 512/32 you generally won't notice.

CategorySwinIR

Inputs (4)

NameTypeDefaultDescription
swinir_modelSWINIR_MODEL
imagesIMAGE
tile_sizeINT51264–4096
overlapINT320–128

Outputs (1)

NameTypeDescription
IMAGEIMAGE