Nodes/ComfyUI-Photoreal-Prompt-Builder/Image Edit Composer (kppb)
ComfyUI Node

Image Edit Composer (kppb)

Structured edit instructions so Klein's editing mode doesn't guess

By artokun·Created 7 months ago·Updated 3 months ago· 27
Image Edit Composer (kppb)
    • edit_prompt
    • edit_json
    edit_1_typereplace element
    edit_1_target
    edit_1_value
    edit_1_location
    preserve_identitytrue
    edit_2_typeadd element
    edit_2_target
    edit_2_value
    edit_2_location
    edit_3_typeadd element
    edit_3_target
    edit_3_value
    edit_3_location
    ig_quick_effectnone
    preserve_note

    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's edit_instructions input, or into the VLM Refiner's edit_prompt input 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.

    Categoryconditioning/klein

    Inputs (15)

    NameTypeDefaultDescription
    edit_1_typeCOMBOreplace element10 options: add element, remove element, replace element, change style, change environment, change outfit, +4
    edit_1_targetSTRING
    edit_1_valueSTRING
    edit_1_locationSTRING
    preserve_identityBOOLEANtrueAppend identity lock to prevent face/likeness drift during edits
    edit_2_typeoptCOMBOadd element10 options: add element, remove element, replace element, change style, change environment, change outfit, +4
    edit_2_targetoptSTRING
    edit_2_valueoptSTRING
    edit_2_locationoptSTRING
    edit_3_typeoptCOMBOadd element10 options: add element, remove element, replace element, change style, change environment, change outfit, +4
    edit_3_targetoptSTRING
    edit_3_valueoptSTRING
    edit_3_locationoptSTRING
    ig_quick_effectoptCOMBOnone15 options: none, add rain, add snow, add lens flare, add bokeh background, add golden dust particles, +9
    preserve_noteoptSTRING

    Outputs (2)

    NameTypeDescription
    edit_promptSTRING
    edit_jsonSTRING