Edit One Region, Leave the Rest Untouched
Paint a mask over the part of an image you want to change, describe the change in words, and the model only edits that region — everything outside the mask stays pixel-identical to the original. It is the same idea as Photoshop's "Generative Fill" or Adobe Firefly's inpaint tool, but powered by Qwen-Image-ControlNet-Inpainting — a purpose-built inpainting ControlNet from the InstantX Team, layered on top of Alibaba's Qwen-Image base model. Supports object replacement, text modification, background replacement, and outpainting.
What it does
QWEN-Inpaint is a mask-based image editing node built on Qwen-Image-ControlNet-Inpainting, a ControlNet released by the InstantX Team specifically for mask-based inpainting and outpainting on top of Alibaba's Qwen-Image base model. The workflow: supply a mask (a black-and-white image showing which region to edit — white = "change this", black = "leave alone") together with a text prompt, and the model only modifies inside the mask. With the "Keep everything outside the mask pixel-identical to the input" option on, the rest of the image is preserved exactly. This is the classic inpainting workflow — the same pattern as Photoshop's "Generative Fill" or Adobe Firefly's inpaint tool. Because this is a ControlNet purpose-built for inpainting (rather than a general image-editing model given a mask afterwards), the model has been trained end-to-end to respect the mask boundary — which is why the four core use cases it advertises are object replacement, text modification, background replacement, and outpainting.
Problem it solves
- Change one region, keep everything else pixel-identical – The perennial pain of AI image editing: "just change the shirt color" often ends up subtly changing the face, background, or lighting too. Mask-based inpainting physically restricts the edit to the masked area
- Object replacement in a specific spot – Replace the cup on the table without the model repainting the table, wall, or hand holding it
- Object removal – Mask the object, prompt "remove", and the model fills the region with plausible background content
- Text editing in images – Fix a typo, rewrite a sign, replace a brand name, or translate on-image text — describe the new text in the prompt (e.g., "a red storefront sign that reads 'Grand Opening'")
- Object insertion – Add something new into a location described by the mask ("add a coffee cup on the desk")
- Localized retouching – Fix a small blemish, remove a wire, or clean up an artifact without disturbing surrounding pixels
- High-resolution inpainting on small regions – The "Crop padding around mask for higher-res fill" option zooms into the masked region for better detail, then blends the result back into the full image
Input/Output
- Input:
- Image (required) — the source image to edit
- Mask (required) — a black-and-white image the same size as the source, showing which region to change (white/opaque = edit this pixel, black = leave alone)
- Text prompt (optional) — describes what should replace the masked region
- Output: The edited image
- Same size and aspect as the input
- Only the masked region has changed (when the "keep outside pixel-identical" option is on)
*** Prompting Tips
Positive prompts do most of the work. Negative prompts have very limited effect on this model.
- Describe the whole final image, not just the change. The model performs best when the prompt describes both the masked area and the background around it. Example — instead of
"a red sneaker"for the masked area, write"a red sneaker on a wooden hardwood floor with soft window light". - Use descriptive language, not instructions. Say
"a green taxi driving on the road", not"replace the car with a green taxi". The model is a ControlNet, not an instruction-following editor. - Don't rely on the negative prompt to fix issues. The whole Qwen-Image family — including this ControlNet — uses
negative_prompt=" "(an empty placeholder) in its own official examples. Classic SD-style negative prompts like"blurry, low quality, watermark, extra fingers"will have little to no effect. If something looks wrong, rewrite the positive prompt in more detail. - CFG scale matters more than negative prompt. The
CFG scaleslider (default 4.0) is the primary lever for controlling how strictly the model follows your prompt. - For text-in-image edits, put the exact new text in quotes. When rewriting a sign or on-image label, spell out the exact words you want in the prompt (e.g.,
a wooden storefront sign that reads "Grand Opening"). Typography is not controllable through a font input on this model — style and size are inferred from the prompt and surrounding context.
- Parameters:
- CFG scale (1 – 10, default 4.0) — how strictly the model follows the text instruction
- Higher = follow the prompt more literally; lower = more creative freedom
- Crop padding around mask for higher-res fill (0 = off, default 0)
- When > 0, the model crops a region around the mask (with N pixels of padding), inpaints at higher resolution, then blends the result back. Useful when the masked area is small relative to the full image and you want more detail
- Keep everything outside the mask pixel-identical to the input (checkbox, default on)
- When on, only the masked pixels are changed — the rest of the image is guaranteed to match the input exactly (byte-for-byte). Turn off if you want the model to have latitude to also touch surrounding pixels for a more natural blend
How to Use
Typical inpainting flow:
- Input - Image Loader — the source image to edit
- (Mask source) — a mask image showing which region to change (white/opaque = edit, black/transparent = keep)
- Input - Text Input — an instruction describing what to put in the masked area ("replace with a red sneaker", "translate to English: 'Grand Opening'")
- QWEN-Inpaint — runs the masked edit
- Output - Image Viewer — the recomposed image
Accuracy & Speed
Model | InstantX/Qwen-Image-ControlNet-Inpainting — a ControlNet on top of Qwen/Qwen-Image |
Advertised use cases | Object replacement, text modification, background replacement, outpainting |
Training | Trained from scratch for 65K steps on 10M high-quality general and human images; 1328 × 1328 resolution, BFloat16, batch size 128, learning rate 4e-5, text drop ratio 0.10 |
Architecture note | The ControlNet consists of 6 double blocks copied from the pretrained Qwen-Image transformer layers |
Recommended prompting | Use descriptive prompts that describe the whole image (both the inpainted area and the background), not just an instruction for the masked region — the model is sensitive to this |
Precision | bfloat16 recommended |
Ecosystem | Native ComfyUI support (>= 0.3.59); community support on Liblib AI |
Model Source
- Hugging Face
- License: apache-2.0
Compliance & Provenance
Provider | InstantX Team (ControlNet weights) — on top of Alibaba's Qwen-Image base model (both open weights) |
Provider type | Specialized |
License | Apache 2.0 (ControlNet weights); Qwen-Image base model licensed separately by Alibaba |
EU AI Act risk class | Limited Risk |
Art. 50 transparency | Required — outputs are marked. See AI Policy §2. |
Region availability | Available globally |
Training data summary |
For more on how we classify models and mark outputs, see our AI Policy.