Skip to content

Update tiled_diffusion.py#77

Open
pfpb wants to merge 1 commit into
shiimizu:mainfrom
pfpb:patch-1
Open

Update tiled_diffusion.py#77
pfpb wants to merge 1 commit into
shiimizu:mainfrom
pfpb:patch-1

Conversation

@pfpb

@pfpb pfpb commented Jan 1, 2026

Copy link
Copy Markdown

Correct gaussian weights denominator for y_probs.

Correct gaussian weights denominator for y_probs
@Adreitz

Adreitz commented Jan 18, 2026

Copy link
Copy Markdown

Should the tile midpoint be defined the same for both axes, e.g.

x_probs = [f(x, (tile_w - 1) / 2,tile_w) for x in range(tile_w)] # -1 because index goes from 0 to latent_width - 1 y_probs = [f(y, (tile_h - 1) / 2,tile_h) for y in range(tile_h)]
?

I believe the original code is here (line 192-196) and it is symmetric: https://github.com/albarji/mixture-of-diffusers/blob/master/mixdiff/canvas.py

djdarcy added a commit to DazzleNodes/Dazzle-ComfyUI-TiledDiffusion that referenced this pull request Jul 7, 2026
Found by auditing the commit ranges implicated by the issue-#4
reporter's own build bisect (his Jan 18 build clean, June 5+ builds
showing a +25-33 GB step at the second run, flat thereafter):

Model pinning: the April RoPE machinery stored a strong reference to
the diffusion model module on the tiling impl
(impl.diffusion_model). The impl survives between runs inside
ComfyUI's loaded-model registry via the unet-function wrapper, so
with unload nodes in the workflow (his graph carries UnloadModel and
UnloadAllModels -- decoded from the workflow embedded in his shared
PNG), the next run reloads the model while the old copy stays
pinned: two resident copies, ~30 GB for Flux.2 Q8, exactly one stale
copy at a time. That predicts his signature precisely: one step at
run 2, plateau after, absent on pre-RoPE builds. Now a weakref; the
model is strongly held by ComfyUI during sampling, so behavior is
unchanged, and unload nodes can actually free it. CUDA control
measured clean before and after (3 identical runs: free VRAM 17.4 ->
19.6 -> 20.9 GB -- memory released, no step).

reset() lifecycle: a mid-run canvas refresh re-initialized the impl
and silently dropped the rope flavour/scale, patch size, and
structure_latent (pre-existing since April). These now survive reset
alongside the tile settings and seam biases.

Tiled VAE on Flux.2: the decoder path crashed on the 32ch VAE
(give_pre_end attribute missing); SD-era attributes are now
getattr-guarded. Measured on a real 4032x2304 refine of the
reporter's own base image: our Tiled VAE Decode deviates from a
single-pass decode by mean 1.3/255 (p99 5) vs ComfyUI core
VAEDecodeTiled's 4.8/255 (p99 23) -- 3.6x less of the per-tile
GroupNorm color/brightness drift that reads as ghosting on flat
regions. (His workflow decodes through core VAEDecodeTiled; the
drift class matches his ghosting reports on every build back to
January.)

TD_DIAG=1: one-block diagnostic -- node file hash, method/tile
settings, latent_format class/channels/ratio, computed compression,
packed flag, rope state, seam biases, torch version, and memory
snapshots (cuda allocated/reserved or mps current/driver) at apply
and at each run's grid init. Two runs + one console paste shows
cross-run retention directly.

Also ships (staged earlier): the example workflow now carries the
verified coherence recipe (seam_bias_y 0.5, cfg 4; render-verified at
45-tile 4032x2304), and the v0.2.1 changelog entry credits upstream
shiimizu#77 (pfpb) for independently catching the per-axis variance
defect, per the reporter's own attribution note.

Refs #4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants