Instructions to use WLuLi/AlphaAnything with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Inference
- Notebooks
- Google Colab
- Kaggle
|
Download README.md from WLuLi/AlphaAnything: direct link, hf CLI and curl.
- Browser
- Download file 4.37 kB
-
https://huggingface.co/WLuLi/AlphaAnything/resolve/main/README.md
- Command line
-
hf download hf://WLuLi/AlphaAnything/README.md
-
curl -L -o README.md https://huggingface.co/WLuLi/AlphaAnything/resolve/main/README.md
4.37 kB
| license: other | |
| license_name: mixed-flux-non-commercial-and-apache-2.0 | |
| license_link: LICENSE | |
| library_name: alphaanything | |
| base_model: | |
| - black-forest-labs/FLUX.2-klein-base-9B | |
| - black-forest-labs/FLUX.2-klein-9B | |
| - Qwen/Qwen-Image-2512 | |
| - Qwen/Qwen-Image-Edit-2511 | |
| base_model_relation: adapter | |
| tags: | |
| - alphaanything | |
| - rgba | |
| - lora | |
| - text-to-image | |
| - image-to-image | |
| # AlphaAnything Checkpoints | |
| [Paper](https://arxiv.org/abs/2610.32413) · [Project](https://wluli.github.io/AlphaAnything/) · [Code](https://github.com/WLuLi/AlphaAnything) | |
| Pretrained RGBA adapters (transformer LoRA + alpha decoder branch) for **AlphaAnything: Extending Pretrained RGB Generators to RGBA**. | |
| ## Checkpoints | |
| | Directory | Compatible base model(s) | Task | License | | |
| | --- | --- | --- | --- | | |
| | `flux2_klein_base_9b_t2rgba` | [FLUX.2 Klein Base 9B](https://huggingface.co/black-forest-labs/FLUX.2-klein-base-9B), [FLUX.2 Klein 9B (4-step)](https://huggingface.co/black-forest-labs/FLUX.2-klein-9B) | Text to RGBA | [FLUX Non-Commercial](flux2_klein_base_9b_t2rgba/LICENSE) | | |
| | `flux2_klein_base_9b_i2rgba` | [FLUX.2 Klein Base 9B](https://huggingface.co/black-forest-labs/FLUX.2-klein-base-9B), [FLUX.2 Klein 9B (4-step)](https://huggingface.co/black-forest-labs/FLUX.2-klein-9B) | Image to RGBA | [FLUX Non-Commercial](flux2_klein_base_9b_i2rgba/LICENSE) | | |
| | `qwen_image_2512_t2rgba` | [Qwen-Image-2512](https://huggingface.co/Qwen/Qwen-Image-2512) | Text to RGBA | [Apache-2.0](qwen_image_2512_t2rgba/LICENSE) | | |
| | `qwen_image_edit_2511_i2rgba` | [Qwen-Image-Edit-2511](https://huggingface.co/Qwen/Qwen-Image-Edit-2511) | Image to RGBA | [Apache-2.0](qwen_image_edit_2511_i2rgba/LICENSE) | | |
| Each directory contains `adapter_config.json`, `pytorch_lora_weights.safetensors`, `alpha_decoder.safetensors`, and its model-specific `LICENSE`. Both FLUX.2 Klein adapters trained on `FLUX.2-klein-base-9B` can also be loaded directly onto the 4-step distilled `FLUX.2-klein-9B` for fast inference. The matching base model is loaded separately via Diffusers; its access terms and license apply. | |
| ## Usage | |
| > [!IMPORTANT] | |
| > Each checkpoint directory contains both a transformer LoRA (`pytorch_lora_weights.safetensors`) and an alpha decoder branch (`alpha_decoder.safetensors`). Please load them together using the official [AlphaAnything](https://github.com/WLuLi/AlphaAnything) repository — calling `load_lora_weights` directly in Diffusers only loads the RGB LoRA and will not decode the alpha channel. | |
| Clone the [code repository](https://github.com/WLuLi/AlphaAnything), install dependencies, and download the checkpoints into `alphaanything/checkpoints/`: | |
| ```bash | |
| git clone https://github.com/WLuLi/AlphaAnything.git | |
| cd AlphaAnything | |
| pip install -r requirements.txt | |
| hf download WLuLi/AlphaAnything --local-dir alphaanything/checkpoints | |
| # Standard inference on FLUX.2 Klein Base 9B | |
| python scripts/flux2_klein/infer_t2rgba.py \ | |
| --checkpoint alphaanything/checkpoints/flux2_klein_base_9b_t2rgba \ | |
| --prompt "A delicate glass butterfly with translucent wings, isolated on a transparent background." \ | |
| --output-dir outputs/demo \ | |
| --seed 42 | |
| # Fast 4-step inference on distilled FLUX.2 Klein 9B | |
| python scripts/flux2_klein/infer_t2rgba.py \ | |
| --checkpoint alphaanything/checkpoints/flux2_klein_base_9b_t2rgba \ | |
| --base-model black-forest-labs/FLUX.2-klein-9B \ | |
| --prompt "A delicate glass butterfly with translucent wings, isolated on a transparent background." \ | |
| --output-dir outputs/demo_4step \ | |
| --num-inference-steps 4 --guidance-scale 1.0 --seed 42 | |
| ``` | |
| See the [code repository README](https://github.com/WLuLi/AlphaAnything#inference) for all four models and image-to-RGBA extraction commands. | |
| ## License | |
| Licenses apply per checkpoint directory to match their respective upstream base models: | |
| - **FLUX.2 Klein adapters** (`flux2_klein_base_9b_t2rgba/`, `flux2_klein_base_9b_i2rgba/`): governed by the [FLUX Non-Commercial License](https://huggingface.co/black-forest-labs/FLUX.2-klein-base-9B/blob/main/LICENSE.md) (non-commercial use only). | |
| - **Qwen-Image / Qwen-Image-Edit adapters** (`qwen_image_2512_t2rgba/`, `qwen_image_edit_2511_i2rgba/`): licensed under [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). | |
| See [LICENSE](LICENSE) and [NOTICE](NOTICE) for details. Please cite [our paper](https://arxiv.org/abs/2610.32413) when using these checkpoints. | |