Regional Prompts (Attention Img2Img)
Regional prompting on a photo you already have
- clip
- image
- conditioning
- width
- height
Regional prompting is great when you're generating from scratch, but what if the image already exists and you want to rewrite only part of it? That's this node: same attention-based regional machinery as the plain "Regional Prompts (Attention)" node, but built to start from a real image instead of an empty latent. Pick a source photo, box off a region, give it its own prompt, and that part gets re-imagined while the rest of the canvas holds its ground.
Mechanically it's the same story as its txt2img sibling - each regional prompt is CLIP-encoded separately, given a mask from its box, and the cross-attention is patched during sampling so each region's tokens stick to their own pixels. The differences are all about the image: the image input is a file picker (choose from your input folder, with upload support), the region canvas dimensions are taken from the actual image rather than typed in, and the node passes that source image straight through so it can drive a VAE encode downstream.
Inputs and outputs
image- the source image, picked from your input folder.base_prompt- the everywhere prompt; prepended to each region's prompt too.prompt_1throughprompt_4- per-region prompts.clip- your CLIP.
Outputs: image (the source, passed through so you can encode it), conditioning (feed this to your KSampler as the positive), and width + height (the source dimensions, handy for wiring an Empty Latent or for exactness checks). Note the conditioning here is the regional conditioning; you'll still pair it with the source image's latent in a normal img2img setup - denoise strength is yours to set on the sampler.
Where it fits
The classic use: you have a portrait or a scene and you want one area changed - a face, an object, a background patch - without re-rolling the whole image. Because regions blend smoothly (that's the attention method's calling card), edits sit in place without the hard rectangular patch a plain masked inpaint leaves behind. If you'd rather have hard isolation, grab the Latent Img2Img variant instead.
Install
Part of Steaked-nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/StealthNinja1O1/Steaked-nodes
Restart, or ComfyUI Manager → "Steaked-nodes". No extra dependencies or downloads.
Common issues
The usual img2img rules still apply: high denoise strength will re-roll everything, regional conditioning or not, so keep it low (0.3–0.5) if you want the unboxed areas to survive. If a region isn't changing, check the box is on the image and the prompt is non-empty. And since the canvas follows the source image, a very wide or tall source makes the boxes fiddly - drag carefully, and remember region state persists in the workflow.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | COMBO | 1 options: example.png | |
| base_prompt | STRING | — | |
| clip | CLIP | — | |
| prompt_1opt | STRING | — | |
| prompt_2opt | STRING | — | |
| prompt_3opt | STRING | — | |
| prompt_4opt | STRING | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| conditioning | CONDITIONING | — |
| width | INT | — |
| height | INT | — |