Nodes/comfyui-music2video/🎡 Music2Video Resolution
ComfyUI Node

🎡 Music2Video Resolution

ComfyUI's Resolution Selector, plus a custom ratio and an aspect wire the main node actually accepts

By lazniakΒ·Created 3 days agoΒ·Updated about 12 hours agoΒ· 1
🎡 Music2Video Resolution
    • width
    • height
    • aspect_ratio
    β—„aspect_ratio16:9 (Widescreen)β–Ί
    β—„custom_ratioβ–Ί
    β—„megapixels1.0β–Ί
    β—„multiple8β–Ί

    If you've used ComfyUI's built-in Resolution Selector, you already know this node - it's the same arithmetic, the same preset list, verified against it across every preset. Width and height out of an aspect ratio and a megapixel target, both rounded to a multiple you choose. The reason it exists inside the Music2Video pack is the two small additions nobody else bothered to make.

    First, custom in the ratio dropdown plus a custom_ratio text box. Type 21:10, 5:4, or 2.39 (cinemascope, same as 2.39:1) and it computes dimensions no preset covers. You can even type a concrete size - 1920x1080 is read as the ratio it reduces to, which is 16:9. Only the shape is taken from it; megapixels still decides the actual size.

    Second - and this is the one that makes it worth wiring up - a third output called aspect_ratio, carrying the ratio in plain W:H form. You plug that straight into the Music2Video node's aspect_ratio input. The point is subtle but real: the main node writes image prompts for one aspect ratio and (when rendering) builds payloads for it. If you set that widget by hand and also set a latent size by hand, the two can drift apart - you prompt for 16:9 while your latent is square. Wire this node's aspect_ratio output in and the shape of the latent and the shape the prompts are written for cannot drift. A ratio arriving down a wire isn't held to the widget's six presets either, so a custom one reaches the prompts and the render payloads exactly as typed.

    Inputs

    • aspect_ratio - the eight standard presets plus custom.
    • custom_ratio - only read while the dropdown is on custom.
    • megapixels - target total MP. 1.0 is 1024Γ—1024 for a square.
    • multiple - both sides rounded to a multiple of this; 8 suits latents, raise it for a model that insists on 16 or 32.

    Outputs

    width, height (INT), and aspect_ratio (COMBO, the reduced W:H form). Nothing else.

    Install

    It's one of six nodes in the lazniak/comfyui-music2video pack, so installing the pack installs it: ComfyUI Manager β†’ search Music2Video β†’ install and restart, or git clone https://github.com/lazniak/comfyui-music2video ComfyUI/custom_nodes/music2video. Requires ComfyUI β‰₯ 0.3.48 like the rest of the pack. No dependencies beyond a normal ComfyUI install.

    Gotchas

    Honestly, few. It's a pure calculation node - no models, no network, no billing. The one thing that trips people: since the main node's aspect_ratio widget is a COMBO, a value arriving down the wire bypasses the preset validation, so if you wire something malformed it goes straight through to the render payloads and may be dropped by the endpoint rather than cleaned up. The node reduces what you type before it leaves, so keep your custom ratios in W:H or decimal form (2.39) and you'll be fine. If you're only using the pack's main node and never rendering, this node is optional - but it's the cheapest insurance against "why is my film the wrong shape" there is.

    CategoryMusic2Video

    Inputs (4)

    NameTypeDefaultDescription
    aspect_ratioCOMBO16:9 (Widescreen)The aspect ratio for the output dimensions. 'custom' reads 'custom_ratio' instead, for the shapes no preset covers.
    custom_ratioSTRINGUsed only while 'aspect_ratio' is 'custom'. Write it as width:height - '21:10', '5:4', '2.39' (cinemascope, same as '2.39:1'), or a size you already have in mind, '1920x1080', which is read as the ratio it reduces to (16:9). Only the shape is taken from it, never the size: 'megapixels' decides that.
    megapixelsFLOAT1.00.1–16Target total megapixels. 1.0 MP is 1024x1024 for a square.
    multipleINT88–128Both sides are rounded to a multiple of this. 8 suits latents; raise it for a model that insists on 16 or 32.

    Outputs (3)

    NameTypeDescription
    widthINTCalculated width in pixels.
    heightINTCalculated height in pixels.
    aspect_ratioCOMBOThe same ratio in the plain 'W:H' form, reduced ('1920x1080' comes out as '16:9'). Wire it into the Music2Video node's 'aspect_ratio' input: a ratio arriving down a wire is not held to that widget's six presets, so a custom one reaches the prompts and the render payloads as typed.