Nodes/Eric Qwen-Edit & Qwen-Image Nodes/Eric Qwen-Edit Composite Unify
ComfyUI Node

Eric Qwen-Edit Composite Unify

Make a pasted-together collage read as one photograph

By EricRollei·Created 6 months ago·Updated 4 months ago· 20
Eric Qwen-Edit Composite Unify
  • pipeline
  • composite_image
  • composer_layers
  • seam_mask
  • foreground_mask
  • manual_mask
  • segment_1
  • segment_2
  • segment_3
  • segment_4
  • segment_5
  • image
  • used_mask
modeharmonize_only
user_prompt
prompt_modeappend
layer_visibility_threshold0.08
layer_max_count4
seam_dilate_px16
subject_protecttrue
subject_edge_blend_px1
ground_contact_px48
seam_feather_px16
vl_segmentstrue
ref_segmentsfalse
negative_prompt
steps8
true_cfg_scale3.0
seed0
max_mp8.0

Compositing is the easy part; making the composite look real is the hard part. You've cut a subject out, dropped it onto a new background, and now the lighting doesn't match, the shadow's missing, and the seam is visible to anyone looking. Eric Qwen-Edit Composite Unify is the "fix it so it looks shot in one go" node - it runs a single Qwen-Image-Edit pass over the composite and lets the model relight, re-shadow, and re-blend the whole image into something coherent.

It's built to sit directly downstream of ImageComposer from the author's companion pack (Eric_Composer_Studio), which is why it accepts a COMPOSER_LAYERS bundle plus seam_mask / foreground_mask inputs. But it works fine with a plain pasted image from any source - you just lose the smart masking.

The three modes, and which one to actually use

  • harmonize_only (default, and the README and source both say RECOMMENDED) - sends only the composite to Qwen-Edit with a baked-in harmonization prompt. No segments, no masks, no post-compositing. The model relights the entire image coherently. Start here, always.
  • whole - same as harmonize_only but also forwards your original segments (or the relayed composer layers) as extra VL/ref images. The theory is that it keeps each subject's identity straight; the practice is that segments shot under different lighting fight the harmonization. Only switch to this if a subject's identity is being lost.
  • seam_inpaint - the advanced one. Qwen runs on the full composite, then the result is composited back over the original through a feathered mask so untouched regions stay pixel-identical. This is the answer when you need the pixels outside the edit to not move (Qwen-Edit re-emits the whole frame, so harmonize_only shifts everything a little). It needs well-aligned masks; the author's own words are that misaligned masks produce "dissolved subjects or halos."

The inputs you'll touch

  • composite_image (required) - the collage to fix.
  • mode - the dropdown above.
  • user_prompt / prompt_mode - optional extra instruction. append tacks your words onto the baked preamble; replace lets you throw the preamble away and write your own.
  • composer_layers and the mask inputs (seam_mask, foreground_mask, manual_mask) - only relevant for seam_inpaint, and mostly only if you came from ImageComposer. manual_mask overrides everything else if you'd rather hand-paint the region.
  • seam_dilate_px, subject_protect, ground_contact_px, seam_feather_px - seam shaping for seam_inpaint. subject_protect (default True) keeps the seam band outside each subject's silhouette so subject pixels stay identical; ground_contact_px (48) extends a strip below subjects so the model can paint cast shadows and ground contact. Leave these alone until the default results bug you.
  • steps / true_cfg_scale / seed / max_mp - shared controls. Note the tooltip's advice: keep true_cfg_scale low (2.5-3.0) for harmonization, because high CFG over-applies the prompt and can make Qwen delete out-of-place subjects.

Outputs are image and used_mask (the mask the node actually used, which is handy for debugging seam_inpaint).

Realistic expectations

This is a fix-up pass over a model that re-emits whole frames, so it's not a magic "un-paste" button - for surgical seam repair where nothing else may move, seam_inpaint is the mode, and for everything else harmonize_only beats it on speed and cleanliness. It's also the wrong tool if your composite is fundamentally broken (subject lighting from outer space); the model harmonizes, it doesn't resurrect. Install: ComfyUI Manager search "Eric Qwen Edit", or git clone https://github.com/EricRollei/Eric_Qwen_Edit_Experiments into custom_nodes/, with the Qwen-Image-Edit model loaded by Eric Qwen-Edit Loader upstream.

CategoryEric Qwen-Edit

Inputs (28)

NameTypeDefaultDescription
pipelineQWEN_EDIT_PIPELINE
composite_imageIMAGEComposite from ImageComposer (or any other source). This is sent to Qwen-Edit as the main reference image.
modeCOMBOharmonize_onlyharmonize_only (RECOMMENDED): send ONLY the composite to Qwen-Edit. No segments, no masks, no post-compositing. Cleanest path — the model relights the whole image coherently. Try this first. whole: same as harmonize_only but ALSO forwards segments / Composer layers as extra VL/ref images. Can fight harmonisation; use only if a subject's identity is being lost. seam_inpaint: ADVANCED. Generates with Qwen, then post-composites via a feathered mask so untouched regions stay pixel-identical. Requires well-aligned foreground/seam masks; otherwise produces dissolved subjects or halos.
user_promptSTRINGOptional extra instruction. If empty, the baked harmonisation prompt is used as-is.
prompt_modeCOMBOappendappend: user_prompt is appended to the baked harmonise preamble. replace: user_prompt fully replaces the baked preamble (advanced).
composer_layersoptCOMPOSER_LAYERSBundle from ImageComposer's composer_layers output. Contains occlusion-baked, tightly-cropped, neutral-filled per-layer crops with visibility metadata. When connected, REPLACES the manual segment_1..5 inputs.
layer_visibility_thresholdoptFLOAT0.080–1Drop relayed layers whose visible footprint is below this fraction of their own area (default 8%). Avoids feeding heavily-occluded slivers.
layer_max_countoptINT40–5Cap on relayed layers (Qwen-Edit handles up to ~4-5 images including the composite). Lowest-visibility layers are dropped first. 0 = ignore the bundle.
seam_maskoptMASKSeam mask from ImageComposer (silhouette borders of each layer). Used as the base for seam_inpaint mode. If absent, a fallback edge band is derived from foreground_mask.
foreground_maskoptMASKCombined foreground mask from ImageComposer. Used for ground-contact extension (strip below subjects) and as fallback if seam_mask is absent.
manual_maskoptMASKOptional manual mask. If provided, OVERRIDES seam_mask + auto extensions (use this to constrain edits to a hand-painted region).
seam_dilate_pxoptINT160–256Outward growth of the seam band in pixels. Larger = wider halo of surrounding pixels gets harmonised. With subject_protect ON this band lives entirely OUTSIDE each subject — subject pixels are preserved.
subject_protectoptBOOLEANtrueON (recommended): seam band lives entirely outside each subject's silhouette — subject edges and interior stay pixel-identical to the composite. OFF: seam straddles the silhouette (more aggressive harmonisation but can blur / halo subject edges). Requires foreground_mask to take effect.
subject_edge_blend_pxoptINT10–16With subject_protect ON, allow this many pixels of soft blending INSIDE the subject silhouette so the join doesn't look stamped. 0 = perfectly hard edge. 1–2 px is invisible but smoother.
ground_contact_pxoptINT480–512Vertical strip extended DOWN from foreground silhouettes so the model can paint cast/contact shadows and ground/water interaction. 0 disables.
seam_feather_pxoptINT160–128Final Gaussian feather of the seam mask for smooth blend back into the composite.
segment_1optIMAGEOptional original segment (Picture 2). VL-only by default.
segment_2optIMAGEOptional original segment (Picture 3).
segment_3optIMAGEOptional original segment (Picture 4).
segment_4optIMAGEOptional original segment (Picture 5).
segment_5optIMAGEOptional original segment (Picture 6).
vl_segmentsoptBOOLEANtrueSend segments through the VL/semantic path so the model keeps each subject's identity straight.
ref_segmentsoptBOOLEANfalseSend segments through the VAE/ref pixel path. Default OFF — segments at DIFFERENT lighting can fight harmonisation. Enable only if a subject's identity is being lost.
negative_promptoptSTRINGWhat to avoid (e.g. 'plastic look, oversharpened, mismatched lighting').
stepsoptINT81–100Inference steps (8 for lightning LoRA, ~30-50 for base model).
true_cfg_scaleoptFLOAT3.01–20True CFG scale. Lower (2.5–3.0) is better for harmonisation — high CFG over-applies the prompt and can cause Qwen to delete out-of-place subjects (statues, small animals).
seedoptINT00–18446744073709550000Random seed.
max_mpoptFLOAT8.00.5–17Max output megapixels (Qwen-Edit can run up to ~17 MP at high VRAM).

Outputs (2)

NameTypeDescription
imageIMAGE
used_maskMASK