Nodes/ComfyUI_AIIA/AIIA Segment Merge (Visual)
ComfyUI Node

AIIA Segment Merge (Visual)

Attach Visuals Back to the Timeline Without Regenerating Any Audio

By havvk·Created about a year ago·Updated 6 months ago· 13
AIIA Segment Merge (Visual)
    • merged_segments
    segments_info
    full_script

    If you're making an interactive podcast or slideshow-style video from the AIIA pack, you can sprinkle (Visual: https://example.com) tags into your script so each line has an accompanying image. The problem: those tags live in the script, but the timeline (which line plays when) lives in the TTS output. AIIA Segment Merge (Visual) is the little reconciliation node that copies the visuals from the script back onto the generated timeline - and it exists specifically so you can change the visuals without re-running the entire TTS pipeline.

    How it works

    Two string inputs, one string output:

    • segments_info - the timeline JSON from a dialogue TTS node (each segment has start/end/text/speaker).
    • full_script - the complete parsed script from AIIA Podcast Script Parser, including the visual tags (full_script_json, not dialogue_json - the latter is deliberately cleaned of visuals to keep TTS caching stable).

    The node lines up the speech items in the script 1:1 with the segments in the timeline, and for each one copies the visual field across. The output merged_segments is the enriched timeline that AIIA Web Export consumes to build the interactive HTML page with synchronized images.

    That 1:1 alignment is worth being careful about. If the script has ten speech lines, the timeline should have ten segments; if they mismatch, it logs a warning and merges only the overlapping prefix. The dialogue_json vs full_script_json distinction is the classic gotcha - connect the wrong one and your visuals never appear, because the cleaned dialogue has had them stripped out.

    Why it's worth a dedicated node

    This is a caching trick in node form. Because visual changes don't touch the audio itself, the pack separates the two concerns: dialogue_json (cleaned) feeds the TTS so its output stays cache-eligible, and full_script_json feeds this merge step. Edit the (Visual:) tags in your script, and only the merge re-runs - the expensive TTS generation is untouched. If you're iterating on a slideshow podcast, that's the difference between a five-second tweak and a full re-synthesis.

    The inputs that matter

    • segments_info - from your TTS node (the pack's dialogue TTS outputs it alongside audio).
    • full_script - from the parser, the version with visuals. Mismatch the count and you'll see the warning; it degrades gracefully rather than crashing.

    Output merged_segments goes to AIIA Web Export (for the interactive page) - and since it's still the same segments_info shape with an extra visual field, you can also run it through subtitle generation if you want subtitles alongside.

    Install

    Standard pack install: havvk/ComfyUI_AIIA via ComfyUI Manager or git clone https://github.com/havvk/ComfyUI_AIIA.git into custom_nodes/, restart. Pure JSON plumbing - no models, no dependencies.

    CategoryAIIA/Utils

    Inputs (2)

    NameTypeDefaultDescription
    segments_infoSTRING
    full_scriptSTRING

    Outputs (1)

    NameTypeDescription
    merged_segmentsSTRING