https://github.com/FireRedTeam/LayerDiffuse-Flux
https://github.com/FireRedTeam/LayerDiffuse-Flux
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/FireRedTeam/LayerDiffuse-Flux
- Owner: RedAIGC
- Created: 2024-12-11T08:09:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-25T03:44:36.000Z (over 1 year ago)
- Last Synced: 2025-03-29T16:03:07.064Z (about 1 year ago)
- Language: Python
- Size: 31.9 MB
- Stars: 148
- Watchers: 5
- Forks: 9
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LayerDiffuse-Flux
This repo is a Flux version implementation of LayerDiffuse ([LayerDiffuse](https://github.com/lllyasviel/LayerDiffuse)).
We train a **new transparent vae** to adapt to Flux and train a **lora** to finetune Flux to generate transparent images.
||||||||
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
## Installation
+ Clone this repository.
```shell
git clone https://github.com/RedAIGC/Flux-version-LayerDiffuse.git
cd Flux-version-LayerDiffuse
conda create -n flux_layer python=3.10 -y
conda activate flux_layer
pip install torch==2.3.0 torchvision==0.18.0 --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt
```
+ download weights
``` shell
huggingface-cli download --resume-download --local-dir ./models RedAIGC/Flux-version-LayerDiffuse
```
+ Make sure that you have the following directory structure.
```
Flux-version-LayerDiffuse/
| - imgs
| - lib_layerdiffuse
| - models
| - layerlora.safetensors
| - TransparentVAE.pth
| ...
```
## Flux Transparent T2I
### demo
```shell
python demo_t2i.py --ckpt_path /your/path/to/FLUX.1_dev --prompt /your/prompt
```
### examples
| Examples: top to bottom: flux, flux-layer(ours), sdxl, sdxl-layer([LayerDiffuse](https://github.com/lllyasviel/LayerDiffuse)) |
|------------------------------------|
||
||
||
||
||
## Flux Transparent I2I
```shell
python demo_i2i.py --ckpt_path /your/path/to/FLUX.1_dev --image "./imgs/causal_cut.png" --prompt /your/prompt
```
Prompt: "a handsome man with curly hair, high quality"
Strength: 0.9
| Input (Transparent image) | Output (Transparent image) |
|------------------------------------|--------------------------------------------|
|  |  |
## Acknowledgements
Thanks lllyasviel for their great work [LayerDiffuse](https://github.com/lllyasviel/LayerDiffuse)
You can use style RGBA image to finetune the network to get better results.
## Contact
If you have any questions about the code, please do not hesitate to contact us!
Email: sunshuang1@xiaohongshu.com, xiangqiang1601@163.com