Generative Image Layer Decomposition with Visual Effects

Jinrui Yang, Qing Liu, Yijun Li, Soo Ye Kim, Daniil Pakhomov, Mengwei Ren, Jianming Zhang, Zhe Lin, Cihang Xie, Yuyin Zhou

Abstract

Recent advancements in large generative models, particularly diffusion-based methods, have significantly enhanced the capabilities of image editing. However, achieving precise control over image composition tasks remains a challenge. Layered representations, which allow for independent editing of image components, are essential for user-driven content creation, yet existing approaches often struggle to decompose image into plausible layers with accurately retained transparent visual effects such as shadows and reflections. We propose LayerDecomp, a generative framework for image layer decomposition which outputs photorealistic clean backgrounds and high-quality transparent foregrounds with faithfully preserved visual effects. To enable effective training, we first introduce a dataset preparation pipeline that automatically scales up simulated multi-layer data with synthesized visual effects. To further enhance real-world applicability, we supplement this simulated dataset with camera-captured images containing natural visual effects. Additionally, we propose a consistency loss which enforces the model to learn accurate representations for the transparent foreground layer when ground-truth annotations are not available. Our method achieves superior quality in layer decomposition, outperforming existing approaches in object removal and spatial editing tasks across several benchmarks and multiple user studies, unlocking various creative possibilities for layer-wise image editing.

Introduction

In professional image editing, layers are the fundamental unit of composition. Software like Adobe Photoshop relies on layered representations to provide users with independent control over different scene elements. However, most contemporary AI-driven editing tools, such as inpainting or object removal models, operate on "flat" single-layer images. This limitation becomes apparent during spatial editing tasks; for instance, moving an object often leaves behind its original shadow or results in a "pasted-on" appearance because the model fails to separate transparent visual effects—like shadows, reflections, and glows—from the background.

The primary challenge in developing automated layer decomposition models is the scarcity of high-quality training data. Specifically, there is a lack of datasets that provide ground-truth transparent foregrounds with natural shadows alongside perfectly inpainted backgrounds. This paper introduces LayerDecomp, a generative framework designed to address these challenges by treating image editing as a decomposition task.

Methodology: The LayerDecomp Framework

LayerDecomp is built upon a 5-billion parameter Diffusion Transformer (DiT). Unlike standard diffusion models that generate a single RGB image, LayerDecomp is architected to denoise two latent representations simultaneously: a 3-channel RGB background and a 4-channel RGBA foreground.

The LayerDecomp pipeline decomposes an input image into a clean background and multiple transparent foreground layers, enabling complex editing.

Technical Innovations

  • RGBA-VAE: To maintain the fidelity of transparency information, the authors fine-tuned a Variational Autoencoder (VAE) specifically for the 4-channel RGBA format.
  • Consistency Loss: To overcome the lack of real-world ground-truth transparent layers, the framework employs a consistency loss. The model predicts the background (BG) and foreground (FG) layers, blends them using alpha-compositing, and ensures the reconstruction matches the original input. This allows the model to learn accurate transparency and shadow placement even from "flat" real-world images.

Data and Training Strategy

To train a model capable of high-fidelity decomposition, a hybrid dataset was curated:

  1. Simulated Multi-Layer Data: 100,000 triplets (BG, FG with synthetic shadows, and Composite) were generated using a large-scale stock image library and a dedicated shadow synthesis pipeline.
  2. Camera-Captured Data: 6,000 pairs of real-world "counterfactual" images (the same scene with and without a specific object) were used to help the model generalize to natural lighting conditions and physical interactions.
  3. Evaluation Benchmarks: The model was rigorously tested against the RORD (real-world object removal), MULAN (synthetic multi-layer), and DESOBAv2 (shadow removal) datasets.

Results and Creative Applications

LayerDecomp demonstrates that decomposition is a superior paradigm for image editing compared to traditional inpainting. By forcing the model to "extract" the foreground, the resulting background inpainting is more accurate because the model develops a deeper contextual understanding of the occluded regions.

LayerDecomp enables a variety of downstream editing tasks such as resizing, moving, copying, and recoloring while maintaining physical consistency.

Quantitative and Qualitative Performance

Quantitatively, LayerDecomp significantly outperforms state-of-the-art models like ControlNet and SD-XL Inpainting. On the RORD benchmark, LayerDecomp achieved a PSNR of 24.79, surpassing the next best model (CNI) at 22.01. User studies further validated these findings: in blind comparisons for object removal, users preferred LayerDecomp 83.5% of the time. For spatial editing tasks like moving or resizing, the preference rose to over 87%.

A key advantage of this approach is its zero-shot flexibility. Once an image is decomposed, users can perform complex edits—such as recoloring an object, blurring the background, or duplicating elements—without needing to re-run the generative model, as the layers are already physically and visually consistent.

Conclusion and Future Work

LayerDecomp represents a significant step toward professional-grade automated image editing. While the model is highly effective, it remains sensitive to the accuracy of user-provided masks and can struggle with extremely complex occlusions (e.g., objects behind fences). Future research will focus on improving robustness to noisy inputs and expanding the framework to support a wider array of intricate visual effects, such as colorful caustics.

Summary updated

BibTeX
@inproceedings{yang2025generative,
  author = {Jinrui Yang and Qing Liu and Yijun Li and Soo Ye Kim and Daniil Pakhomov and Mengwei Ren and Jianming Zhang and Zhe Lin and Cihang Xie and Yuyin Zhou},
  title = {{Generative Image Layer Decomposition with Visual Effects}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  url = {https://openreview.net/forum?id=j561ct3YW5},
}
Figure