ConditioningStretch
Remap region conditioning when your resolution changes shape
- conditioning
- CONDITIONING
ConditioningStretch is the more general sibling of ConditioningUpscale in Davemane42's pack. Same problem - region conditioning coordinates don't follow the image when it changes size - but instead of a single scale factor it remaps areas from one explicit resolution to another. That makes it the right tool when your second pass changes the aspect ratio, or when you're moving between stages that don't share a clean integer scale.
Think of it as a proportional map: every conditioning entry that has an area key gets its rectangle re-placed as if it were drawn on the old canvas and then stretched to the new one. So a region that occupied the top-left quarter at 512×512 still occupies the top-left quarter at 768×512. Fullscreen conditioning (no area key) passes through untouched, same as its sibling. Everything is quantized to multiples of 8 afterward, because area coordinates live in latent space and the sampler expects them aligned to the 1/8 resolution grid.
Inputs and output
conditioning- CONDITIONING. The conditionings from the pass you're leaving.resolutionX/resolutionY- INT (default 512, step 64). The resolution the areas were originally drawn for.newWidth/newHeight- INT (default 512, step 64). The resolution you're moving to.- Output
CONDITIONING- the remapped conditioning, wired into the next pass's KSampler.
When to use it vs. ConditioningUpscale
This is the decision that actually matters. If your hires fix is a clean 2x LatentUpscale, just use ConditioningUpscale with scalar = 2 - fewer numbers to get wrong. Reach for ConditioningStretch when:
- The second pass changes aspect ratio (e.g. 512×512 first pass, then 768×512 for the final).
- The scale factor isn't a clean multiplier, so "times 2" would misplace regions.
- You're chaining through an intermediate resolution that doesn't divide evenly.
You have to feed it the old resolution manually - it can't infer it. Set resolutionX/resolutionY to whatever generated the original areas, or you'll get misplacement that's much harder to debug than a wrong scalar ever was.
Installing it
It lives in the same file as ConditioningUpscale and MultiAreaConditioning, so it comes with the pack. Manager search "ComfyUI_Dave_CustomNode", or:
cd ComfyUI/custom_nodes
git clone https://github.com/Davemane42/ComfyUI_Dave_CustomNode
Restart ComfyUI. No models, no extra dependencies.
One more thing worth knowing: this is a niche helper for workflows that use regional (area) conditioning and multi-resolution passes. If you don't use area conditioning at all - most people don't - neither this nor ConditioningUpscale will do anything to your conditioning, because there are no area keys to move. It's a tool you install and forget until the day it saves you.
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 | — |