Change Latent Dimensions
Resize a latent without breaking its conditioning
- latent
- positive
- negative
- latent
- positive
- negative
If you've ever resized a latent mid-pipeline and then had your sampler produce weirdly composed output - subjects cropped wrong, framing that doesn't match what you asked for - the usual culprit is conditioning that no longer agrees with the latent it's attached to. Models like SDXL bake target width/height into the conditioning itself, and if you change the latent's size without updating that, you're feeding the sampler two things that disagree about the canvas. Change Latent Dimensions exists to keep a latent and its conditioning honest with each other when the size changes.
How it works
It's a three-in, three-out node: latent plus positive and negative conditioning go in, resized latent plus adjusted positive and negative conditioning come out. The point isn't just resizing the latent tensor - plenty of nodes do that - it's that the conditioning travels with it and gets updated to match, so what the sampler sees stays internally consistent. The new target size itself is set directly on the node in the editor rather than piped in from another node, so open it up in ComfyUI to see and change the value rather than looking for a separate width/height input in your graph.
The inputs and outputs that matter
latent(LATENT, required) - the latent you're resizing.positive(CONDITIONING, required) - your positive conditioning, tied to the same generation.negative(CONDITIONING, required) - your negative conditioning.
Outputs mirror the inputs exactly: latent, positive, negative - all three, resized/adjusted together, ready to hand straight to a sampler as a matched set.
How to install it
Search "Link Comfy Nodes" in ComfyUI Manager and install, or clone it manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Mister-Link/link-comfy-nodes
pip install -r link-comfy-nodes/requirements.txt
Restart ComfyUI afterward.
Common issues & troubleshooting
Forgetting to route the conditioning through it too. The whole reason this node exists over a plain latent-resize is that it keeps conditioning in sync - if you resize the latent here but keep using your original positive/negative conditioning elsewhere in the graph instead of this node's outputs, you've reintroduced the exact mismatch it's meant to prevent. Always take all three outputs downstream together, not just the latent.
Expecting a dimension input socket that isn't there. Because the target size is a value you set on the node itself rather than something wired in from another node, it's easy to go looking for a width/height input in the graph and not find one - that's expected; it lives on the node's own controls, not as a socket.
Mismatched aspect ratio surprising you. Changing a latent's dimensions without matching your model's preferred aspect ratios (SDXL's trained bucket sizes, for instance) can produce stretching or odd composition even with conditioning correctly synced - the conditioning fix solves the metadata mismatch, not a fundamentally bad target size. Pick dimensions your base model was actually trained around when you can.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | — | |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |
| positive | CONDITIONING | — |
| negative | CONDITIONING | — |