ComfyUI_Subject_Manager
Subject Manager node for ComfyUI
ποΈ ComfyUI Subject Manager
Subject Manager is a multimodal visual asset management suite for ComfyUI. It organizes, trims, and injects references (Images, Audio, Video, and Prompts) into multimodal generative models (Designed primarily for MiniMax H3 but can easily be adapted to other formats.).
Featuring an in-graph DOM interface directly inside the ComfyUI canvas, it builds structured libraries of Characters, Objects, and Environments while automatically generating synchronized prompt templates.
<img width="1694" height="718" alt="capture" src="https://github.com/user-attachments/assets/a2d08b8d-2988-4595-8653-7effc3418530" /> <img width="880" height="943" alt="20260820_185625" src="https://github.com/user-attachments/assets/376d68e3-a9d3-4c95-9fac-d495aa7a9003" />β¨ Key Features
π¨ 1. In-Graph UI Widget
- Custom Category Tabs: Create, rename, reorder, and color-code sections (Characters, Props, Scenes).
- Grid & List Views: Visual cards with dynamic mosaic previews for image slots.
- Selection Logic: Single-click Solo Select or cumulative Always-On (β) multi-selection.
- Queue Randomization (π²): Per-section random rolls controlled by a deterministic
seed.
πΌοΈ 2. Multimodal Slots
- 4 Image Slots: Drag-and-drop reordering, visibility toggles, missing file alerts, and aspect ratio preservation.
- Audio Waveform Trimmer: Interactive waveform display with start/end trim handles and real-time playback.
- Video Trimmer: Embedded video player with frame-accurate trim controls.
- Native File Picker: System dialog with full UTF-8 support across Windows, macOS, and Linux.
π·οΈ 3. Prompt Synthesizer & Syntax Highlighting
- Tag Drawer: Assign semantic roles (Face / ID, Outfit, 3/4 Profile, Body Shape, Pose, Foley, Voice Timbre).
- Hover Tooltips: Preview exact generated prompt segments directly on hover.
- Syntax Highlighting: Live theme-based highlighting for
<Subject X>,<Picture X>,<Audio X>, and<Video X>. - Automatic Index Mapping: Resolves dynamic reference offsets across multiple active subjects on the fly.
π¦ 4. Portable & Safe ZIP Bundles
- Standalone
.zipExport: Packages presets with all referenced media in a single archive. - Automatic Compression: Converts heavy PNGs to JPEG 80% (or WebP with alpha) and WAVs to MP3 192k to minimize file size.
- Hardened Import Protection: Automatically prevents preset overwrites (
Preset (1)) with path traversal and file extension validation.
π§© Nodes Overview
1. SubjectManagerNode
- Main UI container node hosting the interactive graphical widget.
- Inputs:
seed(randomization control),subject_data(internal JSON payload). - Output:
subject_data(structured payload for the unpack node).
2. SubjectUnpackNode
- Decodes, processes, and outputs active media assets into the workflow.
- Parameters:
fps: Sampling framerate for video frames (default:24).image_max_megapixel: Proportional max-megapixel limit for images without cropping (default:1.0 MP).video_max_megapixel: Max-megapixel resolution for video frames (default:0.5 MP).max_duration: Maximum extraction duration for audio/video in seconds (default:15.0s).prefix: Multiline string prepended to the final prompt (default:subject_definitions: \n).
- Outputs:
image_1toimage_8: Image tensors (IMAGE).audio_1&audio_2: Audio dictionary structures (AUDIO).video_1_images,video_1_audio: Frame sequences (IMAGE) and audio track (AUDIO) for Video 1.video_2_images,video_2_audio: Frame sequences (IMAGE) and audio track (AUDIO) for Video 2.prompt: Final combined prompt with synchronized reference numbering.
π₯ Installation
cd ComfyUI/custom_nodes/
git clone https://github.com/Fictiverse/ComfyUI_Subject_Manager.git
π Quickstart
- Add
SubjectManagerNodeandSubjectUnpackNodeto your workflow. - Connect
subject_databetween both nodes. - Open the UI, click
+ Add Subject Card, populate image/audio/video slots, configure tags, and clickSave. - Route
image_1,audio_1, andpromptoutputs to your downstream generation nodes. - Click Queue Prompt.
π Supported Formats
| Media Type | Allowed Extensions |
| :--- | :--- |
| Images | .jpg, .jpeg, .png, .webp, .bmp |
| Audio | .mp3, .wav, .flac, .aac, .ogg, .m4a |
| Video | .mp4, .webm, .mkv, .mov, .avi |
π License
This project is licensed under the GNU General Public License v3.0 (GPLv3).