SwinIR Batch Processing
Transformer restoration for a whole folder, once you have the right .pth
- images
- restored_images
SwinIR is one of the more respected restoration transformers from the 2021-2022 academic wave, and this node runs it across a whole batch of images with one model loaded once, rather than one at a time. It's a solid choice when you already have the right pretrained weight file - and the operative word there is already have, because unlike NAFNet in this same pack, SwinIR's weights don't auto-download. Skip that step and this node will still run and still produce output; it just won't be doing any real restoration.
What happens when the weights aren't there
The code is honest about it in the console log, even though the node's own output isn't: if it can't find the specific .pth file matching your task and scale combination in the pack's models/ folder, it prints "Model file not found," suggests the correct download URL, and then proceeds anyway with a randomly-initialized SwinIR network. No exception, no failure - just a transformer with no idea what restoration looks like, quietly producing a plausible-but-meaningless result. This is worth internalizing before you judge SwinIR's actual quality on this pack: a bad first impression here is very often a missing file, not the architecture underperforming.
When the weights are present, SwinIR earns its reputation. It applies Swin Transformer's shifted-window attention to restoration, which gives it strong long-range structural awareness compared to a pure-CNN denoiser, at the cost of being noticeably heavier computationally - batch processing multiple images through it is exactly where that cost adds up, which is the reason this dedicated batch node exists rather than just looping the single-image version.
Inputs and outputs that matter
task-classical_sr(standard super-resolution),lightweight_sr(smaller/faster model),real_sr(tuned for real-world degradation rather than synthetic),color_dnorgray_dn(denoising, color or grayscale).scale-1through4, and it directly determines which weight filename the node looks for (e.g. aclassical_srtask at scale4wants001_classicalSR_DF2K_s64w8_SwinIR-M_x4.pth).batch_size(default 2) - how many images process together per pass; raise it if you have VRAM to spare.noise_level(default 15) - only relevant for the denoising tasks; matches the sigma the underlying weight file was trained on (15/25/50 are the standard SwinIR-released levels).
Output: restored_images, the whole processed batch as one IMAGE tensor.
Installing it
Through ComfyUI Manager, search Eric's Image Processing Nodes. By hand:
cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/Eric_Image_Processing_Nodes
cd Eric_Image_Processing_Nodes
pip install -r requirements.txt
Restart ComfyUI. Then, separately, download the specific .pth matching your task/scale/noise_level combination from the official SwinIR releases page and place it in Eric_Image_Processing_Nodes/models/. The pack's Docs/MODEL_WEIGHTS.md lists all twelve official filenames it expects - worth checking before you download the wrong scale factor.
Where people get burned
The recurring one: picking task: classical_sr, scale: 4 because that's the highest-quality option on paper, without realizing that specific weight file (001_classicalSR_DF2K_s64w8_SwinIR-M_x4.pth) is a separate download from the x2 version, and if you only grabbed x2, scale 4 silently falls back to random weights. Match your download exactly to the task-and-scale combination you're asking the node to run, not just "SwinIR weights" in general - there are twelve distinct files and each one only covers one combination.
Second, for genuinely heavy restoration work (badly degraded scans, mixed damage) rather than a specific known noise level, the community's 2026 baseline has shifted to newer generative restorers; SwinIR is still a strong, precise pick for classical or real-world super-resolution at a known task, less so as a general-purpose "fix this old photo" tool.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| task | COMBO | classical_sr | Restoration task for all images |
| scale | COMBO | 2 | Upscaling factor for batch |
| batch_sizeopt | INT | 21–8 | Number of images to process simultaneously |
| noise_levelopt | INT | 150–75 | Noise level for denoising tasks |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| restored_images | IMAGE | — |