Nodes/comfyui-AGSoft/🎬AGSoft MiniMax Base
ComfyUI Node

🎬AGSoft MiniMax Base

The parameter calculator that keeps MiniMax H3 samplers happy

By Art-xmaster·Created about a year ago·Updated a day ago· 32
🎬AGSoft MiniMax Base
  • copy_options
  • width
  • height
  • fps_int
  • fps_float
  • total_frames
  • duration_seconds
  • copy_options
◄modePreset►
◄preset1280×704 (16:9)►
◄invert_orientationfalse►
◄custom_width864►
◄custom_height480►
◄megapixels_value1.00►
◄aspect_ratio16:9►
◄frame_count_sourceSeconds►
◄length_seconds5►
◄frame_count124►

🎬AGSoft MiniMax Base isn't a video effect at all - it's a resolution and frame-count calculator, and it exists because MiniMax H3 is picky about numbers. H3, like its LTX ancestors, has hard format rules: width and height must be multiples of 32, the frame count has to land on the sequence 5, 22, 39, 56, 73... (that's 17×N+5), and the frame rate is fixed at 24fps. Feed it a "clean" 1280x720 at 100 frames and the sampler will error out or silently misbehave. This node does the math so you don't have to, then hands the results to your sampler inputs.

If you've ever fought an LTX-family workflow complaining about tensor shapes, you know the pain this removes. The node is a small, pure-Python utility - no models, no VRAM, nothing heavy - and the source spells out its job: "use this node before connecting to MiniMax H3 sampler nodes."

How it works

Three size modes:

  • Preset - pick from ~40 predefined sizes grouped by aspect ratio (square, photo, standard, cinema), all already multiples of 32. This is the "stop thinking" mode and the default.
  • Custom - type custom_width / custom_height and they get rounded up to the nearest multiple of 32 (the source example: 100×100 → 128×128).
  • Megapixels - give megapixels_value (target megapixels) plus an aspect_ratio, and it computes both dimensions.

invert_orientation swaps width and height, which works in Preset and Custom modes (not Megapixels - there the aspect ratio already defines orientation).

Frame count has its own two modes via frame_count_source: From seconds (set length_seconds, the node derives a frame count) or Manual (set frame_count directly). Either way the result is snapped to the 17×N+5 sequence with a minimum of 5.

Outputs

These are the values you wire into the sampler or empty-latent nodes:

  • width / height (INT)
  • fps_int (24) and fps_float (24.0) - some nodes want one, some the other, so you get both.
  • total_frames (INT) - the snapped frame count.

Install

Part of the comfyui-AGSoft pack. ComfyUI Manager → search "comfyui-AGSoft" → Install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Art-xmaster/comfyui-AGSoft

Restart. No models to download for this node - it's arithmetic.

Worth knowing: the sequence 17×N+5 and the 32-multiple rule aren't AGSoft inventions, they're the model's native constraints. If a workflow you downloaded has a custom resolution widget that produced a weird number of frames and it keeps failing, run it through this node and let it snap things before you blame the sampler.

CategoryAGSoft/MiniMaxH3

Inputs (11)

NameTypeDefaultDescription
modeCOMBOPresetFrame size mode: Preset (predefined sizes), Custom (own W/H), Megapixels (MP + ratio). Unused widgets hide automatically. --- Режим размера кадра: Preset (готовые размеры), Custom (свои W/H), Megapixels (MP + соотношение). Лишние виджеты скрываются автоматически.
presetCOMBO1280×704 (16:9)Predefined size WIDTH×HEIGHT (aspect), all multiples of 32. invert_orientation swaps W/H. --- Готовый размер ШИРИНА×ВЫСОТА (соотношение), все кратны 32. invert_orientation меняет W/H местами.
invert_orientationBOOLEANfalseSwaps width and height. Works in all modes (in Megapixels it swaps the computed size). --- Меняет ширину и высоту местами. Работает во всех режимах (в Megapixels — расчётный размер).
custom_widthINT86464–8192Frame width in px (Custom). Rounded UP to a multiple of 32. Range 64–8192, step 32. --- Ширина кадра в px (Custom). Округляется ВВЕРХ до кратности 32. Диапазон 64–8192, шаг 32.
custom_heightINT48064–8192Frame height in px (Custom). Rounded UP to a multiple of 32. Range 64–8192, step 32. --- Высота кадра в px (Custom). Округляется ВВЕРХ до кратности 32. Диапазон 64–8192, шаг 32.
megapixels_valueFLOAT1.000.01–8Target resolution in MP (0.01–8.0, step 0.01). W/H computed from aspect_ratio, multiples of 32. --- Целевое разрешение в MP (0.01–8.0, шаг 0.01). W/H считаются по aspect_ratio, кратны 32.
aspect_ratioCOMBO16:9Aspect ratio for Megapixels: 1:1, 3:2, 2:3, 4:3, 3:4, 16:9, 9:16, 21:9, 9:21. --- Соотношение сторон для Megapixels: 1:1, 3:2, 2:3, 4:3, 3:4, 16:9, 9:16, 21:9, 9:21.
frame_count_sourceCOMBOSecondsSeconds — frames = round(sec×24) aligned UP to 17N+5. Frames — exact count aligned UP to 17N+5. --- Seconds — кадры = round(сек×24) ВВЕРХ до 17N+5. Frames — точное число с выравниванием ВВЕРХ до 17N+5.
length_secondsFLOAT51–60Duration in seconds (1–60, Seconds only). Frames = round(sec×24) aligned UP to 17N+5, so it differs slightly from sec×24. --- Длительность в секундах (1–60, только Seconds). Кадры = round(сек×24) ВВЕРХ до 17N+5, поэтому число немного отличается от сек×24.
frame_countINT1245–99999Exact frame count (Frames only), aligned UP to 17N+5: 100 → 107, 124 → 124. --- Точное число кадров (только Frames), выравнивается ВВЕРХ до 17N+5: 100 → 107, 124 → 124.
copy_optionsoptAGSOFT_MINIMAX_COPYChain: the output passes all calculator parameters; a follower with the input repeats the master and collapses its calculator. --- Цепочка: выход передаёт все параметры калькулятора; ведомая нода со входом повторяет мастера и схлопывает свой калькулятор.

Outputs (7)

NameTypeDescription
widthINT—
heightINT—
fps_intINT—
fps_floatFLOAT—
total_framesINT—
duration_secondsFLOAT—
copy_optionsAGSOFT_MINIMAX_COPY—