Text-to-Image
Diffusers
Safetensors
MageFlowPipeline
image-generation
image-editing
diffusion
rectified-flow
mage-flow
Instructions to use microsoft/Mage-Flow-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use microsoft/Mage-Flow-Base with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("microsoft/Mage-Flow-Base", torch_dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
README: sync Installation section with source repo
Browse files
README.md
CHANGED
|
@@ -233,15 +233,27 @@ Each checkpoint is a self-contained diffusers-style repo (`transformer/` + share
|
|
| 233 |
|
| 234 |
### Installation
|
| 235 |
|
| 236 |
-
Install everything **except** `flash-attn` first, then install `flash-attn` separately with build isolation **off** — it compiles a CUDA extension against your installed torch, so torch must already be present.
|
| 237 |
|
| 238 |
```bash
|
| 239 |
cd Mage/mage_flow
|
| 240 |
-
uv
|
| 241 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
```
|
| 243 |
|
| 244 |
-
Plain `pip` is
|
|
|
|
|
|
|
| 245 |
|
| 246 |
### Python API
|
| 247 |
|
|
|
|
| 233 |
|
| 234 |
### Installation
|
| 235 |
|
| 236 |
+
Install everything **except** `flash-attn` first, then install `flash-attn` separately with build isolation **off** — it compiles a CUDA extension against your installed torch, so torch and a matching CUDA toolkit must already be present.
|
| 237 |
|
| 238 |
```bash
|
| 239 |
cd Mage/mage_flow
|
| 240 |
+
uv venv && source .venv/bin/activate
|
| 241 |
+
|
| 242 |
+
# 1) Pinned, tested dependency set (torch 2.10, transformers 5.5, diffusers 0.38, pillow 12.3, …).
|
| 243 |
+
# Recommended for reproducibility. `uv pip install -e .` also works, but its loose
|
| 244 |
+
# bounds may resolve to a newer torch/transformers than the code was tested against.
|
| 245 |
+
uv pip install -r requirements.txt
|
| 246 |
+
uv pip install -e . --no-deps # the mage-flow package itself
|
| 247 |
+
|
| 248 |
+
# 2) flash-attn — needs build tools present and a CUDA toolkit whose MAJOR version
|
| 249 |
+
# matches your torch build (e.g. torch cu12x ↔ nvcc 12.x). A cu13/nvcc-12 mix fails.
|
| 250 |
+
uv pip install setuptools wheel ninja
|
| 251 |
+
uv pip install --no-build-isolation flash-attn==2.8.3
|
| 252 |
```
|
| 253 |
|
| 254 |
+
Plain `pip` is equivalent (`pip install -r requirements.txt`, `pip install -e . --no-deps`, then the two flash-attn lines). This registers three commands: `mage-flow`, `mage-flow-edit`, `mage-flow-app`.
|
| 255 |
+
|
| 256 |
+
> **torch / CUDA:** the default PyPI torch wheel targets the newest CUDA (currently cu13x). If your machine's CUDA toolkit is 12.x, install torch from the matching index first, e.g. `uv pip install torch==2.10.0 torchvision==0.25.0 --index-url https://download.pytorch.org/whl/cu128`, otherwise the flash-attn build will fail with a CUDA-version mismatch.
|
| 257 |
|
| 258 |
### Python API
|
| 259 |
|