Nodes/PortraitUtils/Edit & Composite Config
ComfyUI Node

Edit & Composite Config

One prompt, three stitch prompts, no socket forest

By heyburns·Created about a year ago·Updated 23 days ago· 3
Edit & Composite Config
    • edit_config
    ◄blend_opacity0.50►
    ◄stitch_opacity1.00►
    ◄inpaint_prompt►
    ◄stitch_prompt_1►
    ◄stitch_prompt_2►
    ◄stitch_prompt_3►

    What it's for

    The edit stage of a real-photo workflow needs four things: the instruction you're giving the editor model, how strongly you want the result blended back, how strongly the stitch should apply, and the short mask prompts that tell your segmenters what to stitch. In PortraitUtils 1.x that lived on a central node with a socket per setting. In 2.0 it's a bundle: Edit & Composite Config emits one PORTRAIT_EDIT_CONFIG_V2 wire and the consumers that care - Stitch by Mask, mainly - read what they need.

    If you've used rgthree Context or an Efficiency Nodes pipe, this is the same idea at a smaller scope: one config object per pipeline stage instead of one object for the whole graph. Which is the right size for it, honestly. A global context object gets stale and you can't see what's in it; a stage-scoped one is small enough to keep on screen.

    What's in it

    Six required widgets, no optional ones.

    inpaint_prompt is the multiline instruction for your editor model - the sentence that describes the change. Qwen Image 2.1, FireRed 1.1 and Klein all take this kind of whole-frame or masked instruction, and the 2026 answer to "how do I fix this region" is usually a masked edit with a sentence rather than a mask plus a ControlNet plus an adapter. This node is just the storage.

    blend_opacity (0.5 by default) and stitch_opacity (1.0) control two different blending routes in the stitcher - Stitch by Mask picks which of the two to use. Keep stitch_opacity at 1.0 unless you actually want the pasted result dialled back; it's the one that decides whether the stitched region is the model's output or a mix of it and the original.

    stitch_prompt_1, stitch_prompt_2, stitch_prompt_3 are single-line strings, and their existence is the point. The 1.x version had one multiline stitch_mask field; 2.0 splits it into three because the example workflow drives three separate segmentation inputs, and each wants its own short phrase. Short is the key word - these are mask prompts like jacket or left hand, not paragraphs.

    Wiring it

    One output, edit_config. Feed it directly to any PortraitUtils consumer that takes it, or park it on a Set node. To get a string out for a third-party node, use a reader:

    Edit & Composite Config ─┬─ edit_config ─> Stitch by Mask
                             ├─> (reader) Edit Prompt from Config [inpaint_prompt] ─> your editor's text encode
                             ├─> (reader) Edit Prompt from Config [stitch_prompt_1] ─> segmenter A
                             ├─> (reader) Edit Prompt from Config [stitch_prompt_2] ─> segmenter B
                             └─> (reader) Edit Prompt from Config [stitch_prompt_3] ─> segmenter C
    

    Three readers, three promptable segmenters (SAM 3 or Grounded SAM), three masks: that's the documented shape, and it's why the fields are separated rather than being one blob you'd have to split by hand.

    Where people get burned

    Two upgrade traps, both from the 2.0 release notes. First, a saved Edit Prompt from Config node still pointing at the retired stitch_mask selection needs to be changed to one of stitch_prompt_1 / _2 / _3 - the old value isn't migrated. Second, if the config node doesn't show all three stitch widgets after you refresh, recreate the node; widget lists don't always rebuild in place when a pack's schema changes. Both are the normal cost of a deliberate breaking release rather than a bug.

    And the usual bundle rule applies: edit_config will not connect to a STRING socket. That's what the readers are for.

    Install

    Part of PortraitUtils, via ComfyUI Manager - search PortraitUtils (publisher heyburns, GPLv3) - or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/heyburns/PortraitUtils
    /path/to/ComfyUI/venv/bin/python -m pip install -r PortraitUtils/requirements.txt
    

    Use ComfyUI's own Python interpreter, not a system one. The pack needs Python 3.10+ and installs numpy, Pillow>=9.1, opencv-python-headless>=4.10.0.84 and tifffile; keep a single OpenCV wheel variant in that environment. Restart the ComfyUI server after installing - a browser refresh won't pick up new Python nodes. The editor models themselves are separate downloads and are not handled by this pack.

    CategoryPortraitUtils/Config V2

    Inputs (6)

    NameTypeDefaultDescription
    blend_opacityFLOAT0.500–1—
    stitch_opacityFLOAT1.000–1—
    inpaint_promptSTRING—
    stitch_prompt_1STRING—
    stitch_prompt_2STRING—
    stitch_prompt_3STRING—

    Outputs (1)

    NameTypeDescription
    edit_configPORTRAIT_EDIT_CONFIG_V2—