Nodes/comfyui-sequential-batcher/📊 Auto Loop Calculator (LTX 2.3)
ComfyUI Node

📊 Auto Loop Calculator (LTX 2.3)

Chunking math that respects LTX's 8n+1 frame rule

By Meisoftcoltd·Created 7 months ago·Updated 18 days ago· 3
📊 Auto Loop Calculator (LTX 2.3)
  • safe_faces_list
  • scene_cuts_list
  • chunk_frames
  • skip_frames
  • select_every_nth
source_frame_count
target_frames_per_loop81
select_every_nth1
current_loop_index

LTX Video 2.x is picky about one thing that catches everyone eventually: frame counts have to be divisible by 8, plus 1 (the "8n+1" rule). Ask for 80 frames and it fails or glitches; ask for 81 and it's happy. When you're chunking a long video through the loop pattern, that rule has to hold for every chunk you generate - and doing that arithmetic by hand while you're also tuning prompts is a recipe for a silent quality drop.

AutoLoopCalculatorLTX is the pack's LTX-specific chunk scheduler. Same job as the base AutoLoopCalculator - work out chunk_frames and skip_frames for each cycle - but every number that comes out is snapped to the 8n+1 rule first.

How it works

It walks the same global accumulator as the other calculators, but with LTX's constraints baked in:

  • Every chunk is rounded up to the nearest 8n+1 frame count (minimum 9).
  • The target_frames_per_loop slider is stepped in 8s (default 81, min 9, max 257), and the node proportionally rebalances it so the whole video divides into sane loop sizes instead of leaving a gnarly final chunk.
  • It tracks a physical timeline - the real frame limit of the source - and pads requests beyond it rather than asking the VAE for frames that don't exist.
  • Scene cuts and face cuts get snapped to the rule too: it cuts at the scene boundary, then rounds the chunk up to a valid 8n+1 count.

The source also flips the pack's ltx_mode global, which tells the stitcher to account for the n+1 frame correctly when it accumulates the timeline. It's the kind of coordination you'd never get right by wiring raw ints around.

Inputs and outputs

  • source_frame_count (INT) - from the analyzer.
  • target_frames_per_loop (INT, default 81, step 8) - how big you want each loop; the node reserves the right to rebalance it.
  • select_every_nth (INT) - frame skipping, if you're limiting fps.
  • current_loop_index (INT) - from SequentialLoopStart.
  • Optional safe_faces_list (FACE_CUTS) and scene_cuts_list (SCENE_CUTS).

Outputs: chunk_frames, skip_frames, select_every_nth (no log wire on this one - the status goes to the console).

Why the rule matters

This is the "you will get burned" node. LTX 2.3's own documentation states width/height must be divisible by 32 and frame count by 8+1 - off-grid values fail rather than round. If you hand LTX a 76-frame chunk, you get an error or a corrupt latent, and it's not obvious why. This node makes the "why" never happen. If you're running the base calculator against LTX by mistake, this is the swap that fixes it.

Install

ComfyUI Manager → "comfyui-sequential-batcher", or:

cd ComfyUI/custom_nodes
git clone https://github.com/Meisoftcoltd/comfyui-sequential-batcher

Restart ComfyUI. No models to fetch. Pack-wide note: launch without --highvram, and pair it with the VAE Safe Frame Padder if your LTX loop still hits the rule at the seam.

Category🔁 Sequential Batcher/Loop

Inputs (6)

NameTypeDefaultDescription
source_frame_countINT
target_frames_per_loopINT819–257
select_every_nthINT11–100
current_loop_indexINT
safe_faces_listoptFACE_CUTS
scene_cuts_listoptSCENE_CUTS

Outputs (3)

NameTypeDescription
chunk_framesINT
skip_framesINT
select_every_nthINT