ConditioningSetArea with tuples
Drive a region's area from computed numbers
- conditioning
- size_tuple
- offset_tuple
- CONDITIONING
This is Derfuu's take on ComfyUI's native ConditioningSetArea - the node that confines a prompt to a rectangle of the canvas, the backbone of regional prompting. The difference is in how you give it the geometry. Instead of four fixed widgets for width, height, x and y, it takes a size tuple and an offset tuple: two of Derfuu's (a, b) bundles. That sounds like a nitpick, but it's the whole reason to use it - because tuples come from Derfuu's math and Int to tuple nodes, you can compute the region rather than hand-type coordinates, and have it resize itself when your resolution changes.
How it works
Regional prompting exists because prompt adherence is global: describe two subjects in one prompt and they reliably swap attributes - the classic red-hair/blue-hair bleed. Setting an area on a conditioning tells the sampler "apply this prompt only inside this rectangle," so each subject gets its own region. This node stamps that area onto a conditioning using a size (width, height) and an offset (x, y) delivered as tuples, plus a strength. You typically build several of these for different regions and combine them before the sampler.
The inputs and outputs that matter
- conditioning (CONDITIONING) - the prompt to confine to a region.
- size_tuple (TUPLE) - the rectangle's
(width, height), fromInt to tupleor another Derfuu tuple node. - offset_tuple (TUPLE) - the
(x, y)position of the rectangle's corner. - strength (FLOAT, default 1) - how strongly this region's conditioning applies.
- Output: CONDITIONING - the area-tagged conditioning, combined with your other regions and fed to the sampler.
Where it fits
The payoff over the native node is parametric regions. Compute a width and height with the math nodes, pack them with Int to tuple, and one driver value can lay out an entire multi-region composition - then Derfuu's Conditioning area scale by ratio scales those regions to match a hires pass. Regional prompting has been a steady need since 2023 precisely because no 2026 model fully solves attribute bleed on its own, so tooling that makes regions reusable across resolutions earns its keep.
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 models - plain Python operating on graph data.
Common issues & troubleshooting
Coordinates must line up to the grid. Like the native version, areas work in units tied to the latent (multiples of 8 in pixel terms). Feed clean, divisible sizes and offsets or the region won't land where you expect.
Regions collage with hard seams. That's inherent to area-masked regional prompting, not this node - holding hard masks through the whole sample produces visible boundaries. The craft is where the masking stops and how regions blend, which lives in how you build the graph, not in this single node.
A region runs off-canvas. The offset places the rectangle's corner; a large size plus a large offset walks off the edge. Keep size + offset within the canvas.
Tuple node missing after an update. Derfuu's tuple nodes specifically have a documented history of being deleted between versions - a user reported exactly that and stopped using the pack over it. If a tuple node loads red, your installed version may not include it. Reinstall from the current repo; a ModuleNotFoundError about Derfuu_ComfyUI_ModdedNodes_legacy means a duplicated folder, so keep one named Derfuu_ComfyUI_ModdedNodes.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning | CONDITIONING | — | |
| size_tuple | TUPLE | — | |
| offset_tuple | TUPLE | — | |
| strength | FLOAT | 1.00 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |