Nodes/Tiled Image Generator for ComfyUI/Adaptive Tiled Image Detailer
ComfyUI Node

Adaptive Tiled Image Detailer

The detailer that decides its own denoise, tile by tile

By rickyars·Created about a year ago·Updated 29 days ago· 3
Adaptive Tiled Image Detailer
  • model
  • upscaled_latent
  • positive
  • negative
  • refined_latent
  • denoise_map
  • scoring_map
seed0
steps20
cfg7.0
sampler_name
scheduler
scoring_methodotsu_threshold
denoise_min0.05
denoise_max0.35
curve1.50
tile_size1024
overlap64
noise_typegaussian
eta_min0.00
eta_max1.00
split_percentile0.60

Upscaling a big image and running one denoise strength across the whole thing is usually a compromise: low enough to not wreck the sharp parts, high enough to actually add detail to the soft parts. LLMAdaptiveTileDetailer removes the compromise. It splits your upscaled latent into tiles, measures each one before sampling, and gives every tile its own denoise strength - soft regions get heavy refinement, already-sharp regions barely get touched.

This is the thing native TiledDiffusion structurally can't do. TiledDiffusion blends noise predictions every step inside one continuous sampling pass, so denoise is uniform across the canvas. This node exists for varying denoise by region, and that's its whole reason to be. Wire it where you'd put a KSampler on an upscaled latent; out the other end comes a refined latent plus two debug images.

How it works

Two passes. Pass 1 computes the tile grid once: tiles advance by tile_size − overlap, the last tile in each axis clamps to the canvas edge, and tiles are feather-blended with a smoothstep curve. Every pixel of the canvas always gets diffused - there's no pad/crop edge handling, and the output keeps the input size. Each tile gets an absolute score on a [0, 1] scale, pushed through the curve exponent, and scaled into [denoise_min, denoise_max]. The score is then blended 70/30 with its 4-connected neighbors' average, which stops abrupt denoise jumps between adjacent tiles. Pass 2 runs the standard sampling loop with each tile's computed denoise.

The scores being absolute is what makes it batch-safe: a uniformly soft image sits near denoise_min everywhere instead of having its least-soft tile promoted to denoise_max. Earlier versions min-max normalized within each image, stretching every image to denoise_max somewhere; that's gone.

Which scoring method

  • otsu_threshold (default) - averages latent channels, computes a global Otsu threshold, scores by fraction of above-threshold pixels. Works when the image has a clear bimodal intensity split. Caveat: it measures subject coverage, not sharpness - a soft image with a bright subject still scores high.
  • quadtree_density - subdivides cells while their mean structure energy exceeds split_threshold (default 0.8), down to a 4-latent-pixel floor, and scores by leaf density. The scoring map shows the quadtree cell outlines.
  • structure_energy - scores by mean gradient energy of the 4×-downsampled latent directly. Widest, most linear spread of the three; the recommended default for batch processing.

Why downsampled? Raw VAE latents carry a high-frequency carrier regardless of content (measured on the Z-Image VAE: ~2.2 gradient energy for soft regions vs ~2.5 for detailed ones). Downsampling averages the carrier away and leaves actual structure, which separates soft from detailed by roughly 3×.

The inputs that matter

model, upscaled_latent, positive/negative conditioning, seed, steps, cfg, sampler_name, scheduler - all standard KSampler stuff. Then the detailer knobs:

  • denoise_min / denoise_max (0.05 / 0.35) - floor and ceiling. A zero-score tile gets denoise_min, which at near-zero effectively freezes it. Soft images may never reach denoise_max; that's the point.
  • curve (1.5) - think of it as a contrast control for the denoise distribution, not a strength knob. Endpoints are fixed: score 0 always maps to denoise_min, score 1 always to denoise_max. Above 1.0, only the highest-scoring tiles climb toward denoise_max; below 1.0, most tiles get boosted up.
  • tile_size (1024) and overlap (64).
  • noise_type - gaussian is the only built-in. The others (like brownian, a good first try for portraits and fabric) require the RES4LYF pack installed.
  • eta_min / eta_max - only matter for ancestral/SDE samplers (euler_ancestral, dpmpp_sde, dpmpp_2s_ancestral, dpmpp_2m_sde, dpmpp_3m_sde, rk_beta). eta_min of 0 means a deterministic ODE for the lowest-denoise tiles; it scales linearly to eta_max at the top.

Outputs: refined_latent (VAE-decode this), denoise_map (a viridis heatmap of per-tile denoise - purple is low, yellow is high), and scoring_map (debug view of the active method). The maps are genuinely useful for diagnosing a bad result: if the denoise map comes back all purple, your denoise_max is doing nothing.

Gotchas

The node only handles single-frame latents - a 5D video latent with T > 1 raises an error (single-frame video latents are fine; the temporal axis gets squeezed and restored). The RES4LYF dependency only matters if you want non-gaussian noise; without the pack, gaussian is the fallback. Install is the same one-line clone as the rest of the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/rickyars/comfyui-llm-tile.git

Restart ComfyUI. For a first run, leave scoring_method on otsu_threshold, wire both debug maps into previews, and let the heatmap tell you whether the adaptivity is buying anything before you tune curve.

Categoryimage/generation

Inputs (19)

NameTypeDefaultDescription
modelMODEL
upscaled_latentLATENT
positiveCONDITIONING
negativeCONDITIONING
seedINT00–18446744073709550000
stepsINT201–100
cfgFLOAT7.01–20
sampler_nameCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
scoring_methodCOMBOotsu_threshold3 options: otsu_threshold, quadtree_density, structure_energy
denoise_minFLOAT0.050–1
denoise_maxFLOAT0.350–1
curveFLOAT1.500.1–5
tile_sizeINT1024256–2048
overlapINT640–512
noise_typeCOMBOgaussian1 options: gaussian
eta_minFLOAT0.000–2Eta for lowest-denoise tiles. 0 = deterministic ODE. Eta-compatible samplers: euler_ancestral, dpmpp_sde, dpmpp_2s_ancestral, dpmpp_2m_sde, dpmpp_3m_sde, rk_beta.
eta_maxFLOAT1.000–2Eta for highest-denoise tiles. Scales linearly from eta_min (at denoise_min) to eta_max (at denoise_max).
split_percentileoptFLOAT0.600–1quadtree_density only: a block counts as detailed when its structure energy exceeds a value this far across the canvas's own low-to-high energy range. Lower = more of the image counts as detailed. Canvas-relative, so it holds steady across VAEs and upscale ratios.

Outputs (3)

NameTypeDescription
refined_latentLATENT
denoise_mapIMAGE
scoring_mapIMAGE