Nodes/Richard's Video Kits/RVK Wan Animate 2 Advance
ComfyUI Node

RVK Wan Animate 2 Advance

The Gate That Only Moves On Once the File Is Real

By Richard-Wang-fs·Created 26 days ago·Updated 15 days ago· 0
RVK Wan Animate 2 Advance
  • receipt
  • plan
  • continuation_candidate
  • status
  • has_more
  • saved_path

The least glamorous node that makes the loop safe

RVK Wan Animate 2 Advance does almost nothing, and that's the design. It is the checkpoint between "a segment finished" and "start the next one", and it will not advance the run unless the segment is verifiably on disk and matches what was planned.

You'd think that was excessive until you've had a five-hour unguarded chain lose its state at hour four. A silent desync - the loop thinks it's on segment 6, disk says 7, the continuation frame no longer corresponds to anything - is much worse than a loud red error. Advance's entire job is to make the loud error the only failure mode.

How the gate works

Three inputs, all required: receipt (from RVK Save Segment Video), plan (from RVK Wan Animate 2 Loop Entry) and continuation_candidate (from RVK Wan Animate 2 Collect). The node looks up the in-memory run using the plan's token and then re-derives what the plan for this index should be and compares it against what it was handed. Then it checks the receipt:

  • The segment index has to be the current one.
  • The receipt's frame count has to equal the plan's delivery frame count exactly.
  • The fps has to match, as a fraction.
  • The receipt's path has to resolve to the exact segment_XXXX.mp4 the run expects, inside ComfyUI's output root, and it has to be an actual file.

Only then does it take the continuation frame, store it, bump the index, and mark the run ready. Any mismatch, and it discards the run outright - plan_mismatch, receipt_mismatch, candidate_mismatch or run_not_found. There's no partial-credit path. It also validates the continuation is a single contiguous CPU tensor, and that the final segment carries none at all, because there's nothing left to continue.

The status it emits is also broadcast to the browser extension as an advance event, and that's what causes the next segment to be queued. So Advance isn't just bookkeeping - it's the trigger.

Outputs and where they go

  • status → loop_status on RVK Finalize Segments. This is what makes finalization automatic: Finalize won't assemble until the run reports complete, and once it does, it joins the segments and adds the source audio. Leave this wire out and you're in the standalone mode where Finalize just reads the directory.
  • has_more → a boolean for your own logic or a note node. False on the last segment, or immediately after you hit Stop RVK after current segment on Loop Entry.
  • saved_path → a STRING, useful in a text node when you want to see the file that was just confirmed.

It's an output node, and non-idempotent like the rest of the pack - it runs every queue, which is correct when each execution is a state transition.

The state lives in RAM

Worth being explicit, because it's the pack's biggest operational limitation: the run - token, index, next frame offset, and that one continuation frame - lives in the ComfyUI process, with a 30-minute expiry on the ready state. Nothing is persisted, and no model state is reconstructed from saved videos. If the server restarts, if the queue stalls for longer than the TTL, or if you relaunch the browser mid-run, the handoff is gone. Your completed segment_XXXX.mp4 files are all still there and finalize fine - you just can't continue generating from where you stopped. A new run means a new empty directory.

Install

Manager → Richard's Video Kits / richards-video-kits, version 1.0.0 → restart ComfyUI. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/Richard-Wang-fs/ComfyUI-RichardsVideoKits

One copy only, launched with --cache-classic (the author's tested config: Windows/NTFS, Python 3.12, ComfyUI 0.36.0, frontend 1.52.7). No pip dependencies, no bundled models.

Where people get burned

  • run_not_found / "run token is unknown or expired." You queued a segment by hand outside the loop, or the workflow was closed and reopened, or more than 30 minutes passed between segments. There's no recovery except a fresh run.
  • receipt_mismatch after you "just changed one thing". Changing segment_length or output_directory mid-run changes the plan, so the receipt for the in-flight segment no longer matches. Set both before you press Queue, not during.
  • Wiring a different save node into receipt. Only a real RVK receipt carries the index, frame count and fps Advance compares. A generic video output won't satisfy the gate.
  • Moving or deleting a segment file mid-run. Advance re-resolves the path every step. Touch the directory while it's generating and you'll trip the gate on the next segment - and it drops the run rather than guessing.
CategoryRVK/Wan Animate 2

Inputs (3)

NameTypeDefaultDescription
receiptRVK_VIDEO_RECEIPT—
planRVK_WAN_SEGMENT_PLAN—
continuation_candidateRVK_WAN_CONTINUATION—

Outputs (3)

NameTypeDescription
statusRVK_WAN_LOOP_STATUS—
has_moreBOOLEAN—
saved_pathSTRING—