diff --git a/README.md b/README.md index 67fdc77..633038d 100644 --- a/README.md +++ b/README.md @@ -462,7 +462,7 @@ Check [Mased Qwen Edit Workflow](https://github.com/scraed/LanPaint/tree/master/ ### Example Qwen Image 2.1 Image Edit: Masked InPaint(LanPaint K Sampler, 5 steps of thinking) -Qwen-Image 2.1's image edit model works under a mask. `Text Encode Qwen Image 2.1` takes your canvas as `` plus any extra references, and it is the only 2.1 text encoder that keeps the alpha channel of a reference (the older `Text Encode Qwen Image Edit Plus` drops it). Add `LanPaint_ImageEncode` with a mask and the instruction only lands inside that mask - here a second reference supplies the material, and the headband, stitching and hinges come back pixel-identical. Grab the workflow and images from `examples/Example_32` (or drag `InPainted_Drag_Me_to_ComfyUI.png` into ComfyUI); use your own pictures from the official [Qwen Image 2.1 Image Edit template](https://docs.comfy.org/tutorials/image/qwen/qwen-image-2-1). +Qwen-Image 2.1's image edit model works under a mask. `Text Encode Qwen Image 2.1` takes your canvas as `` plus any extra references, and it is the only 2.1 text encoder that feeds the VAE all four channels (the older `Text Encode Qwen Image Edit Plus` trims a reference to RGB). Add `LanPaint_ImageEncode` with a mask and the instruction only lands inside that mask - here a second reference supplies the material, the earcups are rebuilt as oversized iridescent turbines that flare out over what used to be transparent background, and the headband, stitching and hinges come back pixel-identical. Grab the workflow and images from `examples/Example_32` (or drag `InPainted_Drag_Me_to_ComfyUI.png` into ComfyUI); use your own pictures from the official [Qwen Image 2.1 Image Edit template](https://docs.comfy.org/tutorials/image/qwen/qwen-image-2-1). ![Qwen 2.1 image edit: canvas, mask, material, result](https://github.com/scraed/LanPaint/blob/master/examples/Example_32/Comparison.png) [View Workflow & Masks](https://github.com/scraed/LanPaint/tree/master/examples/Example_32) ยท [Workflow JSON](https://github.com/scraed/LanPaint/blob/master/example_workflows/Qwen_Image_2.1_Edit_Masked_Inpaint.json) diff --git a/example_workflows/Qwen_Image_2.1_Edit_Masked_Inpaint.jpg b/example_workflows/Qwen_Image_2.1_Edit_Masked_Inpaint.jpg index f1897ed..c2fc619 100644 Binary files a/example_workflows/Qwen_Image_2.1_Edit_Masked_Inpaint.jpg and b/example_workflows/Qwen_Image_2.1_Edit_Masked_Inpaint.jpg differ diff --git a/example_workflows/Qwen_Image_2.1_Edit_Masked_Inpaint.json b/example_workflows/Qwen_Image_2.1_Edit_Masked_Inpaint.json index fcfe21f..efbe002 100644 --- a/example_workflows/Qwen_Image_2.1_Edit_Masked_Inpaint.json +++ b/example_workflows/Qwen_Image_2.1_Edit_Masked_Inpaint.json @@ -435,7 +435,7 @@ "cnr_id": "comfy-core" }, "widgets_values": [ - "The earcups of the headphones in are re-surfaced with the iridescent oil-slick titanium from : the exact same cup shapes, proportions and thickness as , now in mirror-polished rainbow metal with flowing cyan, magenta, violet and gold bands and a fine brushed grain. The headband, its stitching, the yokes and the hinges stay exactly as they are in . Studio product photography on a transparent background.", + "The earcups of the headphones in are rebuilt as oversized iridescent turbine cups faced with the oil-slick titanium from : larger than the originals and flaring out past their old outline into the empty space around them, radiating machined blades, mirror-polished rainbow metal with flowing cyan, magenta, violet and gold bands and a fine brushed grain. The headband, its stitching, the yokes and the hinges stay exactly as they are in . Studio product photography on a transparent background.", "", 1024 ], @@ -775,7 +775,7 @@ "cnr_id": "comfy-core" }, "widgets_values": [ - "## Qwen-Image 2.1 Image Edit + LanPaint, with a mask and with transparency\n\nThis is the official `Qwen Image 2.1 Image Edit` template with a mask bolted on. The edit\ninstruction names the references as `` / ``; `image_1` is the canvas,\n`image_2` is the material being borrowed.\n\nThe mask is what makes it inpainting rather than a re-render: LanPaint anchors everything\noutside it to the original on every step, so the headband, the stitching and the hinges come\nback untouched instead of merely similar. Keep the mask modest (about 15% of the frame here).\n\nTransparency survives because `Join Image With Alpha` puts the picture's alpha back on as a\n4th channel - `Load Image` hands alpha out on its `MASK` output, and that mask is `1 - alpha`,\nwhich is what this node wants, so there is no invert. `LanPaint_ImageDecode` then returns RGBA." + "## Qwen-Image 2.1 Image Edit + LanPaint, with a mask and with transparency\n\nThis is the official `Qwen Image 2.1 Image Edit` template with a mask bolted on. The edit\ninstruction names the references as `` / ``; `image_1` is the canvas,\n`image_2` is the material being borrowed.\n\nAlpha is a real channel here, not a mask bolted on at the end. `Text Encode Qwen Image 2.1`\nfeeds the vision tower the alpha composited over white, but hands the VAE all four channels,\nand `LanPaint_ImageEncode` encodes the picture as it arrives - so the alpha is denoised\nalongside the pixels and the rebuilt region can grow a new silhouette. `Join Image With\nAlpha` is what puts the alpha back on the image: `Load Image` hands alpha out on its `MASK`\noutput, and that mask is `1 - alpha`, which is exactly what this node wants, so there is no\ninvert. `LanPaint_ImageDecode` then returns RGBA.\n\nThe mask is a separate greyscale file, white = edit here, and it is deliberately larger than\nthe earcups so the new shape has room to flare out over what used to be transparent\nbackground. Everything outside it is anchored to the original on every step, so the headband,\nthe stitching and the hinges come back untouched rather than merely similar." ], "title": "How this works", "color": "#432", diff --git a/examples/Example_32/Comparison.png b/examples/Example_32/Comparison.png index e44748f..1428b63 100644 Binary files a/examples/Example_32/Comparison.png and b/examples/Example_32/Comparison.png differ diff --git a/examples/Example_32/InPainted_Drag_Me_to_ComfyUI.png b/examples/Example_32/InPainted_Drag_Me_to_ComfyUI.png index eea408e..f3c1fb1 100644 Binary files a/examples/Example_32/InPainted_Drag_Me_to_ComfyUI.png and b/examples/Example_32/InPainted_Drag_Me_to_ComfyUI.png differ diff --git a/examples/Example_32/Mask_Load_Me_in_Loader.png b/examples/Example_32/Mask_Load_Me_in_Loader.png index 05001a9..e2082fb 100644 Binary files a/examples/Example_32/Mask_Load_Me_in_Loader.png and b/examples/Example_32/Mask_Load_Me_in_Loader.png differ