π BV Latent Random Rotate 90
A seed-flip that spins your latent 90Β° β great for batch variety
- latent
- latent
- latent_width
- latent_height
BV Latent Random Rotate 90 does one thing: if enabled, it rotates your latent by 90Β° - but only when the seed says so. The rotation decision is a deterministic coin flip based on the seed, so the same seed always gives the same orientation. It's a tiny, cheap way to add real compositional variety to a batch without changing your model or your prompt.
The pitch: run a batch of seeds through your normal prompt, and roughly half come out rotated 90Β°. For someone generating moodboards or variation sheets, that's free composition exploration. It's also the kind of "jitter" node people reach for in data-augmentation style pipelines - rotate the latent before decoding and you get a genuinely different framing, not just different noise.
How it works
The logic is one line of Python at heart: rotate only when enabled is true and seed & 1 == 1 - i.e. when the seed's last bit is odd. Even seeds: no rotation, your latent passes through unchanged. Odd seeds: torch.rot90 with k=3, which is a fixed 90Β° rotation in latent space. That's the whole mechanism: a parity test on the seed.
The rotation happens on the samples tensor, and - nice detail - if the latent carries a noise_mask (common in inpaint/regional workflows), the mask gets rotated with it, so your masked region stays glued to the right part of the image. The outputs report the new latent dimensions in latent units: latent_width and latent_height swap after a rotation, and stay put otherwise.
One thing to internalize: this is a 90Β° rotation, not a random 0/90/180/270 picker. There are exactly two outcomes - original or a single 90Β° turn. If you want all four compass points, chain two of these with different seed feeds, or just accept the two-way flip.
Inputs and outputs
latent(requiredLATENT) - what gets rotated. Usually the output of a VAE encode or an empty latent node.seed(INT) - the decider. Odd flips, even doesn't.enabled(BOOLEAN, default true) - a master switch; false means pure passthrough.
Outputs: latent, latent_width (INT), latent_height (INT). The latent output feeds straight into your KSampler; the two ints are handy if you want to size something downstream to match the rotated result.
Gotchas
The most common "it's broken" moment is someone feeding it a seed that's even and concluding the node does nothing. It's not broken - the seed chose not to rotate. If you want visible rotation, vary the seed or check its parity. Second, remember these dimensions are in latent space (typically /8 of pixels), so don't feed latent_width into a pixel-space resize without multiplying. And because rotation happens before sampling, the model sees the unrotated latent as content - which is fine for variety but means it's not the same as "generating portrait and rotating the output image," since the latent-space rotation is lossless in a way an image rotation isn't (no interpolation).
Install is the pack standard: ComfyUI Manager β BV Node Pack, or git clone https://github.com/BlackVortexAI/bv_nodepack into custom_nodes, restart, hard-refresh. No models, no dependencies - this node is pure Python.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | β | |
| seed | INT | 0-1125899906842624β1125899906842624 | β |
| enabled | BOOLEAN | true | β |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | β |
| latent_width | INT | β |
| latent_height | INT | β |