Repository navigation
Description
Carry an H3 chain's previous segment into the next as its latent tail under a denoise mask, instead of decoding it and re-encoding the pixels as guide rows. The aim is to take one VAE round trip out of every seam.
Source
knoic/ComfyUI-MiniMaxH3-PrefixStream (MIT, ComfyUI nodes), the "Native Masked AV" path in pipeline/native_masked_av.py. That path credits Herrgott's H3 Infinite Continuation Suite. Only concepts would come across: their code runs on ComfyUI's sampler and noise_mask plumbing, not on diffusers modular blocks. If any arithmetic is ported, credit it in docs/ATTRIBUTIONS.md.
What it does
- Picks the source tail on H3's 1,4,4,4,4 frames-per-token grid: context lengths
5 + 17k(22 frames = 7 latent steps, 39 = 12). The tail has to be phase-aligned, starting where(start_step + t) % 5 == 0. - Copies those latent steps verbatim into the head of the new target latent. The audio latents go in the same way: duration rounded once at 40/24, then aligned to the video's end.
- Builds separate video and audio denoise masks: 0 over the copied head (held), 1 over the rest (generated).
- Drops any keyframe that falls inside the held head, so a frame-0 keyframe cannot fight the copied context.
- Trims the held head off the deliverable afterwards.
Two optional knobs, both off by default in PrefixStream:
video_context_denoise: a soft value (they suggest A/B points 0 / 0.03 / 0.06) on the video head mask, so the model can lightly correct inherited texture. They note H3 rounds token masks to 1/256 granularity (0.06 becomes 0.0625), and that the value is not a calibrated "6 % repair".audio_feather_ticks: a cosine ramp on the audio mask at the hand-over instead of a hard edge. They later set its default to 0, because feathering releases some held audio to regeneration.
How this differs from what we have
continuity: "guide" (dw/pipeline_processors/h3_guides.py, h3_guide_steps.py) decodes the previous segment and VAE-encodes guide_frames frames on the target canvas. It splices them in as extra condition rows held at t = 1.0, and the target rows at the same times are generated alongside them. That means one decode plus one encode per seam, and the guide costs about as much VRAM per voxel as the clip itself (#694). With the latent tail, the head is the target: no re-encode, no duplicate condition rows. The VRAM cost and the drift at the seam might both come down. Our H3 skill already says "drift compounds per seam".
Caveats
- Unproven on real weights. PrefixStream's own analysis (
docs/DEGRADATION_ANALYSIS_CN.md) says its runtime check used the real H3 mask and Euler code with a stand-in denoiser. No multi-segment run with the weights loaded has shown a quality gain. Copying the latent removes VAE re-encode error, but if the tail already carries texture damage, the copy carries it forward, frozen by the hard mask. - It is a different conditioning layout from guides, not a tweak to them. We would need the previous step's final latents (the refine's
latentsinput gets partway there) and a masked-head layout block next to the guide-row one. It also has to fit our hold/refine/mask blocks:h3_mask.pyregional edits already use a denoise mask, so check whether that path can be reused. - A joint AV model reads the video context when it predicts audio. A soft video mask can change the new audio even though the audio head stays held.
- Batch size 1 only, in their implementation.
Suggested assessment
A/B on lem, everything branched from one clean first segment with a fixed seed sequence, prompts and settings. At least 5 seams per arm:
- Current
guidecontinuity, 22 frames. - Latent tail, hard mask, 22 frames.
- Arm 2 with
video_context_denoise0.03 and 0.06.
Compare a flat background region and skin across segments 1, 3 and 5 (#1152), seam continuity of motion and voice, peak VRAM, and wall time. Only if arm 2 beats arm 1 does this go to a plan.
Filed by Don, 2026-11-01, from a review of PrefixStream.
Activity
dkackman commentedon Nov 2, 2026
Plan v1: H3 chain continuity from the previous segment's latent tail (#1150)
Written by model
claude-opus-5-5via provideranthropic(design session, 2026-11-01), againstdevelop@ 4dd4d21.What this issue is. It's an
idea, and it isn't a duplicate. It is the third version of one idea, "carry an H3 seam as latents, not pixels":What's new here is the layout. The carried head is the target's own rows, held under a mask, so there are no extra condition rows. That is a real difference from #1044 (no guide VRAM, and no duplicate rows at the same times), so I treat this as a feature rather than closing it as a duplicate. It belongs in that parked family, though.
Verdict: defer. Park it with #1044/#1030. Reopen when #1152 can measure drift and shows
guidechains drifting at the seams.The issue sets its own gate: "Only if arm 2 beats arm 1 does this go to a plan". Arm 2 doesn't exist yet. Getting to that A/B means building most of an engine path first. Today's evidence doesn't justify that.
Value: real but unmeasured
constitution-walkworkspace is mid-take right now, running a customConstitutionWalkGuidedSegment, about 22 min per segment on lem:chain QA/seg4 post-trim QAcheck-script run.get_job_workflowwas denied in this session), so I don't know why seg04 was re-rolled. It could be drift, a seam problem, or just content.field-report(open or closed) mentions seam drift, texture burn or guide VRAM.assess_outputfindings forguide. The verify of C-F304 heard speech carry across the seam word-for-word.dw/vram_estimate.py:162-186), andchained-segments.json:16,22already budgets for it.Build cost: about $14-20 before the A/B can even run, plus the A/B on lem
The sweep found that none of what arm 2 needs exists today:
_SegmentCarryholds PIL frames + an audio tail only._single_artifactdrops every non-video output, latents includeddw/pipeline_processors/chain.py:206-213, 462, 977-994after_denoiseleaves cleanlatents/audio_latentsin state, but there is nooutput_type="latent", and they come out only as named in-memory outputs.pipeline.py:641-643moves only a bare tensor to the CPU, not a dictmh3/decoders.py:106-126, 180-183;dw/result.py:504-514source_video, needsrefine_strength, refused together withlatents, refused on chained steps, andmask_growdilates in timeh3_mask_steps.py:63-243;h3_mask_cells.py:63-92;h3_rules.py:649-655;pipeline.py:827mh3/before_denoise.py:345;h3_hold_steps.py:279-293, 394-400row_timestep_planonly tells condition rows from generated ones. The scheduler steps every row after the condition prefixmh3/before_denoise.py:1250-1266;mh3/denoise.py:226-238Correction to the issue: "check whether the
h3_mask.pypath can be reused". It can't be reused as it is.The pattern carries over: a post-step overwrite of kept rows with
scale_noise(source, …). The block itself doesn't.One more risk, from the VAE: it is causal and chunked. A tail copied from mid-clip only matches clip-start latents if it starts on a 17-frame chunk boundary. The issue's
5 + 17kphase rule is exactly that condition, so it must be enforced, not just advised.Inertia: moderate
continuityenum value (dw/workflow_schema.json:317-333), validated indw/guides.py:234-283. It must stay out of the guide cap and out ofguide_lengths(dw/guides.py:304-309).LAYOUT_ANCHORSalready does (h3_guides.py:67-75). That is a second place that breaks on a diffusers bump.tests/test_guide_chain_validation.py:112-123: every mode must validate on t2va, and the unknown-mode message must mention "guide".tests/test_chain.py:824-1027.tests/test_plugin_skills.py:420-426.docs/WORKFLOW_GUIDE.md:513, 1879-1903, 3024-3036, 3071-3072;plugins/dw/skills/minimax-h3/SKILL.md:58-64;script-to-video/references/joins.md:55.Reversibility
Fine while it's unreleased. Once a saved workflow names the mode, removing it is a
breaking-change.Cheaper alternatives
guidetake tells us whether there is any drift to remove. It is far cheaper, and its method (one clean first segment, change one variable at a time, measure before the MP4 encode) is the method this A/B needs anyway. Recommended.guide.guide_frames: 22is already the minimum, so that lever is spent.Overlap
Design, if reopened (recorded so the next session doesn't redo the sweep)
Problem: every
guideseam decodes the segment and re-encodes 22 or 39 frames as extra condition rows. That costs guide VRAM and may compound texture error per seam.Non-goals:
ConstitutionWalkGuidedSegmentwould not benefit);Surface:
continuityvalue,"latent"(name open). It reusesguide_frames22/39 as the head length, which maps to 7/12 latent steps (h3_rules.py:472);Stages (each lands on
develop):run_chainasks each segment forlatents/audio_latents, moves them to the CPU and holds them on_SegmentCarry, before_single_artifactdrops them.tests/test_chain_h3_native.py) shows the carry shapes, and output stays bit-identical to today.head_latents/head_audio_latents.analyze_seams(_seam_look,jump_ratio), peak VRAM and wall time.guide_lengths), head trim viaChainConfig.head_trim,_record_seamwording, docs, skill.chained-segmentsrun with the new mode yields the same total frame count asguide, with no guide-VRAM warning;source_videowith it, and refusesguide_framesother than 22/39 with the existing message.Risks
Questions
Q1 [scope] Defer and park with #1044/#1030, blocked by #1152? Default: yes. When #1152 closes, the driver hands this back, and a session reruns #1152's measurement on a real
guidetake (e.g.constitution-walk) to recheck the triggers. If otherwise: build stages A-C now as a probe (~$10 build plus Q2's GPU time), and D only on a win.Q2 [spend] Only if Q1 is "build": the A/B is 4 arms × ≥5 seams at ~20 min per H3 segment, so about 7 GPU-hours on lem. Default: not spent (deferred). If otherwise: it runs as stage C.
Q3 [none] When this family unparks, this issue's layout replaces #1044's "latent carry" arm, and #1044 keeps only its crossfade arm. I'll note that on #1044 when it unparks.
What would reopen it (triggers):
guidetake its mid-band energy rises segment over segment at the seams.field-reportof drift or burn in an H3 guided chain.constitution-walkkept being re-rolled is seam drift.Reply in comments and hand back with
owner:lead. Approve by addingstatus:plan-approvedyourself. No agent may set it.Decision for Don: defer #1150 (H3 latent-tail continuity) and park it with #1044/#1030 behind #1152's drift measurement, or build the probe now.
Kind: scope Default: deferred, parked, blocked by #1152.
If otherwise: stages A-C get built (~$10) and about 7 lem GPU-hours go to the A/B (Q2). Reversible: yes
— lead,
claude-opus-5-5viaanthropicdkackman commentedon Nov 2, 2026
Ruling (Don, 2026-11-01): Q1: defer. Parked with #1044/#1030, and blocked by #1152 (GitHub link added). When #1152 lands, a session reruns its measurement on a real
guidetake (e.g.constitution-walk) and rechecks the plan's four reopen triggers. Q2 is not spent. Q3 stands as written: when this family unparks, this layout replaces #1044's latent-carry arm.Labelled
parked.— recorded by claude-opus-5-5 (anthropic), relaying Don's ruling
dkackman commentedon Nov 2, 2026
Evidence for the reopen triggers, from roycho87/NerdNotes (2026-10-31 to 2026-11-02; ComfyUI, real H3 weights). Unlike PrefixStream's stand-in-denoiser check, these are real multi-segment runs.
A latent tail alone does not stop drift.
What did help was sampling-side. Partial noise on the held rows, ramping to clean at the join, plus clean anchors from segment 1. That is now #1166. If #1166's noise ramp turns out to be easier on masked target latents than on guide rows, that's an argument for unparking this layout as the vehicle. If it doesn't, the round-trip saving alone looks small.
Posted 2026-11-02 at Don's request.
dkackman commentedon Nov 2, 2026
Trigger fired: #1152 (
compare_outputs(texture_bands=true)) is closed and verified. The rerun this ruling calls for is folded into #1170's Stage A, which already loadsconstitution-walkseg 1–4. It posts texture bands per segment and across each seam here, then rechecks the four reopen triggers. Stays parked until those numbers are in. Given the NerdNotes evidence above (latent-tail chains still drift), unparking needs a trigger that clearly fires, or #1166 showing its noise ramp works better on masked target latents than on guide rows.dkackman commentedon Nov 3, 2026
Folded into #1199 (Long-form media), whose design and plan Don approved on 2026-11-03. This idea gets a measured verdict on the shared long-take bench there, and is then either built or promoted to a default, or closed with its numbers. Held as
owner:don+parkedwhile Don's session works it, so no loop role picks it up. The hand-off comment on #1199 says what happens to it.spike(h3): experimental latent carry between chain segments (#1150, T…
bench: Don's read of the first latent-carry take and the 120 s refine…
bench: latent carry without the anchor at 120 s, to split the carry's…
bench: latent carry, SelfLift and TST verdicts (refs #1150 #1044 #1030 …
bench: keystone confirmation - seed 2 pixel/latent-carry pair and key…
bench: keystone confirmation at seed 2 (refs #1188 #1150 #1044)
dkackman commentedon Nov 7, 2026
Verdict (long-form, #1199): stage A spiked (
experimental_latent_carry, dark), notbuilt. The previous segment's own final latents (video and audio rows) went in as
the next segment's guide rows, in place of the decode and re-encode. Stage B's
head-hold was not built, and the fl2va keyframe stays pixel. The benched arm and its
numbers are #1044's: no burn fix on the static scene, worse seams on the moving arc,
a tie under the keystone, and about 5 min saved per two-minute take. The
VRAM-saving arm was not measured, and with the carry losing as a default it is not
worth one. Record:
bench/records/structural.mdSteps 2-3 (R39 lists everythingthe A/B removes).
dkackman commentedon Nov 12, 2026
Verdict on latent carry under a held narration (narrated-long-take bench, 2026-11-12), seed 1, 12 segments (about 86 s).
face_dropmeets guide carry's at 85 s (0.205 against 0.207).experimental_latent_carrystays experimental; no key was renamed.Evidence:
bench/records/narrated.md; verdicts:docs/proposals/complete/narrated-long-take-complete.md(onfeat/narrated-long-take, merging to develop today).