AlphaAnything: Extending Pretrained RGB Generators to RGBA
Qijie Wang, Zhixin Xu, Zhe Li, Haowei Zhu, Honghao Qiao, Bo Peng, Dawei Li, Bin Wang
cs.CV
2026-10-23
AlphaAnything adds LoRA and a one-way alpha branch to a frozen RGB VAE. Qwen-Image-Edit SAD drops from 181.5 to 30.4; blind preference over OmniAlpha is 100% excluding ties.
Compositing needs RGBA. RGB stores foreground color, and alpha stores how opaque each pixel is. Pretrained generators such as FLUX, Qwen-Image, and LongCat emit three-channel images, so the foreground is stuck to a background and cannot be dropped onto a new scene.
LayerDiffuse learns a transparency codec with a reconstruction loss. AlphaVAE and Qwen-Image-Layered train four-channel autoencoders. Generation then lives in that reconstructed latent space, and the original RGB decoder can change with it. On 295 source images, FLUX.1-dev's VAE moves from LPIPS 0.01216 to 0.04762 under AlphaVAE's RGBA VAE. Qwen-Image-Edit moves from 0.03807 to 0.05197 under OmniAlpha, and CIEDE2000 from 1.917 to 2.078. Zippo reuses a pretrained RGB VAE, but color and opacity still sit in separate latents.
AlphaAnything stays in the original RGB latent space and learns opacity from generative supervision alone, with no separate RGBA autoencoder stage.
Only two modules train. LoRA, a low-rank pair of matrices beside frozen weights, is inserted into the DiT at rank 64. The DiT is the transformer backbone that runs flow matching, the objective that predicts a velocity from noise toward clean data. The second module is an alpha branch on the frozen RGB VAE decoder, with 12.25M to 12.44M parameters. Sampling still emits one latent z. Color and opacity are read in the same decode.
The branch reads RGB features at every decoder scale. Bottleneck cross-attention uses alpha queries against RGB keys and values. Later scales apply rank-64 projections, gates, and learned upsampling, and write the result into the alpha state. Information moves only from RGB to alpha. Once z is fixed, RGB matches the original decoder, and changing the branch weights leaves that RGB untouched. Gradients from the alpha loss still pass through the frozen decoder into the LoRA. Opacity training changes which z the generator samples. The color of that z stays with the original decoder.
Fully transparent pixels have no physical RGB: when a is 0, stored color does not affect the composite. Training still needs a latent target on every pixel, so the method copies LayerDiffuse's multiscale color padding, pushes foreground color from coarse to fine into transparent regions, and encodes that dense RGB with the frozen encoder.
EA Loss (Endpoint-Aware Alpha Loss) supervises the compositing pair (a, 1-a). The ends of that pair are full transparency and full opacity. The loss uses the Fisher-Rao arc length u = arcsin(sqrt(a)). Deviations near 0 and 1 are stretched, while partial transparency stays continuous. The branch emits an unbounded score s. Scores at or beyond -1 and 1 represent the two endpoints exactly. Direct regression through the clipped map has zero gradient once a prediction sticks at the wrong endpoint. Under the Fenchel-Young form, a wrongly transparent prediction gets gradient -u, and a wrongly opaque one gets 1-u. Pixel gaps are then split by target foreground mass and background mass, and each group is reduced by a square root. Thin structures, holes, and small background leaks keep their weight, because a large field of already-correct pixels no longer averages them away.
The full objective is the backbone's flow-matching loss plus a noise-dependent EA term. At high noise the one-step clean latent is unreliable, and the alpha weight is reduced. Text-to-RGBA training uses 8,963 curated samples produced by an image model, on FLUX.1-dev, FLUX.2 Klein Base 9B, Qwen-Image, and LongCat-Image. Image-to-RGBA uses about 180K pairs from PrismLayersPro, on FLUX.2 and Qwen-Image-Edit. Every run is 20K steps, effective batch 16, and learning rate 1e-4 for both LoRA and the alpha branch.
Opacity is measured on image-to-RGBA. The authors' RGBA-Image set has 735 examples, each with a source image, an extraction instruction, and a target layer. The baselines are OmniAlpha and Qwen-Image-2.1. OmniAlpha is built on Qwen-Image-Edit, the same backbone family as the strongest AlphaAnything variant below. Soft IoU scores mask overlap, and higher is better. SAD is the sum of absolute alpha error divided by 1000, and lower is better.
| Method | Soft IoU ↑ | SAD ↓ | LPIPS ↓ | FG RGB L1 ↓ |
| OmniAlpha | 0.6881 | 178.43 | 0.0911 | 0.1052 |
| Qwen-Image-2.1 | 0.6932 | 181.52 | 0.0830 | 0.0868 |
| AlphaAnything / FLUX.2 | 0.8296 | 46.36 | 0.0207 | 0.1155 |
| AlphaAnything / Qwen-Image-Edit | 0.9223 | 30.38 | 0.0136 | 0.0746 |
The Qwen-Image-Edit variant is best on all six reported metrics. Alpha Grad is 27.52 against 70.88 and 81.62. Alpha Conn is 30.06 against 176.94 and 166.06. SAD is about one sixth of Qwen-Image-2.1. FLUX.2 improves the matte and composite LPIPS, but its foreground RGB L1 of 0.1155 is worse than both 0.1052 and 0.0868. A cleaner mask can still come with a worse foreground color.
Three annotators ran a blind pairwise study, image-to-RGBA only. Excluding ties, Qwen-Image-Edit wins 100% of decisions against OmniAlpha and 96.00% against Qwen-Image-2.1. Counting a tie as half a win, those rates are 80.56% and 79.49%. FLUX.2 scores 77.78% against OmniAlpha and 90.48% against Qwen-Image-2.1. Pair counts and annotator agreement are unreported.
Text-to-RGBA splits preference scores from distribution match. On 294 reference-free RGBA-Text prompts, LongCat reaches ImageReward 1.0013 against OmniAlpha's 0.7535. On 402 AlphaTest prompts, LongCat reaches ImageReward 1.5050 and Aesthetic 5.7171, against OmniAlpha's 1.2072 and 5.3542. The best FID is Qwen-Image-2.1 at 72.27. The four AlphaAnything variants sit between 74.98 and 77.31. On the 500 AIM-500 prompts, Aesthetic and ImageReward again favor all four variants, while the best FID remains Qwen-Image-2.1 at 69.58. Preference went up. Distance to the reference distribution did not.
The ablations match the design. On Qwen-Image-Edit, stopping alpha gradients into the DiT raises SAD from 30.38 to 37.05 and drops Soft IoU from 0.9223 to 0.9014. Replacing EA Loss with L1 on physical alpha raises SAD from 30.38 to 49.24 and drops Soft IoU from 0.9223 to 0.8830. On FLUX.2, the same L1 swap raises SAD from 46.36 to 53.25. Feeding alpha features back into the RGB pathway raises foreground RGB L1 from 0.0746 to 0.2435 on Qwen, and from 0.1155 to 0.1349 on FLUX.2. At inference the LoRA can be merged into the base weights. At 1024 resolution, 50 steps, and BF16, extra VAE decode time divided by full generation time is 0.228% to 0.445% across the four backbones. Decode itself moves from about 0.14 s to 0.25 s.
A finished RGB generator can grow an alpha channel while keeping its VAE, which avoids the LPIPS and color-difference regression above. The branch is about 12.3M parameters. LongCat's LoRA is about 39.32M. A run of 20K steps at global batch 16 is enough to attach it. Layer extraction, asset libraries, and any delivery that needs foreground plus mask are the practical fit.
The gain sits in the attachment recipe. The backbone is still the original RGB model. Part of the text-to-RGBA lift on Aesthetic and ImageReward comes from FLUX.2 and Qwen-Image against the SDXL backbone under LayerDiffuse. The same-family check is FLUX.1 against AlphaVAE: higher preference scores, worse FID. The stronger evidence for the method itself is the image-to-RGBA alpha error, and the blind preference, against OmniAlpha.
The paper says high-quality RGBA data, shared benchmarks, and shared metrics are still scarce, so data efficiency and cross-task generalization are unsettled. The text-to-RGBA training set has only 8,963 images, and those images come from a generative model.
RGBA-Text scores average a black composite and a white composite. They cover composite appearance only. RGBA-Image references were extracted by a generative model and then filtered by hand. The paper states that this extraction falls short of pixel-accurate recovery of the source. SAD and Soft IoU are measured against those generated references. How much of the drop is closer agreement with this particular label set stays open, because there is no separate human-matte set. In the text-to-RGBA galleries, multi-layer layouts are generated separately and arranged by hand.
Inference settings also differ. LayerDiffuse uses 25 steps and guidance 7 on SDXL. Qwen-Image-2.1 uses 40 steps and guidance 1.0, and without its official RGBA prompt template the outputs stay nearly opaque. AlphaAnything uses 28 or 50 steps for text-to-RGBA, with guidance 3.5 or 4. Step count, guidance, and template all move.
Matching RGB at a fixed z means the decoder function is unchanged. LoRA still moves the sampled z, so generated color can drift from the original RGB model. That drift is not quantified. FLUX.2's foreground RGB L1 on image-to-RGBA is worse than both baselines, so the one-way branch does not protect foreground color on every backbone. Across four extraction wordings, FLUX.2's Soft IoU stays inside 0.8276 to 0.8296, while SAD moves from 46.36 to 52.88. Overlap is stable. Absolute alpha error is more sensitive to phrasing. The human study covers image-to-RGBA alone, with no comparison among the authors' own backbones.