DHan-Minimax H3 Long Sampler
What the Long Sampler Actually Chains
- noise
- guider
- sampler
- sigmas
- latent_image
- output
- denoised_output
What it is
H3 is trained on 4–15 second clips. Ask it for 40 and you're off the map. The usual answer in this ecosystem is to generate a clip, take its last frame, and feed that into the next generation - which is what people did with Wan for years, and it works right up until the seams show as hard cuts and colour drift.
The Long Sampler takes the other road. It's a drop-in replacement for SamplerCustomAdvanced that renders the timeline in H3-safe windows and carries the previous window's actual video and audio latent tail forward as context, then stitches the result back into one joint AV latent. Continuity comes from latent state, not from a re-encoded still.
The mechanism
The Director leaves a dhan_h3_long_plan dict inside its latent output - fps, frame count, mode, timeline data, the model/VAE references. This node is the only thing that reads it. If there's no plan (you wired some other latent in), it just samples once and behaves like stock SamplerCustomAdvanced. Above the safe window it rebuilds the job as ≤15s passes, each follow-up carrying context_frames of tail context at the canonical H3 grid values (5, 22, 39, 56…; 22 frames is about 0.9s at 24fps). The overlap is trimmed from the next window, and the sampled AV latents are stitched back to your requested duration.
continuation_mode picks the handoff flavour:
- Herrgotts Core (default) - the vendored, phase-aligned latent math from the Herrgotts-H3-Infinite-Continuation-Suite: video carried as separate H3 keyframes at canonical offsets, audio injected through
minimax_refswith timeline-end metadata. It's the reason this pack ships aherrgotts_bridgedirectory with its own GPL-3.0 licence file. - Stable DHan - the older, known-good direct 22-frame blob handoff, kept as the fallback the community builds converged on.
- Masked AV - copies the previous video and audio latent tails into the target and protects the overlap with ComfyUI's native AV denoise masks. Start comparisons at a 39-frame context.
The inputs
noise, guider, sampler, sigmas and latent_image are the same five sockets SamplerCustomAdvanced has - latent_image is where the Director's latent goes, and it has to be that one, for the reason above. Then:
safe_window_seconds- 5 to 15, default 15. The ceiling. At or below it, a single normal sampling pass.context_frames- the tail handed to the next window, in H3 grid steps.max_windows- a safety limit (default 8, up to 32) so a mistyped duration can't start an overnight render.refresh_reference- default on. Re-feeds the Director's original opening image into the Qwen multimodal conditioning of follow-up windows as a visual reminder only; the latent tail stays the actual frame-0 anchor. It exists because long chains slowly burn away from their reference.
Outputs are output and denoised_output, both LATENT - same pair SamplerCustomAdvanced gives you, so whatever decode path you had downstream keeps working.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/DHan315/Comfyui-DHan-Minimax-H3-Director
# restart ComfyUI
Same single pack install (or ComfyUI Manager → "Comfyui-DHan-Minimax H3 Director"); the Herrgotts code is vendored inside it, so there's nothing else to clone. No weights ship here and there's no requirements.txt, but the pack imports av and torchaudio when it loads - a missing one breaks registration of every node in the pack.
Honest caveats
This is labelled experimental in the pack's own changelog, and it is FL2VA-only: Ref2VA and Retake pass through as a single sample, so don't plan a 30-second Ref2VA shot around it. There was a real stitching bug where each continuation seam lost roughly one audio latent step to 24fps/40Hz grid rounding - fixed in the current build by floor-timing the audio overlap and allowing a tiny defensive pad, but if you're on an old checkout and your dialogue drifts a hair per seam, that's why.
Two more things worth knowing before you blame the node. Continuation windows carry latent overlap, but the text prompts are scheduled from the first new frame, so a beat near a 15-second boundary won't get re-issued in the next window. And stitching overlaps doesn't stop quality drift entirely - refresh_reference mitigates it, it doesn't abolish it. If a 60-second render still looks tired at the end, that's the model, not your wiring.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| noise | NOISE | — | |
| guider | GUIDER | — | |
| sampler | SAMPLER | — | |
| sigmas | SIGMAS | — | |
| latent_image | LATENT | Connect the DHan Director latent output. Long-render metadata is carried invisibly inside it. | |
| safe_window_seconds | FLOAT | 15.05–15 | Maximum logical duration per H3 sampling pass. <= this duration samples normally. |
| context_frames | INT | 225–107 | Tail context carried directly from one sampled H3 AV latent into the next. 22 frames is about 0.9s at 24fps; valid H3 grid values are 5,22,39,56... |
| max_windows | INT | 82–32 | Safety limit for chained windows. |
| refresh_reference | BOOLEAN | true | Use the original Director image as a Qwen-only visual reference on Herrgotts Core and Stable DHan continuation windows. |
| continuation_mode | COMBO | Herrgotts Core | Masked AV preserves the previous video and audio latent tail during denoising. Herrgotts Core and Stable DHan remain available for existing workflows. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| output | LATENT | — |
| denoised_output | LATENT | — |