How moonwhaler/comfyui-seedvr2-tilingupscaler works
1. This repository is a ComfyUI custom node package for single-image upscaling. Its core job is not to implement a model, but to orchestrate SeedVR2 inference over tiled image regions so large images can be processed with lower VRAM.
2. The architectural boundary is clear: SeedVR2 lives outside this repo. The code here depends on the separate ComfyUI-SeedVR2_VideoUpscaler node pack for model execution, model discovery, and optional advanced controls like extra_args and block_swap_config.
3. The main runtime entrypoint is likely upscaler.py, which acts as the ComfyUI node implementation. It receives the input image and user parameters, coordinates tiling/upscaling/stitching, and returns the final image to ComfyUI.
4. seedvr2_adapter.py is the integration layer between this node and the external SeedVR2 ecosystem. It likely handles model selection, compatibility across stable vs nightly SeedVR2 builds, and passing through advanced options without this repo needing to know the model internals.
5. tiling.py defines the spatial partitioning subsystem. The image is split into overlapping tiles using either linear or chess-like traversal, with tile size and padding controlling the tradeoff between VRAM usage, throughput, and seam quality.
6. The per-tile processing flow is the heart of the system:
- input image
- tile extraction with overlap
- SeedVR2 upscale on each tile
- resize each tile to its intended final scale
- merge all tiles back into one output image
This is the main data path an architecture diagram should show.
7. stitching.py is the blend/composition subsystem. It resolves overlaps between adjacent upscaled tiles using multiple strategies: simple averaging, linear alpha blending, bilateral/edge-preserving smoothing, content-aware blending, and multiband Laplacian pyramid blending. This is the main quality-preserving boundary in the design.
8. image_utils.py likely contains shared image conversion and geometric helpers: resizing, padding, normalization, color/channel handling, and conversions between Pillow, NumPy, and torch-friendly formats. These utilities sit beneath both tiling and stitching.
9. progress.py is a small user-feedback layer for ComfyUI progress reporting. The README notes the progress bar can show “???” during work, so this module likely wraps progress updates around long-running tile processing and external model calls.
10. The workflows/ directory contains ComfyUI JSON workflow examples, not runtime code. These documents show how this node is composed with standard SeedVR2 nodes, and in the advanced case, with additional ComfyUI ecosystem nodes for pre-downscaling, noise injection, and resolution control.
11. The README also implies an important architectural variant: a basic mode that uses only this node, and an advanced mode that accepts optional SeedVR2-side inputs (extra_args, block_swap_config). That makes the node modular: it can operate standalone or participate in a larger SeedVR2 VRAM-management pipeline.
12. Overall, the repo is a single-purpose orchestration package built around memory-efficient image upscaling. The key diagram should emphasize the external model dependency, the tile-processing loop, and the final stitching stage as the three major subsystems.
Main entry points: upscaler.py Upscaler · seedvr2-tiled-upscale_advanced_comfyui_workflow.json Advanced workflow · seedvr2_adapter.py SeedVR2 adapter · examples Examples
Components 13
Runtime core
The ComfyUI node and its tiled upscaling pipeline
- ComfyUI · The surrounding ComfyUI environment that loads and runs the custom node
- Upscaler · Main custom node implementation that orchestrates tiled single-image upscaling
upscaler.py - SeedVR2 adapter · Bridges this package to external SeedVR2 variants and advanced runtime options
seedvr2_adapter.py - Tiling · Splits the input image into overlapping tiles and controls traversal and padding
tiling.py - Stitching · Merges upscaled tiles and resolves seams with blending strategies
stitching.py - Image utils · Common image conversion, resizing, padding, and geometry helpers
image_utils.py - Progress · Progress reporting for long tile-processing and inference runs
progress.py - Package init · Package registration and import surface for the custom node
__init__.py
External dependency
SeedVR2 execution and model management live in a separate node pack
- SeedVR2 pack · Separate ComfyUI node package that provides SeedVR2 model execution and model discovery
- SeedVR2 model · The actual upscaling model and inference runtime used outside this repository
Examples
ComfyUI workflow examples showing how the node is used
- Simple workflow · Basic ComfyUI workflow showing tiled upscaling with this node
workflows/seedvr2-tiled-upscale_simple_comfyui_workflow.json - Advanced workflow · Workflow variant that includes extra controls and broader SeedVR2 integration
workflows/seedvr2-tiled-upscale_advanced_comfyui_workflow.json - Examples · Additional example material referenced by the repository
examples
Connections 15
- Package init → Upscaler: registers · Exposes the custom node to ComfyUI
- ComfyUI → Upscaler: invokes · ComfyUI executes the node during a workflow run
- Upscaler → Tiling: splits · Partitions the input image into tiles before inference
- Upscaler → SeedVR2 adapter: delegates · Hands tile inference requests to the SeedVR2 integration layer
- Upscaler → Stitching: merges · Combines per-tile outputs into the final image
- Upscaler → Progress: reports · Updates user-facing progress during long runs
- Tiling → Image utils: uses · Relies on shared image geometry and conversion helpers
- Stitching → Image utils: uses · Uses common resize and pixel-space helpers for composition
- SeedVR2 adapter → SeedVR2 pack: calls · Integrates with the external SeedVR2 node pack for model execution
- SeedVR2 pack → SeedVR2 model: loads · The external pack discovers and runs the underlying SeedVR2 model
- Simple workflow → Upscaler: demonstrates · Shows the basic standalone usage pattern
- Advanced workflow → Upscaler: demonstrates · Shows the advanced usage pattern with extra controls
- Advanced workflow → SeedVR2 adapter: passes options · Illustrates optional advanced SeedVR2 arguments flowing through the adapter
- Examples → Simple workflow: contains · Example assets group the workflow samples
- Examples → Advanced workflow: contains · Example assets group the workflow samples