Controllable Layer Decomposition for Reversible Multi-Layer Image Generation

🏠 Homepage      πŸ“„ Paper      πŸ€— HuggingFace

πŸ“’ News

  • Dec 2025: Experiment checkpoints are released here! πŸŽ‰
  • Nov 2025: The paper is now available on arXiv. β˜•οΈ

πŸš€ Getting Started

πŸ”§ Installation

a. Create a conda virtual environment and activate it.

conda env create -f environment.yml
conda activate CLD

b. Clone CLD.

git clone https://github.com/monkek123King/CLD.git

πŸ“¦ Prepare model ckpt

a. Download FLUX.1-dev weights

from huggingface_hub import snapshot_download

repo_id = "black-forest-labs/FLUX.1-dev"
snapshot_download(repo_id, local_dir=Path_to_pretrained_FLUX_model)

b.Download adapter pre-trained weights

from huggingface_hub import snapshot_download

repo_id = "alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha"
snapshot_download(repo_id, local_dir=Path_to_pretrained_FLUX_adapter)

c. Download LoRA weights for CLD from https://huggingface.co/thuteam/CLD

ckpt
β”œβ”€β”€ decouple_LoRA
β”‚   β”œβ”€β”€ adapter
β”‚   β”‚   └── pytorch_lora_weights.safetensors
β”‚   β”œβ”€β”€ layer_pe.pth
β”‚   └── transformer
β”‚       └── pytorch_lora_weights.safetensors
β”œβ”€β”€ pre_trained_LoRA
β”‚   └── pytorch_lora_weights.safetensors
β”œβ”€β”€ prism_ft_LoRA
β”‚   └── pytorch_lora_weights.safetensors
└── trans_vae
    └── 0008000.pt

d. YAML configuration file

pretrained_model_name_or_path: Path_to_pretrained_FLUX_model
pretrained_adapter_path: Path_to_pretrained_FLUX_adapter
transp_vae_path: "ckpt/trans_vae/0008000.pt"
pretrained_lora_dir: "ckpt/pre_trained_LoRA"
artplus_lora_dir: "ckpt/prism_ft_LoRA"
lora_ckpt: "ckpt/decouple_LoRA/transformer"
layer_ckpt: "ckpt/decouple_LoRA"
adapter_lora_dir: "ckpt/decouple_LoRA/adapter"

πŸ‹οΈ Train and Evaluate

Train

python -m train.train -c train/train.yaml

Infer

python -m infer.infer -c infer/infer.yaml

Eval

Prepare the ground-truth samples.

python -m eval.prepare_gt

Evaluate to obtain the metric results.

python evaluate.py --pred-dir "Path_to_predict_results" --gt-dir "Path_to_gt_samples" --output-dir "Path_to_save_eval_results"

✍️ Citation

If you find our work useful for your research, please consider citing our paper and giving this repository a star 🌟.

@article{liu2025controllable,
  title={Controllable Layer Decomposition for Reversible Multi-Layer Image Generation},
  author={Liu, Zihao and Xu, Zunnan and Shu, Shi and Zhou, Jun and Zhang, Ruicheng and Tang, Zhenchao and Li, Xiu},
  journal={arXiv preprint arXiv:2511.16249},
  year={2025}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support