Nodes/ComfyUI-Apt_Preset/chx_ksampler_tile
ComfyUI Node

chx_ksampler_tile

Tiled upscaling for output sizes your VRAM couldn't otherwise touch

By cardenluo·Created 2 years ago·Updated 22 days ago· 309
chx_ksampler_tile
  • context
  • image_optional
  • output_image
model_nameRealESRGAN_x2.pth
upscale_by2.0
seed0
denoise_image0.25
tile_size512
image_outputPreview

chx_Ksampler_refine handles the "generate at native res, then do a light second pass" hi-res fix. chx_ksampler_tile is for the next problem up: you want genuinely large output - print-size, 4K-plus - and running the whole thing through a sampler at once would blow your VRAM budget. This node splits the image into overlapping tiles, samples each one, and blends them together, the same pattern behind tools like Ultimate SD Upscale and Tiled Diffusion.

Why tiling instead of just upscaling bigger

Sampling an entire large image in one pass scales VRAM use with total pixel count, which caps out fast on consumer cards. Tiled diffusion sidesteps that by processing overlapping chunks independently - each tile only needs enough VRAM for its own size, not the whole canvas - and stitching the results back together, with the overlap and a matching upscale reference keeping tiles from diverging into visibly different styles at their seams. It's a genuinely reliable way to hit arbitrary output sizes on limited hardware, and it's one of the more battle-tested upscaling patterns in the wider ecosystem for exactly that reason.

The inputs and outputs that matter

  • context and seed - required, standard.
  • model_name (default RealESRGAN_x2.pth) - the upscale model used before tiled sampling. Unlike chx_Ksampler_refine's default (a 1x restoration model), this one defaults to an actual magnifying ESRGAN model, which fits the node's purpose better - you're going for real size increase here, not just detail cleanup.
  • upscale_by (default 2, range 0.1–10) - the target scale factor.
  • tile_size (default 512, range 256–4096) - how big each tile is before sampling. Smaller tiles use less VRAM per pass but need more of them (slower, and more seams to blend); larger tiles are faster overall if your card can take them but bring back some of the VRAM pressure you're tiling to avoid. 512 is a reasonable starting point for most consumer GPUs.
  • denoise_image (default 0.25) - the per-tile sampling strength. Kept low by design, similar to a refine pass - you're adding coherent detail at the higher resolution, not regenerating each tile from scratch, which would produce visible tile boundaries.
  • image_output - the standard None/Hide/Preview/Save/Hide/Save enum.
  • Optional image_optional - feed a specific image in explicitly rather than relying on whatever's already in context.

Output: a single output_image port - note this node's output isn't named image like most of the pack's other samplers, worth knowing if you're wiring by name rather than by dragging the connection.

Installing it

Through ComfyUI Manager: search ComfyUI-Apt_Preset, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git

then install.bat on Windows for dependencies, restart. Needs an actual .pth upscale model (RealESRGAN or similar) in models/upscale_models - the default filename is just a name until you've downloaded a matching model file.

Common issues

Visible seams between tiles. This is the classic tiled-upscale failure mode across every implementation of the technique, not specific to this node - it happens when tiles diverge enough during sampling that the blend can't hide the boundary. Lower denoise_image if seams are showing; the whole point of a low per-tile denoise is to keep each tile close enough to its upscaled source that neighboring tiles stay coherent with each other.

Running slow. Smaller tile_size means more tiles and more total sampling passes - if speed matters more than VRAM headroom on your setup, push tile_size up rather than down, within what your GPU can actually handle per tile.

Out of memory anyway. Drop tile_size first before touching upscale_by - the tile size, not the final output size, is what determines per-pass VRAM use. A 4x output at a small tile size still fits on modest hardware; the same 4x output sampled in one shot would not.

Output looks over-processed or plasticky. denoise_image too high for a tiled refine. This isn't meant to be a strong regeneration pass - pull it back toward 0.15–0.25 if detail is coming out looking synthetic rather than like a sharper version of the source.

CategoryApt_Preset/chx_ksample/ksample

Inputs (8)

NameTypeDefaultDescription
contextRUN_CONTEXT
model_nameCOMBORealESRGAN_x2.pth0 options:
upscale_byFLOAT2.00.1–10
seedINT00–18446744073709550000
denoise_imageFLOAT0.250–1
tile_sizeINT512256–4096
image_outputCOMBOPreview5 options: None, Hide, Preview, Save, Hide/Save
image_optionaloptIMAGE

Outputs (1)

NameTypeDescription
output_imageIMAGE