Files
sglang/python/sglang/multimodal_gen/docs/install.md
2026-02-03 12:44:57 -08:00

1.9 KiB

Install SGLang-diffusion

You can install sglang-diffusion using one of the methods below.

This page primarily applies to common NVIDIA GPU platforms.

  • For AMD Instinct/ROCm environments see the dedicated ROCm quickstart, which lists the exact steps (including kernel builds) we used to validate sgl-diffusion on MI300X.
  • For Moore Threads GPU (MTGPU) with the MUSA software stack, see the MUSA quickstart, which lists the exact steps we used to validate sgl-diffusion on MTT S5000.

Method 1: With pip or uv

It is recommended to use uv for a faster installation:

pip install --upgrade pip
pip install uv
uv pip install "sglang[diffusion]" --prerelease=allow

Method 2: From source

# Use the latest release branch
git clone https://github.com/sgl-project/sglang.git
cd sglang

# Install the Python packages
pip install --upgrade pip
pip install -e "python[diffusion]"

# With uv
uv pip install -e "python[diffusion]" --prerelease=allow

Method 3: Using Docker

The Docker images are available on Docker Hub at lmsysorg/sglang, built from the Dockerfile. Replace <secret> below with your HuggingFace Hub token.

docker run --gpus all \
    --shm-size 32g \
    -p 30000:30000 \
    -v ~/.cache/huggingface:/root/.cache/huggingface \
    --env "HF_TOKEN=<secret>" \
    --ipc=host \
    lmsysorg/sglang:dev \
    zsh -c '\
        echo "Installing diffusion dependencies..." && \
        pip install -e "python[diffusion]" && \
        echo "Starting SGLang-Diffusion..." && \
        sglang generate \
            --model-path black-forest-labs/FLUX.1-dev \
            --prompt "A logo With Bold Large text: SGL Diffusion" \
            --save-output \
    '