CLoRA: Contrastive Test-Time Composition of Multiple LoRA Models for Image Generation
This repository contains the implementation of CLoRA, a method for composing multiple LoRA (Low-Rank Adaptation) models at test time using contrastive learning for improved image generation with Stable Diffusion.
UV is a fast Python package installer and resolver that ensures consistent dependency resolution.
If you don't have UV installed:
# Install UV using the official installer
curl -LsSf https://astral.sh/uv/install.sh | sh
# Or using pip
pip install uv
# Or using pipx
pipx install uv# Clone the repository
git clone https://github.com/gemlab-vt/clora
cd CLoRA
# Create virtual environment and install dependencies
uv sync# Check if everything is installed correctly
uv run python -c "import torch; print(f'PyTorch version: {torch.__version__}'); print(f'CUDA available: {torch.cuda.is_available()}')"The main demonstration and examples are provided in the Jupyter notebook.
# Start Jupyter Notebook using UV
uv run jupyter notebook notebook.ipynb
# Or start Jupyter Lab
uv run jupyter lab notebook.ipynbIf you use this code in your research, please cite:
@InProceedings{Meral_2025_ICCV,
author = {Meral, Tuna Han Salih and Simsar, Enis and Tombari, Federico and Yanardag, Pinar},
title = {Contrastive Test-Time Composition of Multiple LoRA Models for Image Generation},
booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
month = {October},
year = {2025},
pages = {18090-18100}
}This project is licensed under the MIT License - see the LICENSE file for details.
- Author: Tuna Han Salih Meral
- Email: [email protected]
For questions about the implementation or research, please open an issue or contact the author directly.