Nodes/πŸ—‚οΈ Subject Manager/πŸ“¦ Subject Unpack
ComfyUI Node

πŸ“¦ Subject Unpack

Where the subject library becomes real tensors and a prompt

By FictiverseΒ·Created 26 days agoΒ·Updated 25 days agoΒ· 10
πŸ“¦ Subject Unpack
  • subject_data
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • audio_1
  • audio_2
  • video_1_images
  • video_1_audio
  • video_2_images
  • video_2_audio
  • prompt
β—„fps24β–Ί
β—„image_max_megapixel1.0β–Ί
β—„video_max_megapixel0.5β–Ί
β—„max_duration15.0β–Ί
β—„prefixsubject_definitions: β–Ί

Subject Manager is the library; Subject Unpack is where the library gets handed to the model. You feed it the SUBJECT_DATA JSON from SubjectManagerNode, and it tears it apart into actual media tensors and a finished prompt - up to 8 images, 2 audio tracks, 2 videos (each as frames plus audio), and one combined text prompt. Everything the manager lets you organize, this node lets you wire in.

If you've used reference-conditioned image models, the shape will feel familiar - but this is built for MiniMax H3, the omni-modal video model that consumes images, audio, video, and text as one unified context. The prompt side is where this gets interesting: each subject card carries prompt templates with tags like <Picture 1> and <Subject 1>, and this node renumbers them into global slots and stitches them together.

How it works

The unpack() pass walks the sections in your library, then every card marked selected or always-on (⭐), and for each one:

  • loads its active images into tensors, proportionally resized to image_max_megapixel - no cropping, just a scale-down;
  • loads up to 2 audio files, applying your trim handles and capping at max_duration;
  • loads up to 2 videos, extracting frames at your fps target and downscaling frames to video_max_megapixel, plus the synchronized audio;
  • runs the card's prompt through adapt_prompt_references, which rewrites <Picture N>, <Audio N>, <Video N> to the correct global slot numbers, renumbers subjects, and drops any line that references media this card doesn't actually have active.

That last bit is the genuinely smart part. If a card's picture references image 3 but only one image is enabled, the whole line gets dropped instead of producing a dangling tag the model misreads.

The inputs that matter

  • subject_data (optional) - the JSON from the Manager node. Leave it disconnected and you get an empty default library.
  • fps - video frame sampling rate, default 24.
  • image_max_megapixel - cap for still images (default 1.0 MP). Proportional, so no aspect-ratio surprise.
  • video_max_megapixel - cap for video frames (default 0.5 MP). This is the memory control knob; drop it if your H3 pass is VRAM-thirsty.
  • max_duration - max seconds extracted from audio/video, default 15.
  • prefix - a multiline string prepended to the final prompt. The default subject_definitions: \n matches H3's expected structure - leave it unless you know what you're changing.

The outputs and where they go

image_1 through image_8 (IMAGE), audio_1/audio_2 (AUDIO), video_1_images + video_1_audio and video_2_images + video_2_audio, and prompt (STRING). Route the images/audio/video into your H3 multimodal conditioning and the prompt into your text encode, then queue.

Gotchas

  • Unfilled slots output None. Many downstream nodes hard-error on a None IMAGE input, so only wire the outputs you actually populated. This is the most common "it broke" report.
  • The media decoders are best-effort. Audio tries torchaudio, then PyAV, then soundfile; video tries PyAV, then OpenCV. All are optional imports - if none are installed, you silently get empty outputs. On a default ComfyUI install PyAV and torchaudio are usually present because the video ecosystem needs them; if your video outputs come back empty, that's the first thing to check.
  • The H3 license caveat. This pack is built for a model whose community license geofences out the US, EU, UK, and Korea. The node works fine, but if you're in one of those regions, running local H3 weights is a licensing question you should have settled before building the library, not after.
Categoryutils/subject_manager

Inputs (6)

NameTypeDefaultDescription
fpsINT241–120β€”
image_max_megapixelFLOAT1.00.1–100β€”
video_max_megapixelFLOAT0.50.1–100β€”
max_durationFLOAT15.00.1–600β€”
prefixSTRINGsubject_definitions: β€”
subject_dataoptSUBJECT_DATAβ€”

Outputs (15)

NameTypeDescription
image_1IMAGEβ€”
image_2IMAGEβ€”
image_3IMAGEβ€”
image_4IMAGEβ€”
image_5IMAGEβ€”
image_6IMAGEβ€”
image_7IMAGEβ€”
image_8IMAGEβ€”
audio_1AUDIOβ€”
audio_2AUDIOβ€”
video_1_imagesIMAGEβ€”
video_1_audioAUDIOβ€”
video_2_imagesIMAGEβ€”
video_2_audioAUDIOβ€”
promptSTRINGβ€”