Conditioning Stretch (Inspire)
Keep area conditioning aligned when you upscale
- conditioning
- CONDITIONING
Here's the problem this solves, and it's a specific one: if you use area conditioning - the "Conditioning (Set Area)" style where you paint a prompt into a rectangle at explicit pixel coordinates - those coordinates are baked to the resolution you set them at. The moment you upscale the latent, the boxes stay put in pixel space and no longer line up with the bigger image. Your "cat in the top-left corner" region ends up covering a quarter of what it used to. Conditioning Stretch fixes that by rescaling the region coordinates to your new resolution.
It's lifted from Davemane42's old ComfyUI_Dave_CustomNode (the credit's right there in the Inspire README), repackaged so you don't have to install a mostly-abandoned pack for the one node you want.
How it works
Conditioning in ComfyUI can carry an area attached to it - a width, height, and offset that tells the sampler "only apply this prompt inside this box." Stretch reads those boxes and multiplies them by the ratio between the old resolution and the new one. Nothing about the prompt changes; only the geometry of where it applies. So a region defined against 512×512 gets remapped cleanly onto, say, 1024×1536.
If your conditioning has no area attached - a plain positive prompt with no Set Area / regional setup - this node does nothing useful. It's not an error, there's just no geometry to stretch. Worth knowing before you wire it in expecting magic.
The inputs that matter
conditioning- the area-conditioning you want to remap. Output is a single CONDITIONING you feed onward to your sampler.resolutionX/resolutionY- the original resolution the regions were defined at (both default 512).newWidth/newHeight- the resolution you're upscaling to.
That's the whole node. You tell it where the boxes came from and where they're going, and it does the arithmetic.
The sibling node, Conditioning Upscale (Inspire), does the same job with a single multiplier instead of explicit from/to resolutions - reach for that one when you're just doing a clean 2× and don't want to type four numbers. Stretch is the one to use when the aspect ratio changes or the numbers aren't a tidy multiple.
How to install it
Easiest path is ComfyUI Manager: open Install Custom Nodes, search ComfyUI Inspire Pack, install, restart. From a terminal instead:
cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Inspire-Pack
Then restart ComfyUI. Inspire Pack is by Dr.Lt.Data - the same person behind ComfyUI Manager and the Impact Pack - so it's about as trustworthy and well-maintained as custom nodes get. It grabs a couple of pip dependencies on first launch; no model downloads for this node.
Common issues
The usual confusion is expecting this to upscale your image or latent. It doesn't touch pixels - it only rewrites conditioning geometry. You still need an actual latent upscale (or a fresh empty latent at the new size) in the graph; Stretch just keeps your regional prompts pointing at the right places once you've done it. If your regions drift after upscaling and you've got this node in place, double-check that resolutionX/Y actually matches the size you originally authored the regions at - that mismatch is the one thing that'll quietly throw the alignment off.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning | CONDITIONING | — | |
| resolutionX | INT | 51264–16384 | — |
| resolutionY | INT | 51264–16384 | — |
| newWidth | INT | 51264–16384 | — |
| newHeight | INT | 51264–16384 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |