Repository navigation
Description
Source: mo-akkakk/ComfyUI-MiniMaxH3-TemporalWindow-SpatialTiles (MIT), a ComfyUI node that wraps native H3 sampling (h3_windows.py, ~380 lines). Its plumbing is ComfyUI-specific (an OUTER_SAMPLE wrapper, a recording CLIP clone); a port is a new dw pipeline processor against diffusers, using that file as a reference for the logic only.
Idea: a stage-2 refine for H3 done in spatial tiles. Render stage 1 at native size, decode, upscale, VAE-encode, then refine over the low part of the sigma schedule one overlapping tile at a time, each tile anchored to its crop of the upscaled plate, and feather-blend the tiles. This is the deferred refine pass from #471: the #500 gate (2026-10-03, T2VA crowd faces, seed 42) found the latent upscale preview "close but soft" (waxy faces) against native 768p, and the refine pass was left as a new plan. Tiling is what makes a refine at 1080p+ fit in VRAM.
How the node does it (WindowsWrapper.__call__, plan_tiles, tile_weight, tile_refs):
- tiles on the 2x2 latent patch grid, linear feather over the overlap; their advice is >= 192 px overlap, default tile 960x544 with 256 px overlap;
- each tile's reference videos and keyframe latents are cropped to the tile, and
<Picture N>optionally too (on for a frame of this shot, off for a character/style reference); - the prompt is re-encoded per tile with the cropped reference images.
Known limits (theirs):
- tiles are denoised independently, so flat areas (sky, walls) can differ slightly between tiles; wider overlap helps;
- each tile renders its own soundtrack and they are averaged: the deliverable's audio should come from stage 1, not the tiles;
- a full-denoise pass in tiles without a plate repeats the subject in every tile, so this is a refine (partial sigmas) only.
Gate: rerun the #500 case (same prompt, seed 42, 124 frames) as stage-1 + tiled refine against native video-with-audio-768p and the #500 preview; faces must not be soft. Quote wall time against the 12.7 min native run.
(claude-opus-5-5 via anthropic)
Activity
dkackman commentedon Oct 27, 2026
Ruling (Don, 2026-10-26): approved. Over to lead for a plan. The gate stays as written: rerun the #500 case (same prompt, seed 42, 124 frames) as stage-1 + tiled refine, compared against native
video-with-audio-768pand the #500 preview. Faces must not be soft, and wall time is quoted against the 12.7 min native run. The deliverable's audio comes from stage 1.(claude-opus-5-5 via anthropic)
dkackman commentedon Oct 27, 2026
Plan v2: tiled H3 refine above 768p (#1043)
Lead: claude-opus-5-5 via anthropic. Read-only sweep of
develop@ 57daeb2. v2 folds in Don's ruling of 2026-10-26 (approved with one change: a zero-build pre-gate before stage A; Q1-Q5 answered as the defaults, plus an LTX arm).Verdict: build smaller, behind a zero-build pre-gate. Measure the routes that exist today first; build the engine only if they fail, then gate the template on Don's A/B
The issue's premise is stale, and that changes what this feature is. #471's deferred refine pass has been built: #598 (
refine_strength,DwH3RefineScheduleStep). Itsupscale-refinetemplate lost Don's A/B (M-F086, crowd faces, seed 42: 11.53 min against 9.59 min for native 768p, and still softer) and was reverted by #664. The engine stayed. A tiled refine at 1344x768 is #598 cut into pieces: slower, and with seams. The only new thing tiling buys is a refine above H3's 1344x768 canvas, i.e. a 1920x1088 deliverable that native H3 can't render. This plan builds that (Q1). The issue's 12.7 min baseline is from #500. The current native figure is 9.59 min (M-F086), and the pre-gate re-times native on the current build.field-reportasks for output above 768p (searched: 1080p, resolution, soft, sharp), so the demand is the gate itself. That is why the pre-gate runs first: if a route that exists today gives acceptable 1080p faces, nothing is built. If the full gate passes, the gain is the sharpest H3 1080p path dw has. If it fails, the engine stays as opt-in surface, as with #471 stage 1: upscale_h3_latents + decode_h3_latents tasks, no refine (the measurement) #499 and #598 stage 2: H3 refine schedule after latent upscale (refine_strength) #620.refine_tiles) and its rules inrefine_problems.pipeline.py, the only place a dw processor calls the pipeline more than once per step.breaking-changeas long as no catalog template names it. Stage B's template is the first dependency, which is why it's gated.upscaletask (spandrel) to 1920x1088: minutes of GPU and no new code. It can't add detail, so faces stay at 768p detail.upscale-clip(Idea: LTX-2.5 generative 2x upscale of a user-supplied mp4 (upscale-clip template) #542) on the H3 768p output, re-paired with H3's audio viapair_audio: a generative 2x that exists today, in a different model's look.What the sweep found against the issue
refine_strengthis reusable per tile as-is. Oneself.pipeline(**arguments)call per tile (dw/pipeline_processors/pipeline.py:685) with croppedlatents.DwH3RefineScheduleStep(h3_hold_steps.py:248-362) re-noises the generated rows and rebuilds the per-row plan. No graph change is needed for the refine itself (h3_hold.py:107-150).latents(before_denoise.py:382-397,972-978). It needs multiples of 32 (16 px × the 2x2 patch). Diffusers' 768x1344 cap applies only when they're omitted, so tile calls aren't refused.insert_audio_holdalready edits the graph, and the blended canvas is decoded once with diffusers'MiniMaxH3VideoDecodeStep(thedecode_h3_latentspath). That VAE tiles spatially by default (autoencoder_kl_minimax_h3.py:524-526,619-626), so a 1080p decode should fit. Nothing is measured above 768p (one reading: 10.93 GB reserved for the 768p decode)._with_held_audio(pipeline.py:703-731) adds one audio output per tile. The tiled step returns one video with stage 1's held waveform, once. That's Don's ruling ("audio from stage 1"), and it also sidesteps the node's averaged-soundtrack limit.h3_latent_upscale.py:62-63,165-170caps the target at 1344x768. Its comment says "H3's canvas", not VRAM. The cap is repeated inmodel_handlers.py:242,254,258and pinned bytests/test_h3_latent_upscale.py:45-137. 960x544 → 1920x1088 is 2x, the scale the upscaler was mostly trained at. 1344x768 → 1920x1088 is 1.43x. Both are inside 1-4x._encode_guides'encode_vae_condition(h3_guide_steps.py:343-380). This plan takes the latent route instead (Q2).h3_guide_steps.py:226-245). The gate case is T2VA with no references, so v1 refuses references and guides in tile mode (Q4)._split_tiles/_blend/_stitch_tiles(:656-719). dw'supscale.py:174-221_tiled_inferenceis a flat average despite its docstring, so it's not a model to copy.vram_estimate.pyprices a call by itswidth/height. A tiled 1920x1088 refine's denoise peak is a tile's, and only the decode is at full canvas. Stage A must price tile mode by the tile and the decode, or validate warns on every tiled run.Problem and non-goals
Problem: H3 renders at most 1344x768. A 1080p H3 deliverable today is an upscale of 768p detail. Does a route that exists today (spandrel, LTX
upscale-clip) already give acceptable 1080p faces? If not, can a low-σ refine, run in 768p tiles over an upscaled latent plate, give 1080p faces sharper than those routes, at a wall time Don will pay?Non-goals (v1):
<Picture N>, keyframes or guides (Q4);encode_h3_latentstask (Q2);_tiled_inference's docstring (a separate one-line fix; I'll file it if Don wants).The design
Surface decided here (everything
status:needs-approvalwould ask about):refine_tiles: {"width": int, "height": int, "overlap": int}. It is valid only together withrefine_strength, so it inherits refine's requirements (latents,hold_audio, H3 step, steps >= 2). No MCP tool, REST route or workflow-schema change. Arguments are already free-form, and the rules are static.refine_problems(h3_rules.py), the single owner #598 stage 2: H3 refine schedule after latent upscale (refine_strength) #620's review required, so validate and run time share them. Each refusal names the argument:refine_tileswithoutrefine_strength;<Picture N>, keyframe or guide argument on the same step;width/heightthat disagrees with thelatentscanvas. In tile mode the canvas is taken fromlatents(latent H×W × 16).DwH3RefineScheduleStepas an internal block input (it still callsscale_noise), not as a call argument.insert_audio_hold. The call gets the tile'swidth/height, its latent crop, the step's prompt,hold_audio,refine_strengthandnum_inference_steps. If diffusers' H3 blocks accept precomputed prompt embeddings, the prompt is encoded once, since with no references every tile's text is the same. Otherwise it's re-encoded per tile and the cost is quoted.pipeline.py:623-625). It is modelled on diffusers'_blend.decode_h3_latentspath with VAE tiling on. The step returnslatents(the full canvas), the video, and stage 1's held audio, once. Per-tile audio outputs are dropped.upscale_h3_latents' target cap rises from 1344x768 to 1920x1088 (or 1088x1920), with its descriptions and tests. Refusals beyond the cap are unchanged in form. The guide states that an upscale-only plate above 768p is soft until it's refined.vram_estimateprices the denoise at the tile's size and the decode at the canvas's size.get_pipeline_signatureon an H3 pipeline listsrefine_tiles(#598 stage 1: H3 audio-hold blocks in the denoise pipeline (hold_audio) #618 bounced on exactly this forhold_audio).Stages
Stage P: zero-build pre-gate (Don's ruling)
video-with-audio-768p, re-timed;upscale(spandrel) → 1920x1088;upscale-clip(Idea: LTX-2.5 generative 2x upscale of a user-supplied mp4 (upscale-clip template) #542), re-paired with H3's audio viapair_audio.f90ea84a796e, withcompare_outputs, plus each arm's wall time. Then parks the stage with Don (owner:don+status:needs-approval).Stage A: engine
refine_tiles+ upscaler cap + guide (the measurement)Blocked by stage P: it builds only once Don's pre-gate ruling says build.
upscale_h3_latents1920x1088 → H3 refine step withrefine_strength0.2, 5 points,video_shift6 on the 768p turbo LoRA,refine_tiles1344x768/256,hold_audiofrom base →pair_audio. Anum_framesconstraint goes on it as in validate_workflow accepts MiniMax-H3 num_frames outside 120-360; the run fails after the model load #584.refine_problems' new refusals, static and at run time;tests/test_h3_latent_upscale.py's cap cases;refine_tiles.ARCHITECTURE.mdrow "H3 audio hold and refine" (now with tiling);docs/TASKS.mdandmodel_handlers.py's cap text.get_output_framesandcompare_outputs. The job events show per-tile progress and one decode, and quote the wall time.refine_tileswithoutrefine_strength;refine_tileswith a reference image;refine_tileswith a guide.upscale_h3_latentsto 1920x1088 succeeds, while 1952x1088 and 1920x1120 fail naming the cap, with 1920x1088 named as the limit.refine_strengthrun withoutrefine_tilesbehaves exactly as before, so the existing refine cases still pass.get_pipeline_signatureon an H3 pipeline listsrefine_tiles.Gate (Don's, after stage A verifies): the #500 crowd-face A/B, seed 42, 124 frames
Run on lem. Faces must not be soft. Wall times are quoted against arm (a) as re-timed in the pre-gate, with the issue's 12.7 min and M-F086's 9.59 min alongside. The crops include a face on a tile boundary.
video-with-audio-768p(re-timed)f90ea84a796e(existing, not re-run)upscale(spandrel) → 1920x1088upscale-clip(#542) +pair_audioAudio in every tiled arm is stage 1's. The tester posts face crops (
compare_outputs). The ruling is Don's.Stage B (only if Don's gate says yes): catalog template + skill row
Filed parked with Don (
owner:don+status:needs-approval) and blocked by stage A. Don hands it back toowner:leadto build if the gate says yes.templates/minimax/tiled-refine-1080p(the winning arm's base) withcost_driversand a measuredcost. Also aminimax-h3SKILL row saying when to use it over (e) and (f), a templates README row, and aCOMPACT_BUDGETraise (tests/test_catalog_structure.py:500, now 11_650).list_workflows(shape="shot")lists the template with its cost.get_workflowshows its variables and constraints.Order and dependencies
P → A → gate → B. A is blocked by P, and B by A. No other open issue blocks any stage. #1030 is parked and independent.
Risks
Decisions (Don, 2026-10-26)
upscale-cliparm (f). (a), (e) and (f) run as the pre-gate, ahead of stage A.5 remaining items
dkackman commentedon Oct 27, 2026
Plan v2: changed since v1
This records Don's 2026-10-26 ruling. Scope is unchanged: stage A and stage B are as v1 had them.
upscale-clip, re-paired with H3's audio. The gate table now says which arms run in the pre-gate and which run after stage A. After stage A verifies, the tester runs arms (c) and (d) and posts them on stage B.(claude-opus-5-5 via anthropic)
dkackman commentedon Oct 27, 2026
Stages for plan v2, in build order (this is the first decomposition):
upscale-clip+pair_audioon the #471 stage 2: minimax/upscale-preview template + skill line (gated on Don's stage-1 comparison) #500 case (seed 42, 124 frames), posts face crops and wall times, and parks the stage with Don for the ruling.refine_tiles, upscaler cap 1920x1088, guide. Blocked by #1043 stage P: zero-build pre-gate (native 768p vs spandrel and LTX upscale-clip to 1080p) #1047, so it builds only after Don's pre-gate ruling says build. After it verifies, the tester runs gate arms (c) and (d) and posts them on #1043 stage B: templates/minimax/tiled-refine-1080p + skill row (gated on Don's A/B) #1049.templates/minimax/tiled-refine-1080p+ skill row. Blocked by #1043 stage A: engine refine_tiles + upscaler cap 1920x1088 + guide #1048, and filed parked with Don (owner:don+status:needs-approval) until his full-gate ruling.All three need acceptance cases. Stage P's cases are the pre-gate runs themselves.
No cross-feature blockers.
(claude-opus-5-5 via anthropic)
dkackman commentedon Oct 27, 2026
Spec for #1043 plan v2. Tester: claude-opus-5-5 via anthropic. All cases are in
regression-suite-model-specific.mdand carrypending:andsource:lines. I made only read-only MCP calls; nothing was run.#1047 (stage P, pre-gate)
video-with-audio-768pon the #471 stage 2: minimax/upscale-preview template + skill line (gated on Don's stage-1 comparison) #500 prompt, seed 42, 124 frames, with re-timing.upscale→fit_to_model1920x1088 →pair_audiowith (a)'s audio.upscale-clip1920x1088 →pair_audiowith (a)'s H3 audio.compare_outputsface crops against (a) andf90ea84a796e, wall times, and the stage parked with Don.#1048 (stage A,
refine_tiles+ 1080p upscaler cap)refine_tilesrefusals, which include the plan's seven probes. Also tested: off-grid sizes and overlap, wrong types, tile over the canvas, overlap 160 and 384, picture/keyframe, a width/height that disagrees with the latents, a non-H3 step, a missingoverlap. Boundary controls (192, 352, 1344x768, 1024x576) must validate.upscale_h3_latentscap. 1920x1088 and 1088x1920 accepted. 1952x1088, 1920x1120, 1088x1952 and 3840x2176 refused, naming 1920x1088. 1344x768 still accepted.measure_syncagainst a saved 544p take), per-tile events, a single decode, and no seams at the blend bands.refine_tilesis unchanged (M-F096, M-F097 and M-F115 re-run), and the signature listsrefine_tiles.#1049 (stage B,
templates/minimax/tiled-refine-1080p)get_workflowvariables, a clean validate at defaults,num_frames125/360 handling, and the minimax-h3 skill row against (e) and (f).Notes (none of these blocked a case):
templates/ltx2/upscale-clipneedsnum_frames= 8n+1, so validate refuses 124. Arm (f) is specced at 121 frames, 3 frames shorter than (a). Don should weigh that when comparing the arms.upscaletask takes a PIL image. No existing video route through it is confirmed. M-F170 lets the tester use any chain of existing tasks. If none applies, the record says "(e) not runnable today" for Don, rather than filing a bug.get_job_workflow("f90ea84a796e")returnsrealized: false, so the #471 stage 2: minimax/upscale-preview template + skill line (gated on Don's stage-1 comparison) #500 preview's mp4 may be gone too. If it is, M-F172 accepts a record that compares against (a) only and says so.overlaptakes a default. M-F174 accepts either a refusal namingoverlap, or a default the guide states.dkackman commentedon Oct 27, 2026
All stages are resolved: P (#1047) closed after the pre-gate, A (#1048) verified and shipped as the guide-only tiled refine (
refine_tiles, upscaler cap 1920x1088), and B (#1049) closed not planned after Don's gate. The feature ends as opt-in guide surface with no catalog template.(claude-opus-5-5 via anthropic)