From 01b4800fce7f63fc5a7740fc0406fe1a7e79996e Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Wed, 25 Feb 2026 16:21:11 +0100 Subject: [PATCH] fix: resolve overlapping group bounding boxes and add README Group 4/5 and Group 1/2 bounding boxes overlapped, causing nodes to appear in multiple groups. Muting the Seam Fix group would have also muted Pass 1 output nodes. Repositioned GenerateSeamMask node and adjusted all group boundaries to eliminate overlaps. Co-Authored-By: Claude Opus 4.6 --- README.md | 54 +++++++++++++++++++ .../tiled-upscale-builtin-nodes.json | 8 +-- 2 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..0141032 --- /dev/null +++ b/README.md @@ -0,0 +1,54 @@ +# ComfyUI_UltimateSGUpscale + +Tiled upscaling for ComfyUI using built-in nodes. Replicates the core features of [UltimateSDUpscale](https://github.com/ssitu/ComfyUI_UltimateSDUpscale) as a transparent workflow you can inspect and modify. + +## Requirements + +- ComfyUI with `SplitImageToTileList` and `ImageMergeTileList` nodes (added in [PR #12599](https://github.com/comfyanonymous/ComfyUI/pull/12599)) + +## Installation + +Clone into your ComfyUI `custom_nodes` directory: + +```bash +cd ComfyUI/custom_nodes +git clone https://github.com/ethanfel/ComfyUI_UltimateSGUpscale.git +``` + +This installs one custom node (`Generate Seam Mask`) and provides an example workflow. + +## What's Included + +### Example Workflow + +`example_workflows/tiled-upscale-builtin-nodes.json` — a two-pass tiled upscaling workflow: + +**Pass 1 — Tiled Redraw:** Upscales the image with a model (e.g. 4x-UltraSharp), splits it into overlapping tiles, runs each tile through KSampler, then merges them back with sine-based blending. + +**Pass 2 — Seam Fix (optional):** Generates a mask targeting only the seam regions between tiles, then runs a second tiled denoise pass restricted to those seam bands via `SetLatentNoiseMask`. Mute or bypass the "Seam Fix" group to skip this pass. + +### Generate Seam Mask Node + +A small helper node that creates a binary mask image with white bands at tile seam positions. It replicates `SplitImageToTileList`'s tiling logic to place bands at the exact center of each overlap region. + +**Inputs:** +| Parameter | Default | Description | +|-----------|---------|-------------| +| image_width | 2048 | Image width (connect from GetImageSize) | +| image_height | 2048 | Image height (connect from GetImageSize) | +| tile_width | 1024 | Tile width matching Pass 1 | +| tile_height | 1024 | Tile height matching Pass 1 | +| overlap | 128 | Overlap matching Pass 1 | +| seam_width | 64 | Width of seam bands in pixels | + +**Output:** `IMAGE` — a mask with white bands at seam positions, black elsewhere. + +## How It Works + +The workflow chains standard ComfyUI nodes together. `SplitImageToTileList` outputs a list, and ComfyUI's auto-iteration runs all downstream nodes (VAEEncode, KSampler, VAEDecode) once per tile automatically. Scalar inputs (model, conditioning, VAE) are reused across tiles. `ImageMergeTileList` reassembles tiles using sine-weighted blending for smooth overlap transitions. + +The seam fix pass uses `SetLatentNoiseMask` to restrict denoising to only the masked seam regions, leaving the rest of the image untouched. + +## License + +MIT diff --git a/example_workflows/tiled-upscale-builtin-nodes.json b/example_workflows/tiled-upscale-builtin-nodes.json index 04c0446..a7a4d3d 100644 --- a/example_workflows/tiled-upscale-builtin-nodes.json +++ b/example_workflows/tiled-upscale-builtin-nodes.json @@ -235,7 +235,7 @@ { "id": 13, "type": "GenerateSeamMask", - "pos": [2040, 500], + "pos": [2370, 650], "size": [250, 170], "flags": {}, "order": 12, @@ -453,7 +453,7 @@ { "id": 1, "title": "Load Models", - "bounding": [40, 130, 345, 400], + "bounding": [40, 130, 345, 190], "color": "#3f789e", "font_size": 24, "flags": {} @@ -477,7 +477,7 @@ { "id": 4, "title": "Pass 1: Tiled Redraw", - "bounding": [1150, 130, 970, 730], + "bounding": [1150, 130, 1200, 730], "color": "#3a7e3a", "font_size": 24, "flags": {} @@ -485,7 +485,7 @@ { "id": 5, "title": "Pass 2: Seam Fix (bypass/mute to skip)", - "bounding": [2030, 130, 1800, 600], + "bounding": [2360, 130, 1470, 710], "color": "#7e3a3a", "font_size": 24, "flags": {}