Conditioning area scale by ratio
Resize a region's area proportionally
- conditioning
- CONDITIONING
If you do regional prompting - assigning different prompts to different rectangles of the canvas so the character on the left keeps her red hair and the one on the right keeps her blue - you've probably hit the annoying part: the area you painted onto a conditioning is defined in absolute pixels. Change your output resolution or run a hires pass and every region is now the wrong size and in the wrong place. Conditioning area scale by ratio fixes that by multiplying the area a conditioning already has by a ratio, so a region defined at one resolution follows you to another proportionally.
How it works
A conditioning in ComfyUI can carry an "area" - a width, height, and offset that says apply this prompt only to this rectangle (that's what ConditioningSetArea sets). This node reaches into that stored area and multiplies its dimensions by your ratio. Feed it the same 1.5 you fed your latent upscaler and the region scales in lockstep with the image. It's the conditioning-side companion to Derfuu's Latent Scale by ratio.
The inputs and outputs that matter
- conditioning (CONDITIONING) - the one that already has an area set on it. If there's no area, there's nothing to scale.
- modifier (FLOAT, default 1) - the ratio applied to the area's size.
2.0doubles the rectangle,0.5halves it. This is the knob you actually turn. - strength_modifier (FLOAT, default 1) - scales the conditioning's strength at the same time, separate from its size. Leave at 1 to keep strength as-is.
- Output: CONDITIONING - the same conditioning with a rescaled area, wired onward into your sampler (usually after combining with other regional conditionings).
Where it fits
Regional prompting is one of the more stable needs in the whole ecosystem - it's been a steady 20-to-40-threads-a-month topic since 2023 because prompt adherence is global and a single prompt describing two subjects reliably smears their attributes together. The tooling churns constantly, but the ComfyUI answer has long been the Set Area family of nodes. This scale-by-ratio node is glue for that world: it means you can author your regions once at a base resolution and reuse the graph across output sizes instead of re-typing pixel coordinates every time.
How to install it
ComfyUI Manager: search Derfuu_ComfyUI_ModdedNodes, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes
then restart. No dependencies, no model downloads - it's plain Python operating on data already in your graph.
Common issues & troubleshooting
Nothing changes when you scale. The conditioning has no area set. This node scales an existing area - it won't create one. Put a ConditioningSetArea (native or Derfuu's tuple version) upstream first.
Regions drift or overlap after scaling. Scaling multiplies the offset too, so a region near an edge can walk off-canvas at higher ratios. Scale the same factor you scaled the latent by, and sanity-check the layout at the target resolution.
Composition looks collaged with hard seams. That's a regional-prompting property, not this node's fault - hard area masks held through the whole sample produce visible boundaries. The usual fix lives elsewhere (blend back to base conditioning once composition forms), not in the scaling.
Missing node in an old workflow. Derfuu has deleted deprecated nodes on updates before rather than keeping them around, so an old graph may reference a name that's gone. A ModuleNotFoundError about Derfuu_ComfyUI_ModdedNodes_legacy means a duplicated folder - keep one copy named Derfuu_ComfyUI_ModdedNodes.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning | CONDITIONING | — | |
| modifier | FLOAT | 1.00 | — |
| strength_modifier | FLOAT | 1.00 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |