Nodes/Derfuu_ComfyUI_ModdedNodes/Conditioning area scale by ratio
ComfyUI Node Runs on cloud

Conditioning area scale by ratio

DF_Conditioning_area_scale_by_ratio – ComfyUI Node from Derfuu_ComfyUI_ModdedNodes

By Derfuu·Created 3 years ago·Updated 2 years ago· 455
Conditioning area scale by ratio
  • conditioning
  • CONDITIONING
modifier1.00
strength_modifier1.00

This one only makes sense if you already know what "conditioning area" means, so a quick recap: ComfyUI's built-in Conditioning (Set Area) node lets you restrict a piece of conditioning (a prompt, effectively) to a rectangular region of the canvas instead of the whole image - the standard mechanism behind regional prompting in ComfyUI, where different parts of an image follow different prompts. That region is defined in pixel coordinates and comes with its own strength value.

The problem DF_Conditioning_area_scale_by_ratio solves: if you set that area at one resolution and then resize the image or latent later in your workflow - a hires pass, a scale-up step - the area you carefully positioned no longer lines up. It was defined for the old size; the canvas underneath it just changed. This node takes an existing CONDITIONING (with its area already set) and rescales that area's size and offset by a ratio, so it keeps tracking the right patch of the image as the rest of your pipeline scales things up or down around it. It's a "modded" node from Derfuu_ComfyUI_ModdedNodes, a math-and-utility pack that's been part of ComfyUI since 2023.

Inputs and output

Three required inputs:

  • conditioning - the CONDITIONING whose area you're rescaling (it needs to already have an area set upstream, typically via ComfyUI's own Conditioning (Set Area))
  • modifier - the FLOAT ratio to scale the area's size by
  • strength_modifier - a separate FLOAT ratio applied to the conditioning's strength

One output: CONDITIONING, ready to feed into your sampler the same way any conditioning would.

The two modifiers are independent on purpose - you can rescale how big the region is without touching how strongly the model follows the prompt inside it, or the other way around. If you're just resizing the whole canvas uniformly, matching modifier to whatever ratio you're scaling the latent or image by (the same number you'd feed into DF_Latent_Scale_by_ratio or DF_Image_scale_by_ratio elsewhere in the graph) is what keeps the area aligned; strength_modifier is a separate creative dial, not something you need to touch just to keep positions correct.

Where it fits

This lives specifically in regional-prompting workflows that also resize partway through - set your regional areas at a base resolution, run this node with the same scale ratio you're applying to the rest of the pipeline right before or after a hires/upscale step, and the regions stay put relative to the content instead of drifting out of alignment. If your workflow doesn't do area-based/regional conditioning at all, you won't have a use for this node.

Installing

The whole pack installs together - no single-node install. Through ComfyUI Manager: search Derfuu_ComfyUI_ModdedNodes, install, restart ComfyUI. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes

then restart. No models, no unusual dependencies.

Troubleshooting

If it doesn't show up in the node menu right after installing, restart the server and hard-refresh your browser tab - that resolves the large majority of "installed but not visible" cases and isn't specific to this pack.

If your regional prompt seems to be landing in the wrong place after a resize, the first thing to check is whether modifier here actually matches the ratio you applied to the image or latent elsewhere in the graph - a mismatch between the two is the most likely reason a region that used to sit correctly drifts off after you change your scaling step.

Worth knowing about the pack generally: its maintainer has, in the past, removed deprecated nodes outright on updates rather than keeping a legacy-labeled copy around, which has broken workflows for people who relied on it over the long term. If an old workflow throws a missing-node error elsewhere after an update, that maintenance history is worth checking before assuming your ComfyUI install itself is broken.

CategoryDerfuu_Nodes/Modded nodes/Conditions

Inputs (3)

NameTypeDefaultDescription
conditioningCONDITIONING
modifierFLOAT1.00
strength_modifierFLOAT1.00

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING