AD_MinMax_Ref2_mul
The multi-shot H3 generator
- context
- model
- media
- media_1
- media_2
- media_3
- media_4
- media_5
- media_6
- media_7
- media_8
- media_9
- media_10
- media_11
- media_12
- media_13
- media_14
- media_15
- media_16
- stage_info
- stage_data
- context
- segment_video
- merged_video
- text
AD_MinMax_Ref2_mul is what happens when AD_MinMax_Ref2 grows up and stops being a one-shot node. It generates a multi-stage video: a long clip split into segments, each with its own prompt, generated in sequence, and stitched back into one continuous video file. It's the node you reach for when a single H3 clip (a few seconds at 24fps) isn't enough and you want a 20-second piece where each beat has its own prompt - a storyboard that renders itself.
"mul" is short for multi-stage, and it's built on the pack's flow_stage_begin / flow_stage_end loop system. You connect those nodes, give this one a JSON list of stage prompts, and the workflow re-queues itself once per stage, saving each segment as an mp4 in ComfyUI/output/apt_stage_video/<run_id>/segments/, then concatenates them on the final pass.
The inputs that change how you work
stage_prompts(STRING, default[]) - a JSON array of prompts, one per stage:["intro shot of the city", "close-up on the character", "wide exit shot"]. The scheduler usesstage_indexto pick the current prompt, and the last prompt repeats if you have more stages than prompts. Each prompt can carry<Picture N>/<Video N>/<Audio N>references, numbered against the global media slots.single_long_video_split(BOOLEAN) - feed one long reference video and the node cuts a different slice of it for each stage, using its embedded audio to drive H3. The final merge uses the original continuous soundtrack, so you get one seamless audio bed across the whole piece.single_long_audio_split(BOOLEAN) - same idea for a standalone audio track: each stage gets a locked slice, and the final merge restores the original continuous audio.enable_refine/refine_model/refine_denoise- a second sampling pass per stage, like a built-in "refine before save."refine_modelis an optional upscaler, but the tooltip says it plainly: useNoneor a 1× model if you want latent continuity across stages. A 2× upscaler here will break the chain.stage_info/stage_data(optional) - wired fromflow_stage_begin;stage_datacarries the previous stage's output forward as the next stage's media context. That plus the context-latent chaining is how the character persists from one segment to the next.stage_text_1..64- per-stage prompt overrides, if you'd rather not fiddle with the JSON array.
Outputs: context (the bus, with the latest latent), segment_video (just the current stage's clip), merged_video (the full concatenation - only populated on the final stage, when it's wired up), and text.
How the pieces fit
Each stage resamples the long reference to a segment sized length frames with a 22-frame overlap (length - 22 stride), so consecutive clips share context instead of cutting cold. On the final stage it concats the mp4s with ffmpeg-style remuxing (via PyAV) and re-embeds the continuous audio. If the merged output isn't connected, it skips the expensive concat - a nice touch.
Where it bites
The stage loop is driven by flow_stage_end auto-requeueing, which means a "stuck" workflow that keeps re-running is usually a stage-sync problem, not a crash. And the per-stage latent continuity is fragile by design: if you enable refine with a real upscaler, you've broken the "same latent" chain the multi-stage consistency depends on. Also, stage_prompts must parse as a JSON list of strings - a stray comma gives you "stage prompts are invalid" immediately, so validate before you queue.
Installing it
Same pack, same install:
cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset
pip install -r requirements.txt # or install.bat
Requires native MiniMax H3 support in your ComfyUI build and an H3 model loaded via the pack's universal loader. Audio lock (single_long_*_split) additionally needs a model in the context or the model input - the node says so explicitly if you forget.
Inputs (114)
| Name | Type | Default | Description |
|---|---|---|---|
| context | RUN_CONTEXT | — | |
| prompt | STRING | — | |
| width | INT | 134432–4096 | — |
| height | INT | 76832–4096 | — |
| length | INT | 1245–3600 | 帧数(24 fps),自动 snap 到 17k+5 网格(124 ≈ 5s) |
| ref_image_size | COMBO | match | 'match' 缩放到画布面积;'max' 对齐 2048 短边(身份更好但更慢) |
| seed | INT | 00–18446744073709550000 | — |
| stage_prompts | STRING | [] | — |
| single_long_video_split | BOOLEAN | false | Split one referenced long video by stage. Its embedded audio drives H3; the final merge uses the original continuous soundtrack. |
| single_long_audio_split | BOOLEAN | false | Split one referenced long audio clip by stage and lock it into H3; the final merge uses the original continuous audio. |
| enable_refine | BOOLEAN | false | Run a second sampling pass before saving this stage. |
| refine_model | COMBO | None | Optional image upscaler before the second pass. None resamples the first-pass latent directly. Use None or a 1x model for multi-stage latent continuity. |
| refine_denoise | FLOAT | 0.300–1 | Denoise strength for the second sampling pass. |
| modelopt | MODEL | — | |
| fpsopt | FLOAT | 241–120 | — |
| mediaopt | IMAGE,VIDEO,AUDIO,LATENT,STRING | — | |
| media_1opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_1opt | STRING | — | |
| media_2opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_2opt | STRING | — | |
| media_3opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_3opt | STRING | — | |
| media_4opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_4opt | STRING | — | |
| media_5opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_5opt | STRING | — | |
| media_6opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_6opt | STRING | — | |
| media_7opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_7opt | STRING | — | |
| media_8opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_8opt | STRING | — | |
| media_9opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_9opt | STRING | — | |
| media_10opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_10opt | STRING | — | |
| media_11opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_11opt | STRING | — | |
| media_12opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_12opt | STRING | — | |
| media_13opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_13opt | STRING | — | |
| media_14opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_14opt | STRING | — | |
| media_15opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_15opt | STRING | — | |
| media_16opt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| media_type_16opt | STRING | — | |
| stage_infoopt | FLOW_STAGE_INFO | — | |
| stage_dataopt | IMAGE,VIDEO,AUDIO,LATENT | — | |
| stage_text_1opt | STRING | — | |
| stage_text_2opt | STRING | — | |
| stage_text_3opt | STRING | — | |
| stage_text_4opt | STRING | — | |
| stage_text_5opt | STRING | — | |
| stage_text_6opt | STRING | — | |
| stage_text_7opt | STRING | — | |
| stage_text_8opt | STRING | — | |
| stage_text_9opt | STRING | — | |
| stage_text_10opt | STRING | — | |
| stage_text_11opt | STRING | — | |
| stage_text_12opt | STRING | — | |
| stage_text_13opt | STRING | — | |
| stage_text_14opt | STRING | — | |
| stage_text_15opt | STRING | — | |
| stage_text_16opt | STRING | — | |
| stage_text_17opt | STRING | — | |
| stage_text_18opt | STRING | — | |
| stage_text_19opt | STRING | — | |
| stage_text_20opt | STRING | — | |
| stage_text_21opt | STRING | — | |
| stage_text_22opt | STRING | — | |
| stage_text_23opt | STRING | — | |
| stage_text_24opt | STRING | — | |
| stage_text_25opt | STRING | — | |
| stage_text_26opt | STRING | — | |
| stage_text_27opt | STRING | — | |
| stage_text_28opt | STRING | — | |
| stage_text_29opt | STRING | — | |
| stage_text_30opt | STRING | — | |
| stage_text_31opt | STRING | — | |
| stage_text_32opt | STRING | — | |
| stage_text_33opt | STRING | — | |
| stage_text_34opt | STRING | — | |
| stage_text_35opt | STRING | — | |
| stage_text_36opt | STRING | — | |
| stage_text_37opt | STRING | — | |
| stage_text_38opt | STRING | — | |
| stage_text_39opt | STRING | — | |
| stage_text_40opt | STRING | — | |
| stage_text_41opt | STRING | — | |
| stage_text_42opt | STRING | — | |
| stage_text_43opt | STRING | — | |
| stage_text_44opt | STRING | — | |
| stage_text_45opt | STRING | — | |
| stage_text_46opt | STRING | — | |
| stage_text_47opt | STRING | — | |
| stage_text_48opt | STRING | — | |
| stage_text_49opt | STRING | — | |
| stage_text_50opt | STRING | — | |
| stage_text_51opt | STRING | — | |
| stage_text_52opt | STRING | — | |
| stage_text_53opt | STRING | — | |
| stage_text_54opt | STRING | — | |
| stage_text_55opt | STRING | — | |
| stage_text_56opt | STRING | — | |
| stage_text_57opt | STRING | — | |
| stage_text_58opt | STRING | — | |
| stage_text_59opt | STRING | — | |
| stage_text_60opt | STRING | — | |
| stage_text_61opt | STRING | — | |
| stage_text_62opt | STRING | — | |
| stage_text_63opt | STRING | — | |
| stage_text_64opt | STRING | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| context | RUN_CONTEXT | — |
| segment_video | VIDEO | — |
| merged_video | VIDEO | — |
| text | STRING | — |