Image Edit Composer (kppb)
Structured edit instructions so Klein's editing mode doesn't guess
- edit_prompt
- edit_json
FLUX.2 Klein's neatest trick is that generation and editing live in the same checkpoint - you hand it a starting image plus an instruction and it edits in place. The catch is that the instruction needs to be a crisp imperative ("Replace the denim jacket with a leather bomber"), and if you free-type those you end up with contradictions like "add rain" and "change to overcast" in the same prompt. Image Edit Composer (kppb) is the structured way in: up to three stacked edit slots, each with a type, a target, a value, and a location, plus a one-click "IG quick effect" for the Instagram-y flourishes.
How it works
Each edit slot combines four fields, and the node turns them into a sentence:
edit_1_type- what kind of edit: add element, remove element, replace element, change style, change environment, change outfit, change hair, change makeup, add effect, or custom.edit_1_target- what you're affecting (e.g. "the jacket").edit_1_value- the desired result (e.g. "leather bomber").edit_1_location- optional where (e.g. "in the background").
The type decides how the fields combine: replace element becomes "Replace {target} with {value}", change hair becomes "Change the hair to {value}", add element becomes "Add {value}…". Fill target or value but not the one the type needs and the slot just emits nothing - no broken grammar in your prompt. Slots 2 and 3 are identical and optional, so you can stack "remove the necklace" + "add a choker" + "change to golden hour" in one pass. There's also ig_quick_effect, a single dropdown that drops in a prewritten effect sentence (rain, snow, lens flare, bokeh, neon glow, fog, confetti, sparkles, nighttime, golden hour…) - it's the same prose you'll find in the IG Effect List node, here as a one-off.
The outputs
edit_prompt- the compiled instruction string. Wire it into the Prompt Builder'sedit_instructionsinput, or into the VLM Refiner'sedit_promptinput if you're running the "image edit aware" mode so the VLM describes the final scene after your edits.edit_json- a structured JSON of the same instructions, handy for logging or feeding an automated pipeline.
The two remaining inputs matter more than they look: preserve_identity (default on) appends the identity-lock phrase so face and likeness don't drift while you're swapping outfits, and preserve_note is where you say "keep the pose and expression" - the node even prefixes it with "Keep …" for you so it reads as an instruction.
Installing and gotchas
Pack standard: ComfyUI Manager search "Photoreal Prompt Builder", or git clone into custom_nodes/ and restart. No pip deps. The node lives under conditioning/klein.
The trap with this node is remembering it only writes text. It does not mask anything - Klein's editing subgraph handles the actual inpainting, and this just supplies a clean instruction. And if your edits change lighting and environment and hair in three slots, don't be surprised when Klein merges them into something that obeys all three imperfectly; stacked edits are best kept to two real changes plus one effect. That's the honest limit of editing-with-text, and this node is at least honest about how it composes them.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| edit_1_type | COMBO | replace element | 10 options: add element, remove element, replace element, change style, change environment, change outfit, +4 |
| edit_1_target | STRING | — | |
| edit_1_value | STRING | — | |
| edit_1_location | STRING | — | |
| preserve_identity | BOOLEAN | true | Append identity lock to prevent face/likeness drift during edits |
| edit_2_typeopt | COMBO | add element | 10 options: add element, remove element, replace element, change style, change environment, change outfit, +4 |
| edit_2_targetopt | STRING | — | |
| edit_2_valueopt | STRING | — | |
| edit_2_locationopt | STRING | — | |
| edit_3_typeopt | COMBO | add element | 10 options: add element, remove element, replace element, change style, change environment, change outfit, +4 |
| edit_3_targetopt | STRING | — | |
| edit_3_valueopt | STRING | — | |
| edit_3_locationopt | STRING | — | |
| ig_quick_effectopt | COMBO | none | 15 options: none, add rain, add snow, add lens flare, add bokeh background, add golden dust particles, +9 |
| preserve_noteopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| edit_prompt | STRING | — |
| edit_json | STRING | — |