Nodes/ComfyUI-Apt_Preset/AD_MinMax_Ref2_mul
ComfyUI Node

AD_MinMax_Ref2_mul

The multi-shot H3 generator

By cardenluo·Created 2 years ago·Updated a day ago· 320
AD_MinMax_Ref2_mul
  • 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
prompt
width1344
height768
length124
ref_image_sizematch
seed0
stage_prompts[]
single_long_video_splitfalse
single_long_audio_splitfalse
enable_refinefalse
refine_modelNone
refine_denoise0.30
fps24
media_type_1
media_type_2
media_type_3
media_type_4
media_type_5
media_type_6
media_type_7
media_type_8
media_type_9
media_type_10
media_type_11
media_type_12
media_type_13
media_type_14
media_type_15
media_type_16
stage_text_1
stage_text_2
stage_text_3
stage_text_4
stage_text_5
stage_text_6
stage_text_7
stage_text_8
stage_text_9
stage_text_10
stage_text_11
stage_text_12
stage_text_13
stage_text_14
stage_text_15
stage_text_16
stage_text_17
stage_text_18
stage_text_19
stage_text_20
stage_text_21
stage_text_22
stage_text_23
stage_text_24
stage_text_25
stage_text_26
stage_text_27
stage_text_28
stage_text_29
stage_text_30
stage_text_31
stage_text_32
stage_text_33
stage_text_34
stage_text_35
stage_text_36
stage_text_37
stage_text_38
stage_text_39
stage_text_40
stage_text_41
stage_text_42
stage_text_43
stage_text_44
stage_text_45
stage_text_46
stage_text_47
stage_text_48
stage_text_49
stage_text_50
stage_text_51
stage_text_52
stage_text_53
stage_text_54
stage_text_55
stage_text_56
stage_text_57
stage_text_58
stage_text_59
stage_text_60
stage_text_61
stage_text_62
stage_text_63
stage_text_64

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 uses stage_index to 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_model is an optional upscaler, but the tooltip says it plainly: use None or a 1× model if you want latent continuity across stages. A 2× upscaler here will break the chain.
  • stage_info / stage_data (optional) - wired from flow_stage_begin; stage_data carries 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.

CategoryApt_Preset/AD

Inputs (114)

NameTypeDefaultDescription
contextRUN_CONTEXT
promptSTRING
widthINT134432–4096
heightINT76832–4096
lengthINT1245–3600帧数(24 fps),自动 snap 到 17k+5 网格(124 ≈ 5s)
ref_image_sizeCOMBOmatch'match' 缩放到画布面积;'max' 对齐 2048 短边(身份更好但更慢)
seedINT00–18446744073709550000
stage_promptsSTRING[]
single_long_video_splitBOOLEANfalseSplit one referenced long video by stage. Its embedded audio drives H3; the final merge uses the original continuous soundtrack.
single_long_audio_splitBOOLEANfalseSplit one referenced long audio clip by stage and lock it into H3; the final merge uses the original continuous audio.
enable_refineBOOLEANfalseRun a second sampling pass before saving this stage.
refine_modelCOMBONoneOptional 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_denoiseFLOAT0.300–1Denoise strength for the second sampling pass.
modeloptMODEL
fpsoptFLOAT241–120
mediaoptIMAGE,VIDEO,AUDIO,LATENT,STRING
media_1optIMAGE,VIDEO,AUDIO,LATENT
media_type_1optSTRING
media_2optIMAGE,VIDEO,AUDIO,LATENT
media_type_2optSTRING
media_3optIMAGE,VIDEO,AUDIO,LATENT
media_type_3optSTRING
media_4optIMAGE,VIDEO,AUDIO,LATENT
media_type_4optSTRING
media_5optIMAGE,VIDEO,AUDIO,LATENT
media_type_5optSTRING
media_6optIMAGE,VIDEO,AUDIO,LATENT
media_type_6optSTRING
media_7optIMAGE,VIDEO,AUDIO,LATENT
media_type_7optSTRING
media_8optIMAGE,VIDEO,AUDIO,LATENT
media_type_8optSTRING
media_9optIMAGE,VIDEO,AUDIO,LATENT
media_type_9optSTRING
media_10optIMAGE,VIDEO,AUDIO,LATENT
media_type_10optSTRING
media_11optIMAGE,VIDEO,AUDIO,LATENT
media_type_11optSTRING
media_12optIMAGE,VIDEO,AUDIO,LATENT
media_type_12optSTRING
media_13optIMAGE,VIDEO,AUDIO,LATENT
media_type_13optSTRING
media_14optIMAGE,VIDEO,AUDIO,LATENT
media_type_14optSTRING
media_15optIMAGE,VIDEO,AUDIO,LATENT
media_type_15optSTRING
media_16optIMAGE,VIDEO,AUDIO,LATENT
media_type_16optSTRING
stage_infooptFLOW_STAGE_INFO
stage_dataoptIMAGE,VIDEO,AUDIO,LATENT
stage_text_1optSTRING
stage_text_2optSTRING
stage_text_3optSTRING
stage_text_4optSTRING
stage_text_5optSTRING
stage_text_6optSTRING
stage_text_7optSTRING
stage_text_8optSTRING
stage_text_9optSTRING
stage_text_10optSTRING
stage_text_11optSTRING
stage_text_12optSTRING
stage_text_13optSTRING
stage_text_14optSTRING
stage_text_15optSTRING
stage_text_16optSTRING
stage_text_17optSTRING
stage_text_18optSTRING
stage_text_19optSTRING
stage_text_20optSTRING
stage_text_21optSTRING
stage_text_22optSTRING
stage_text_23optSTRING
stage_text_24optSTRING
stage_text_25optSTRING
stage_text_26optSTRING
stage_text_27optSTRING
stage_text_28optSTRING
stage_text_29optSTRING
stage_text_30optSTRING
stage_text_31optSTRING
stage_text_32optSTRING
stage_text_33optSTRING
stage_text_34optSTRING
stage_text_35optSTRING
stage_text_36optSTRING
stage_text_37optSTRING
stage_text_38optSTRING
stage_text_39optSTRING
stage_text_40optSTRING
stage_text_41optSTRING
stage_text_42optSTRING
stage_text_43optSTRING
stage_text_44optSTRING
stage_text_45optSTRING
stage_text_46optSTRING
stage_text_47optSTRING
stage_text_48optSTRING
stage_text_49optSTRING
stage_text_50optSTRING
stage_text_51optSTRING
stage_text_52optSTRING
stage_text_53optSTRING
stage_text_54optSTRING
stage_text_55optSTRING
stage_text_56optSTRING
stage_text_57optSTRING
stage_text_58optSTRING
stage_text_59optSTRING
stage_text_60optSTRING
stage_text_61optSTRING
stage_text_62optSTRING
stage_text_63optSTRING
stage_text_64optSTRING

Outputs (4)

NameTypeDescription
contextRUN_CONTEXT
segment_videoVIDEO
merged_videoVIDEO
textSTRING