Nodes/ComfyUI LC123 Nodes/πŸ“ LC Aspect Ratio Simplifier (pipe)
ComfyUI Node

πŸ“ LC Aspect Ratio Simplifier (pipe)

The Aspect Ratio Simplifier that also speaks pipe

By lonecatone23Β·Created 2 months agoΒ·Updated 3 days agoΒ· 18
πŸ“ LC Aspect Ratio Simplifier (pipe)
  • image
  • mask
  • pipe
  • image
  • mask
  • width
  • height
  • latent
  • batch
  • resolution
β—„max_resolution2048β–Ί
β—„resolution_sourcefalseβ–Ί
β—„aspect_ratioβ–Ύβ–Ί
β—„custom_width1024β–Ί
β—„custom_height1024β–Ί
β—„swap_dimensionsβ–Ύβ–Ί
β—„upscale_methodlanczosβ–Ί
β—„proportioncropβ–Ί
β—„crop_locationcenterβ–Ί
β—„pad_color0, 0, 0β–Ί
β—„divisible_by8β–Ί
β—„batch_size1β–Ί

If you already like the Aspect Ratio Simplifier but your workflow speaks LC_PIPE, this is the same node with a pipe output bolted on top. Same controls, same behavior, one extra socket at the front of the output list: pipe, then image, mask, width, height, latent, batch, resolution. Where the plain version ends a chain with individual wires, this one packages everything into a bundle and gives you the raw wires, so you can feed both a pipe-consuming node and a plain wire in the same graph.

The source is honest about what it is: class LCAspectRatioPipeOut literally reuses AspectRatioSimplifier.INPUT_TYPES() and adds the LC_PIPE as the first return type. So every setting you know from the Simplifier is here - resolution_source (off = size from the input image/mask, on = preset or custom), the social-media presets from Instagram Portrait through CivitAI Cover to 21:9 Ultrawide, custom_width/custom_height, swap_dimensions, upscale_method (lanczos default), proportion (stretch/resize/crop/pad/total_pixels), crop_location, pad_color, divisible_by (8 by default, the latent-friendly multiple), max_resolution clamp, and batch_size for the empty latent. Nothing changes about the sizing logic - this is purely an output-format decision.

So the real question is when to pick this over the plain node. The answer is the context-bus rule: when the same size information needs to travel to several downstream consumers, or when you're already running an LC_PIPE chain and don't want to re-enter the bundle later with an unpack node. Wire the pipe to wherever else expects a pipe (a sampler-configure pipe node, another Get, an LC Pipe Edit), and use the plain sockets where you want explicit numbers. Both from one node, no duplication.

The one thing worth flagging is the stale-context failure mode, which is inherent to pipes rather than specific to this node. The bundle is a snapshot: if you resize the image after this node, the pipe still carries the old size until you rebuild it. So put this node at the point where the sizing is final, not mid-chain - otherwise you'll unpack width somewhere downstream and get yesterday's value. It's the debugging tax you trade for a legible graph, and it's worth paying on big workflows.

The display name is a little funny - this node shows up as "πŸ“ Aspect Ratio Simplifier (pipe)" in the node menu, which reads like a variant label rather than a separate node, but it is a distinct class. If you search for "Aspect Ratio" and see two very similar entries, this is the one with the pipe output.

Install is the standard LC123 clone:

cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes

Restart, no pip deps. If you're already on the plain Simplifier and your graph doesn't touch pipes, there's no reason to switch - but the moment you adopt the pipe pattern, this is the version you want at the sizing stage.

CategoryLC123/image

Inputs (14)

NameTypeDefaultDescription
max_resolutionINT20480–16384Clamp longer side. 0 = no clamp.
resolution_sourceBOOLEANfalseOff: size from image/mask. On: use preset or custom width x height.
aspect_ratioCOMBOPreset ratio when using custom/preset source.
custom_widthINT102416–16384Target width for custom size.
custom_heightINT102416–16384Target height for custom size.
swap_dimensionsCOMBOSwap width and height after size is chosen.
upscale_methodCOMBOlanczosResampling filter. Lanczos is a good default for photos.
proportionCOMBOcropstretch=force size; resize=fit inside; crop=fill+crop; pad=fit+letterbox; total_pixels=match pixel budget.
crop_locationCOMBOcenterCrop anchor when proportion is crop.
pad_colorSTRING0, 0, 0RGB for pad mode. 0-255 or 0-1.
divisible_byINT81–128Round width/height to a multiple of this (8 is typical for latents).
batch_sizeINT11–4096Empty latent batch. Image/mask batch is preserved from input.
imageoptIMAGEβ€”
maskoptMASKβ€”

Outputs (8)

NameTypeDescription
pipeLC_PIPEβ€”
imageIMAGEβ€”
maskMASKβ€”
widthINTβ€”
heightINTβ€”
latentLATENTβ€”
batchINTβ€”
resolutionINTβ€”