Qwen-Image-Layered can decompose images into multiple RGBA layers, making them editable. It allows users to independently manipulate each layer and supports high-fidelity basic editing operations, such as recoloring, content replacement, text modification, deletion, resizing, and freely moving layer objects, without affecting other content. Qwen-Image-Layered offers the option to choose the number of layers, supports recursive decomposition, and enables infinite levels of fine‑grained processing. It also provides a practical web interface, allowing users to decompose images, export layers as editable PPTX files, and combine with Qwen-Image-Edit for transparent image editing.
Requires transformers version ≥ 4.51.3 (supports Qwen2.5‑VL) and installation of the latest version of diffusers along with related dependencies.
pip install git+https://github.com/huggingface/diffusers
pip install python-pptx
pip install psd-tools
Run the following script to launch a Gradio‑based web interface, where you can decompose images and export layers as pptx, zip, and psd files for flexible editing and moving of layers:
python src/app.py
If you need to edit specific decomposed layers, run the following script to launch a Gradio web interface and use Qwen‑Image‑Edit to edit images with transparency:
python src/tool/edit_rgba_image.py
After editing individual decomposed layers, you can merge them into a new image using the script below. Note: upload the layers in order from bottom to top:
python src/tool/combine_layers.py
After inputting an image, Qwen‑Image‑Layered can decompose it into multiple independent editable RGBA layers. Editing operations only affect the target layer and are physically isolated from other content, ensuring consistent editing results.
• Recoloring: Change the color of the first layer while keeping other content unchanged. • Element Replacement: Replace a girl with a boy in the second layer (requires Qwen‑Image‑Edit). • Text Modification: Modify text in a layer to say "Qwen‑Image" (requires Qwen‑Image‑Edit). • Element Deletion: Cleanly remove unwanted objects. • Scaling: Adjust object size without distorting the image. • Repositioning: Freely move objects within the canvas.
Check Qwen-Image-Layered's blog for more details.