TL;DR
Stable-Layers is a reinforcement learning framework that fine-tunes image layer decomposition models using a vision-language model (VLM) as a judge, completely eliminating the need for paired training data. By pairing Flow-GRPO with a novel two-phase reward calibration strategy, the method significantly improves layer separation, mask cleanliness, and background inpainting compared to supervised baselines.
What Problem Does This Paper Address?
Image layer decomposition—breaking a single RGB image into a set of editable RGBA layers (like a Photoshop file)—is a holy grail for graphic designers and visual editors. However, training models to do this is notoriously difficult. A single image can be split in many equally valid ways, meaning standard supervised learning (which forces the model to regress toward a single "ground truth" target) penalizes perfectly good alternative solutions.
While researchers have tried using Vision-Language Models (VLMs) as automated judges to guide reinforcement learning (RL) without ground-truth data, they run into a subtle mathematical trap: score compression. When a VLM evaluates visually similar candidate decompositions in isolation, it tends to score them within a very narrow band. Popular RL algorithms like Group Relative Policy Optimization (GRPO) rely entirely on the variance within a group to calculate updates. Without variance, the learning signal flatlines.
Methods
Stable-Layers builds on top of Qwen-Image-Layered, a flow-matching transformer, and fine-tunes it using Flow-GRPO with Low-Rank Adaptation (LoRA).
To solve the score compression problem, the authors introduce a two-phase VLM reward protocol:
- Phase 1: Structured Individual Scoring: The VLM (Gemini-3-Flash) rates each candidate decomposition independently on a 0–5 scale across five distinct criteria: semantic separation, alpha cleanliness, background inpainting, feature distribution, and content validity.
- Phase 2: Relative Grid Calibration: To inject variance back into the system, all candidate images are tiled into a single comparison grid. The VLM is shown this grid and asked to re-score the candidates relative to one another, using the Phase 1 scores as context. This effectively stretches out the compressed scores and restores the within-group variance GRPO needs to learn.
Additionally, because Qwen-Image-Layered packs multiple RGBA layers into a single high-dimensional latent sequence, standard diffusion RL stabilization techniques (like RatioNorm) collapse. The authors fix this by introducing a sum-and-rescale modification that normalizes log-probabilities by the square root of the effective dimensionality ($\sqrt{D}$), keeping the optimization stable.
Datasets
- Training: Fine-T2I, an aesthetically filtered dataset of photographs and artworks. Crucially, the model trained entirely on these unlabeled images without any layer annotations.
- Evaluation:
- Crello dataset: Used to quantitatively measure per-layer reconstruction quality against ground-truth layers.
- LAION-Aesthetics: A held-out set of 480 images used for automated tracking of layer quality metrics throughout training.
Key Insights and Ideas
- VLMs are Cautious Judges in Isolation: The paper highlights that absolute rubric scoring fails in group-relative RL because VLMs lack a global calibration frame when looking at samples one by one. Forcing a side-by-side grid evaluation (Phase 2) is essential for fine-grained perceptual learning.
- The High-Dimensional Latent Penalty: When generative models pack multiple outputs (like layers) into a single sequence, the mathematical assumptions of standard RL stabilization break down. Scaling by $\sqrt{D}$ is a simple but necessary fix for sequence-packed latents.
- The Prompting Paradox: Interestingly, the authors found that conditioning the image generator on highly detailed prompts that mirrored the evaluation rubric actually degraded performance. A basic prompt ("a clean, well composed image") yielded much better stability and layer quality.
Key Results
Stable-Layers significantly outperformed the base Qwen-Image-Layered model both qualitatively and quantitatively:
- Fewer Artifacts: On the LAION-Aesthetics evaluation set, the average number of "bad layers" (blank or artifact-heavy layers) per decomposition dropped dramatically from ~1.65 to ~0.4.
- Better Inpainting: The quality of "Layer 0" (the background layer left behind when foreground objects are removed) rose from a score of ~0.38 to ~0.62. Instead of outputting solid black blocks or flat colors, the fine-tuned model successfully hallucinated plausible backgrounds.
- Lower Reconstruction Error: When evaluated on the Crello dataset, Stable-Layers achieved a lower mean RGB L1 error across all tested layer counts ($L=2, 3, 4$) compared to the base model.
Limitations and Future Work
Despite its success, Stable-Layers relies heavily on a proprietary commercial VLM (Gemini), which introduces API costs and vulnerabilities to model drift if the underlying API changes. Furthermore, due to compute and memory constraints during GRPO sampling, training was capped at a maximum of 5 layers per image, even though the base model technically supports up to 20 layers.
For future work, the authors suggest replacing the free-form numeric grid calibration with logit-based pairwise preferences to make the reward signal even more robust, and exploring ways to let the VLM automatically optimize its own evaluation rubrics.
Summary updated