Nodes/ComfyUI-988/DaC Algorithm 988
ComfyUI Node

DaC Algorithm 988

The planner that makes giant upscales fit in your VRAM

By kajan988·Created 3 months ago·Updated about a month ago· 1
DaC Algorithm 988
  • image
  • upscale_model
  • image
  • dac_data
  • info
tile_width1024
tile_height1024
min_overlap3%
min_scale_factor3.00
tile_orderspiral
scaling_methodlanczos
use_upscale_with_modeltrue

You want a 4K image but your card has 6GB. The community answer - from Ultimate SD Upscale through tile-ControlNet workflows, and the whole lineage the KB's upscaling essay maps - is "don't do it in one pass, tile it." DaC Algorithm 988 is the node that does the planning half: it works out exactly how many tiles, at what overlap, at what upscale factor, and then hands you a ready-to-cut image plus the geometry every downstream node needs.

"DaC" is Divide and Conquer, and the pipeline is a chain: DaC Algorithm 988 plans → Divide Image Select 988 cuts → you process each tile (img2img, an upscaler, ControlNet-tile, whatever) → Combine Tiles 988 stitches. This node is the brain; the rest are hands.

How it works

The algorithm takes your source image, your target tile size, a minimum overlap percentage, and a minimum scale factor, then solves the geometry backwards: it figures out the smallest whole grid of tiles (with the required overlap subtracted) that upscales every part of the image to at least the scale you asked for, and pre-upscales the image to exactly those dimensions using the selected scaling_method (lanczos default - the "more pixels, can't invent detail" path, per the KB). The result is that every tile lands exactly on the grid, overlap included, so the combine step has clean geometry to work with.

The inputs that matter

Most are set-and-forget once your workflow is working:

  • tile_width / tile_height (default 1024) - how big each processed tile is. This is your VRAM knob: smaller tiles fit smaller cards, but need more of them and more overlap.
  • min_overlap (default 3%) - the minimum overlap between tiles. Too little and seams show after combining; too much and you re-process a lot of redundant area. The 3–10% band is where people live.
  • min_scale_factor (default 3) - how much bigger than the source you want the final image. This is the "target" - crank it for a real upscale, keep it low for a gentle resize.
  • tile_order - linear (row by row) or spiral (outward from center, like an old printer). If you process tiles in a batch loop, this decides the order you get them back; pick whichever matches your downstream.
  • scaling_method - the interpolation for the pre-upscale (nearest, bilinear, area, bicubic, lanczos). Lanczos is the default and the right call for "more pixels."

Optional: upscale_model with use_upscale_with_model - if you feed an UPSCALE_MODEL and leave the toggle on, the pre-upscale is done by that model (an ESRGAN-class upscaler) instead of plain interpolation, which is the "cheap rung" of upscaling the KB says is still the right tool when the source is already sharp.

Outputs

  • image - the upscaled image at optimal tiling dimensions, ready for Divide Image Select.
  • dac_data - the serialized geometry dict (dimensions, tile size, overlap, grid, order). This is the contract the rest of the pipeline runs on: wire it to Divide Image Select and Combine Tiles.
  • info - a text summary of everything it calculated. Good first run, when you want to confirm the grid isn't 40 tiles.

Troubleshooting

  • The image isn't as big as I wanted: bump min_scale_factor. The algorithm hits at least your scale; it may overshoot slightly to make the grid work out.
  • Seams later: min_overlap too low for the blend to hide; raise it.
  • It's an output node - it shows its info on the graph, so if you don't see it in the node list, restart ComfyUI after installing.

Install

Part of the ComfyUI-988 pack. ComfyUI Manager (search "ComfyUI-988") or:

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

Then restart. No models to download - the pack itself is just code; the upscaler you feed it is your own.

Category🦇988/Image

Inputs (9)

NameTypeDefaultDescription
imageIMAGE
tile_widthINT102464–8192
tile_heightINT102464–8192
min_overlapCOMBO3%13 options: 0%, 1%, 2%, 3%, 5%, 8%, +7
min_scale_factorFLOAT3.001–8
tile_orderCOMBOspiral2 options: linear, spiral
scaling_methodCOMBOlanczos5 options: nearest-exact, bilinear, area, bicubic, lanczos
upscale_modeloptUPSCALE_MODEL
use_upscale_with_modeloptBOOLEANtrue

Outputs (3)

NameTypeDescription
imageIMAGEUpscaled image at optimal tiling dimensions
dac_dataDAC_DATASerialized tile data for downstream nodes
infoSTRINGSummary of all calculated parameters