Budi HartonoandClaude Sonnet 5 20d0637de5 Reorder By Axis widget fields, share model list/default with Preset node
model now goes last (primary_dim, reference, aspect_ratio, batch_size,
model). Both nodes derive MODELS from presets.py's own order once at
module level, so whichever model is listed first there becomes the
default everywhere — no per-node edits needed when a new architecture
takes the top spot.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-14 19:34:42 +07:00
2025-06-07 19:54:50 +07:00
2025-06-07 19:54:50 +07:00
2026-08-14 17:51:37 +07:00
2025-06-07 19:54:50 +07:00

📐 CASNodes: Aspect Ratio Presets for ComfyUI

Unlock precision and convenience when generating empty latents for your favourite models in ComfyUI! CASNodes (Custom ASpect Ratio Nodes) lets you select popular aspect ratio and resolution presets—optimized for Krea, Flux.2, Qwen-Image, Flux.1, Stable Diffusion XL, and Stable Diffusion 1.5—or define your own by axis and ratio.


cas_aspect_ratio


✨ Features

  • Instant Dropdown Selection: Choose from a wide range of common image aspect ratios and sizes.

  • Supports Leading Models: Fully compatible with Krea, Flux.2, Qwen-Image, Flux.1, SDXL, and SD 1.5 — all locally-sampled diffusion models with a real ComfyUI LATENT/VAE pipeline.

  • Two Node Modes:

    • From Preset: Pick from curated model/ratio presets.
    • By Axis: Enter one dimension, pick aspect ratio, and auto-calculate the other.
  • Clean ComfyUI Integration: Appears under the standard latent category—no clutter, pure utility.


📦 Installation

  • Open ComfyUI
  • Go to Custom Node Manager
  • Search for comfyui-aspect-ratio-presets
  • Click Install

2. Manual (GitHub)

cd YOUR_COMFYUI/custom_nodes
git clone https://github.com/budihartono/comfyui-aspect-ratio-presets.git
  • Restart ComfyUI

🛠️ Usage

  1. Find your new nodes under the latent group:

    • CAS Empty Latent Aspect Ratio from Preset
    • CAS Empty Latent Aspect Ratio by Axis
  2. Preset Mode: Select a resolution and aspect ratio like:

    • 1024x1024 - 1:1 Square - SDXL
    • 912x512 - 16:9 Landscape - SD15
    • 1216x832 - 3:2 Landscape - Flux.1

    The output is a ready-to-use empty latent tensor, correctly sized for your model.

  3. By Axis Mode:

    • Enter a width or height.
    • Pick your aspect ratio (e.g., 3:2 Landscape).
    • The node calculates the matching dimension.

💡 Typical Workflow

graph LR
A[CAS Empty Latent Node] --> B(KSampler) --> C(VAEDecode) --> D(Output)
  1. Add a CASNodes latent node
  2. Connect it to KSampler (or any node needing a latent)
  3. Decode and save as usual!

📚 Supported Aspect Ratios & Models

  • All presets are tailored for leading models:

    • Krea
    • Flux.2
    • Qwen-Image
    • Flux.1
    • Stable Diffusion XL
    • Stable Diffusion 1.5
  • You can add your own in presets.py!


📝 Credits

Developed by @budihartono

Open source for the benefit of the community. Contributions are welcome, but please note: this project is provided as-is, and active support or responses to issues/pull requests may be limited or unavailable.


Enjoy supercharged workflows, perfectly matched to your favourite diffusion models!


S
Description
No description provided
Readme MIT
77 KiB
Languages
Python 84.3%
JavaScript 15.7%