Alfie: Democratising RGBA Image Generation With No $$$ ## Abstract Alfie is a zero-shot, fully automated pipeline designed to generate high-quality transparent (RGBA) illustrations from text prompts without the need for expensive fine-tuning. By modifying the inference-time behavior of pre-trained Diffusion Transformers (DiTs), Alfie ensures subjects are perfectly centered and provides an accurate alpha channel for seamless integration into graphic design workflows. ## The Challenge of Transparent Assets In graphic design, "cutout" images—subjects with transparent backgrounds—are essential for creating compositions like posters, banners, and UI layouts. However, most state-of-the-art text-to-image models, such as Stable Diffusion, are optimized to produce square RGB images with complex backgrounds. To obtain a transparent subject, designers typically face two suboptimal choices: 1. **Manual or Automated Matting:** Generating an image and then using a separate tool to remove the background. This often results in "sharp crops" where the subject is cut off by the image border, or artifacts around complex edges like hair. 2. **Fine-tuning:** Training a model specifically to predict an alpha channel (e.g., LayerDiffuse). This is computationally expensive, often requiring hundreds of GPU hours and significant financial investment. Alfie addresses these gaps by providing a "no-cost" way to generate centered, non-cropped, transparent subjects using existing pre-trained models. ## Methods: Inference-Time Innovation Alfie leverages the **PixArt-Σ** Diffusion Transformer and introduces two key inference-time modifications that bypass the need for training.  *[Alfie: Democratising RGBA Image Generation With No $$$, page 6](/pdf/art_78aa4a6f56194b8cb4a3ba2a9da82ffd#page=6)*
1. Subject Centering via Latent Masking
To prevent the model from "cropping" the subject at the edges, Alfie jointly generates a foreground latent (the subject) and a background latent (a uniform color). At each denoising step, it uses a squared mask to blend them, effectively "corralling" the subject into the center of the canvas.
2. Alpha Channel Estimation from Attention
Instead of training a new head for transparency, Alfie extracts information from the model's internal attention maps:
- Cross-Attention: Identifies pixels corresponding to nouns in the prompt (e.g., "cat," "hat"), providing a coarse subject map.
- Self-Attention: Captures pixel-to-pixel relationships to define textures and edges.
- Refinement: These maps are combined and processed via GrabCut, a classic graph-optimization algorithm, to produce a clean, precise alpha mask.
Key Insights
- Attention as a Masking Tool: Pre-trained Transformers already "know" exactly where the subject is. By filtering out generic nouns (like "photo" or "picture") from cross-attention analysis, high-quality foreground masks can be extracted without extra training.
- Solving the "Sharp Crop": By masking latents during the denoising process rather than post-processing, Alfie ensures the subject is a complete, usable design element that does not touch the frame edges.
- Efficiency: The method adds negligible overhead, increasing generation time by only about 1 second and maintaining the VRAM requirements of the base model.
Results and Performance
Alfie was evaluated using 3,000 prompts derived from the SAM (Segment Anything) dataset and compared against high-end matting models like ViTMatte.
- Subject Containment: Alfie achieved a >95% success rate in generating subjects fully contained within the canvas, compared to approximately 3% for the base PixArt-Σ model.
- User Preference: In a blind study, users preferred Alfie’s transparent illustrations over the traditional "generate-then-mat" approach 63% of the time.
- Speed: Total generation time is approximately 4.5 seconds on a single NVIDIA RTX 4090.
Limitations and Future Work
Alfie's quality is inherently tied to its backbone model; if PixArt-Σ fails to interpret a prompt, Alfie cannot correct the underlying image quality. Future research may explore making alpha intensity adaptive for translucent objects like glass or smoke, and further investigating how attention evolves throughout the entire denoising process to achieve even sharper edge detection.
Summary updated