Nodes/ComfyUI MiniMax H3 Timeline Director/MiniMax H3 Select Loop Segment
ComfyUI Node

MiniMax H3 Select Loop Segment

Pick this iteration's media and prompt

By Songssx·Created about a month ago·Updated 2 days ago· 465
MiniMax H3 Select Loop Segment
  • finite_plan
  • Segment Material Plan
  • Segment Prompt
  • Overlap Frames
  • Use Two-Stage Sampling
  • Two-Stage Model
  • High-Resolution Steps
iteration_index

A segment plan is a stack of per-segment answers: which references this segment uses, what its prompt is, how much it overlaps the previous one, and whether it wants two-stage sampling. Inside a manual ComfyUI loop, something has to pull the right row off the stack for iteration N. That's this node, and it's the most useful of the loop set to understand first, because its outputs tell you what the rest of the body should look like.

How it works

Feed it the finite plan and Start Loop's iteration_index. It validates that the index actually exists - an out-of-range index raises rather than silently generating the last segment twice, which is the behaviour you'd get from a naive min(index, end) approach.

Then it hands you six outputs, one per decision the loop body needs to make:

  • Segment Material Plan - a MINIMAX_H3_TIMELINE_PLAN for this segment only, media assignments included. This is what goes into the Plan Encoder.
  • Segment Prompt - the string for this segment. The planner enforces an all-or-nothing rule: if you enter any per-segment prompt you have to complete every one, and the global prompt is then ignored.
  • Overlap Frames - the per-segment overlap for this iteration, which the planner computes from your GEN windows. It's per-segment, not a single global number, because windows in the middle of a chain carry overlap at both ends while the first one doesn't.
  • Use Two-Stage Sampling - boolean, whether the plan asked for the low-res → latent-lift → high-res path.
  • Two-Stage Model - the H3 latent-upscaler filename to build the second stage with, as a string.
  • High-Resolution Steps - how many of the schedule's steps run at high resolution.

Those last three exist so that the loop body can choose, per iteration, between a plain sampler and the bundled two-stage sampler. That's the whole reason the split architecture exists: the README's framing is that you can "freely choose ordinary sampling, the bundled H3 two-stage sampler, previews, saves, or custom processing inside the loop body."

The one wiring fact that bites: the plan and prompt go to the Plan Encoder, not straight to a sampler. The encoder is what turns a material plan into conditioning plus an AV latent. Skip it and you'll be plugging a plan object into a sampler's latent input and wondering why.

Inputs and outputs, briefly

Required: finite_plan (MINIMAX_H3_FINITE_SEGMENT_PLAN, from the Material Planner's Segment Plan output) and iteration_index, which is a force-input - it's meant to be wired from Start Loop, not typed.

Outputs: the six listed above. There's no passthrough state here; this node is stateless by design. It reads the plan, resolves one row, and returns. State lives in Initialize / Accumulate / Finish.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/Songssx/ComfyUI-MiniMaxH3-TimelineDirector.git

Restart ComfyUI, search MiniMax H3 to confirm the pack loaded, then open the bundled loop example (MiniMaxH3原生Loop有限分段示例工作流.json) and trace the wires before building your own. No extra pip packages; pyproject.toml declares none. You need the native H3 nodes, the H3 Ref2VA model, CLIP, video VAE and audio VAE, and Python 3.10+.

Common issues

"Loop iteration N is outside the M-segment plan." Your num_iterations is larger than the plan's segment count. Start Loop's iteration count and the plan have to agree; take the count from Initialize's Segment Count output rather than typing it.

The prompt is empty for every segment after the first. Entering per-segment prompts is all-or-nothing - the planner refuses a partial set, and the global prompt is only reused when every segment prompt is blank. If you see empty strings, the plan was built before you filled the prompts in; re-run the planner.

Two-stage outputs say yes but the sampler is one-stage. The three two-stage outputs are advisory. Nothing switches on its own: you have to route them into the two-stage sampler's upscaler_model and high-res step inputs, or ignore them and use a normal sampler. The README's rule for the step count is that it must be greater than zero and less than the scheduler's total - an 8-step schedule with 2 high-res steps runs 6 low-res, then 2 high-res.

CategoryMiniMax H3/Long Video/Loop

Inputs (2)

NameTypeDefaultDescription
finite_planMINIMAX_H3_FINITE_SEGMENT_PLAN
iteration_indexINT

Outputs (6)

NameTypeDescription
Segment Material PlanMINIMAX_H3_TIMELINE_PLAN
Segment PromptSTRING
Overlap FramesINT
Use Two-Stage SamplingBOOLEAN
Two-Stage ModelSTRING
High-Resolution StepsINT