Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cubiq/Mellon

Repository files navigation

Mellon

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.

Installation

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 setuptools

Install pytorch for your platform. Generally with:

pip install -U torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128

Finally install the dependencies.

pip install -U -r requirements.txt

Run 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-isolation

Optionally 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 functionality

Additional libraries can be installed with:

pip install -U -r requirements_extras.txt

You 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

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.txt

For Nunchaku follow the installation instructions for your platform.

Upgrading

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
...
...

Alternative UV installation

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 sync

This 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 nunchaku

If you then run:

uv sync --extra spandrel

uv will remove nunchaku and install spandrel.

You can use both or more with:

uv sync --extra spandrel --extra nunchaku --extra background-removal --extra quantization

The non-commercial libraries are grouped together, to install them you can use:

uv sync --extra non-commercial

Finally, you can also install all the optional dependencies with:

uv sync --all-extras

Then you can simply start Mellon with the following command:

uv run main.py

About

Speak Friend and Enter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages