Nodes/BV Node Pack/πŸŒ€ BV Latent Random Aspect Ratio [Deprecated]
ComfyUI Node

πŸŒ€ BV Latent Random Aspect Ratio [Deprecated]

Aspect-ratio roulette that's reproducible, because the seed decides

By BlackVortexAIΒ·Created 8 months agoΒ·Updated about 11 hours agoΒ· 6
πŸŒ€ BV Latent Random Aspect Ratio [Deprecated]
  • latent
  • latent
  • latent_width
  • latent_height
  • picked_ratio
β—„seed0β–Ί
β—„enabledtrueβ–Ί
β—„base_resolution_px1024β–Ί
β—„use_1_1trueβ–Ί
β—„use_3_2trueβ–Ί
β—„use_2_3falseβ–Ί
β—„use_4_3trueβ–Ί
β—„use_3_4falseβ–Ί
β—„use_16_9trueβ–Ί
β—„use_9_16falseβ–Ί
β—„use_21_9falseβ–Ί
β—„use_9_21falseβ–Ί

BV Latent Random Aspect Ratio picks a random aspect ratio from the ones you've enabled - determined by the seed, so the same seed always lands on the same ratio - and resizes a latent (or creates a fresh one) to match. It's aspect-ratio roulette that you can reproduce, reroll, and tune by toggling which ratios are even in the deck.

Who reaches for this? Anyone generating variation sets where they want the composition itself to vary - not just the seed noise. Instead of fixing one resolution and rerolling noise, you let every image roll a new shape. It's also the kind of node you'd use to shake up a batch when you're hunting for a composition you wouldn't have tried yourself. And since the output is a latent plus its width/height, it slots straight into a standard KSampler chain.

How it works

The mechanism, straight from the source: the node builds a candidate list from your ratio toggles, then picks one with idx = abs(seed) % len(ratios) - deterministic, reproducible, and evenly distributed across enabled ratios (roughly; it's a modulo, not a shuffle).

Then it sizes the latent. The clever part is the "1:1 base reference" logic:

  • If you connect a latent (optional LATENT input), the base becomes the current latent's smaller side - min(H, W) in latent units. So it resizes whatever you gave it, keeping it within your existing resolution budget.
  • If no latent is connected, it builds a blank latent from base_resolution_px (default 1024, meaning a 1024Γ—1024 reference), converting pixels to latent units with the usual /8 factor.

Either way, the chosen ratio is scaled so its longer side equals the base - no upscaling beyond the 1:1 reference, which is the "no upscale beyond base" note in the code. Resizing uses bilinear interpolation, and if the latent carries a noise_mask (for inpaint workflows), the mask is resized alongside with nearest-neighbor so it doesn't smear.

The inputs that matter

  • seed - this is the whole game. Change it to reroll; keep it to reproduce.
  • enabled - set false for pure passthrough (returns your latent untouched).
  • The nine use_* toggles - use_1_1, use_3_2, use_2_3, use_4_3, use_3_4, use_16_9, use_9_16, use_21_9, use_9_21. Only checked ratios are in the deck. Defaults lean landscape/1:1; portrait options are off until you flip them.
  • base_resolution_px - the 1:1 reference edge in pixels, only used when no latent is connected.

Outputs: latent, plus latent_width, latent_height (in latent units - remember it's /8 vs pixels, so don't feed these straight into a pixel-space resize), and picked_ratio (STRING, e.g. 16:9, or disabled (passthrough)).

Gotchas

If you disable every ratio, the node silently falls back to 1:1 rather than erroring - nice safety, but it can look like "my ratio toggles are broken." Also be aware that this is latent-space roulette: a 21:9 crop of a 1024 base is going to be short on pixels in the long dimension, which is exactly what models trained on that ratio handle better. Heads-up from the current source: this node is flagged deprecated in favor of the pack's separate BV Empty Latent Random Ratio node for the no-latent case, so for fresh workflows start there.

Install is the standard pack dance - ComfyUI Manager β†’ BV Node Pack, or clone into custom_nodes, restart, and hard-refresh. No models, no deps.

CategoryπŸŒ€ BV Node Pack/latent/Deprecated Legacy Nodes

Inputs (13)

NameTypeDefaultDescription
seedINT0-1125899906842624–1125899906842624β€”
enabledBOOLEANtrueβ€”
base_resolution_pxINT102464–16384β€”
use_1_1BOOLEANtrueβ€”
use_3_2BOOLEANtrueβ€”
use_2_3BOOLEANfalseβ€”
use_4_3BOOLEANtrueβ€”
use_3_4BOOLEANfalseβ€”
use_16_9BOOLEANtrueβ€”
use_9_16BOOLEANfalseβ€”
use_21_9BOOLEANfalseβ€”
use_9_21BOOLEANfalseβ€”
latentoptLATENTβ€”

Outputs (4)

NameTypeDescription
latentLATENTβ€”
latent_widthINTβ€”
latent_heightINTβ€”
picked_ratioSTRINGβ€”