Mellon is a client/server application to easily interface with ML tools with a focus on Diffusers.
Caution
Mellon is in an early development stage and it is not ready for production. DO NOT USE IT unless you know what you are doing.
git clone https://github.com/cubiq/Mellon.git
cd Mellon
python -m venv .venv --prompt=Mellon
source .venv/bin/activate
pip install -U pip
pip install -U wheel
pip install -U setuptoolsInstall pytorch for your platform. Generally with:
pip install -U torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128Finally install the dependencies.
pip install -U -r requirements.txtRun the application with python main.py or --on Linux-- with the script ./run.sh.
To install Flash Attention at the moment we have to use v2.8.0.post2:
pip install flash-attn==2.8.0.post2 --no-build-isolationOptionally you can also install SageAttention but you need v2 and it has to be compiled from source. Be sure to have the environment activated, clone the official repository somewhere outside of Mellon directory and compile it like so (it can take a while):
cd ~/some/directory
git clone https://github.com/thu-ml/SageAttention.git
cd SageAttention
export EXT_PARALLEL=4 NVCC_APPEND_FLAGS="--threads 8" MAX_JOBS=32 # parallel compiling
pip install -e .Remember you need python3.x-devel installed on your system to compile from source.
Note: Mellon has been tested on python 3.12.
Additional libraries can be installed with:
pip install -U -r requirements_extras.txtYou are very likely going to need them but in the spirit of keeping the core dependencies to the bare minimum I'm putting extra features in an optional requirement file. You can also check requirements_extras.txt and cherry pick what you need.
Quantization often requires additional packages. Check the requirements_quant.txt file for a list of available quantizations. If you want to install them all execute:
pip install -U -r requirements_quant.txtFor Nunchaku follow the installation instructions for your platform.
To upgrade Mellon just pull the repository:
cd Mellon
git pull
To upgrade the python libraries, activate the environment and follow the pip install order as per the installation
source .venv/bin/activate
pip install -U pip
pip install -U wheel
pip install -U setuptools
...
...
Alternatively, you can install Mellon using uv, a fast Python package manager written in Rust.
First, you will need to install uv following the official instructions for your system.
Then you can install the basic packages with this command:
uv syncThis will use python 3.12 and install the recommended packages to run Mellon, and it may also install torch 2.6 with CUDA 12.8 support depending on your OS (macOS not supported for now).
Note: For now it will also install diffusers from main.
If you want, you can install the extra packages to enable those features:
- nunchaku
- spandrel
- rmbg
- quant
You can install each one to test them separately, a group of them, or all of them.
For example, this will install Nunchaku 1.0.1dev20250924 for your system:
uv sync --extra nunchakuIf you then run:
uv sync --extra spandreluv will remove nunchaku and install spandrel.
You can use both or more with:
uv sync --extra spandrel --extra nunchaku --extra background-removal --extra quantizationThe non-commercial libraries are grouped together, to install them you can use:
uv sync --extra non-commercialFinally, you can also install all the optional dependencies with:
uv sync --all-extrasThen you can simply start Mellon with the following command:
uv run main.py