Nodes/comfyui-jbnodes/Film Aspect Ratio
ComfyUI Node

Film Aspect Ratio

Generate at film-native sizes, not random ones

By AlbertJBurton·Created 6 months ago·Updated 3 months ago· 1
Film Aspect Ratio
    • width
    • height
    • empty_latent
    • film_format
    film_format
    resolution
    swap_dimensionsfalse
    batch_size1

    Generated images look most like film when they're composed like film - and composition starts with the frame. FilmAspectRatio is the node that sets your generation canvas to a real film format's aspect ratio instead of whatever the sampler's Empty Latent happened to default to. It hands you width, height, a ready-made empty latent, and a FILMFORMAT object, all matching.

    This is the node to reach for before you press generate. Feeding its empty_latent into the KSampler means the diffusion model works at a 3:2 (135), 1:1 (6x6), or 4:5 (4x5) canvas from the first step - so the composition is born framed, rather than you cropping a 16:9 image down later and losing half the scene. It also avoids the classic failure mode of generating way above a model's native resolution and getting tiled or repeated artifacts; the pack's preset latent sizes stay sane.

    How it works

    Pick film_format from the same format list as the rest of the pack (135, 120 6x4.5/6x6/6x7/6x9, 4x5, 8x10). The resolution dropdown is a dynamic widget that fills in with that format's preset latent sizes - for 135 that's 1152x768 (Standard), 1728x1152 (High), and 2304x1536 (Ultra High), all in the correct 3:2 ratio. swap_dimensions rotates the frame to portrait, and batch_size (1–16) sets how many latents the empty latent carries - handy if you're generating a roll of frames at once.

    The node reads the format's frame dimensions and latent presets from the pack's film_formats.json, computes the matching width/height, and creates an empty latent at that size.

    The outputs

    Four of them, and you'll use three:

    • width, height - the integers, if you want to drive other nodes with them.
    • empty_latent - plug this straight into a KSampler's latent input. This is the main event.
    • film_format - the FILMFORMAT object to hand to CameraLab (and later FilmGrainLab) so the whole pipeline knows the frame size.

    Install

    Standard pack install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/AlbertJBurton/comfyui-jbnodes.git
    cd comfyui-jbnodes
    pip install -r requirements.txt
    

    Restart ComfyUI, or find "comfyui-jbnodes" in ComfyUI Manager.

    Gotchas

    • The resolution dropdown is dynamic (it depends on the format you picked), so it populates in the browser UI. If you're calling the node by raw API and it arrives as a null option, that's the known dynamic-widget behavior - in normal ComfyUI usage just pick it from the menu.
    • Don't crank "Ultra High" just because it exists. If your model struggles past its native training resolution you'll get duplicated anatomy and tiling - this node gives you film-ratio sane sizes, not license to blow past the model's ceiling.
    • The empty latent is sized for the format; if you upscale later, do it after the film pipeline, not before.
    CategoryJBNodes/Utility

    Inputs (4)

    NameTypeDefaultDescription
    film_formatCOMBO7 options: 135, 120 (6x4.5), 120 (6x6), 120 (6x7), 120 (6x9), 4x5, +1
    resolutionCOMBO1 options:
    swap_dimensionsBOOLEANfalse
    batch_sizeINT11–16

    Outputs (4)

    NameTypeDescription
    widthINT
    heightINT
    empty_latentLATENT
    film_formatFILMFORMAT