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
Update README
Browse files
README.md
CHANGED
|
@@ -310,7 +310,18 @@ img.save("single_edit_1024x1024.png")
|
|
| 310 |
|
| 311 |
### CLI
|
| 312 |
|
| 313 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 314 |
|
| 315 |
| Flag | Scope | Meaning |
|
| 316 |
| :-------------------- | :---: | :---------------------------------------------------------------------------- |
|
|
@@ -328,21 +339,6 @@ Both commands are **batched** — pass several `--prompt` values (sample `i` use
|
|
| 328 |
| `--max_size` | edit | max size of the reference image |
|
| 329 |
| `--vl_cond_long_edge` | edit | VL-condition long edge (default `384`) |
|
| 330 |
|
| 331 |
-
```bash
|
| 332 |
-
# text-to-image (two prompts in one batch)
|
| 333 |
-
mage-flow --prompt "A close-up portrait of an elderly African man with deep wrinkles, wearing a traditional hat, soft natural lighting, ultra realistic." "An immersive landscape of a Greenlandic icefjord at midnight sun, painted by early dawn light, crystal-clear skies adding drama. fine grains of sand carving sharp shadows. Peter Lik gallery print, moody atmosphere, museum-grade composition." \
|
| 334 |
-
--model_path microsoft/Mage-Flow --steps 20 --cfg 5.0 \
|
| 335 |
-
--height 1024 512 --width 1024 2048 --seed 42 --out ./outputs
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
# editing (one --ref per prompt; comma-separate sources for multi-image edit)
|
| 339 |
-
mage-flow-edit --prompt "Replace the background with a field of sunflowers" "blend these two images" \
|
| 340 |
-
--ref assets/dog.jpg "scene.png,object.png" \
|
| 341 |
-
--model_path microsoft/Mage-Flow-Edit --max_size 1024 --out ./outputs
|
| 342 |
-
```
|
| 343 |
-
|
| 344 |
-
> `--height`/`--width` accept **one value** (applied to every prompt) or **one value per prompt** for mixed resolutions. Any per-prompt shape (multiple of 16, native `512`–`2048`) is allowed — all samples pack into a single varlen forward per denoise step.
|
| 345 |
-
|
| 346 |
### Gradio app
|
| 347 |
|
| 348 |
```bash
|
|
|
|
| 310 |
|
| 311 |
### CLI
|
| 312 |
|
| 313 |
+
```bash
|
| 314 |
+
# text-to-image (two prompts in one batch)
|
| 315 |
+
mage-flow --prompt "A close-up portrait of an elderly African man with deep wrinkles, wearing a traditional hat, soft natural lighting, ultra realistic." "An immersive landscape of a Greenlandic icefjord at midnight sun, painted by early dawn light, crystal-clear skies adding drama. fine grains of sand carving sharp shadows. Peter Lik gallery print, moody atmosphere, museum-grade composition." \
|
| 316 |
+
--model_path microsoft/Mage-Flow --steps 20 --cfg 5.0 \
|
| 317 |
+
--height 1024 512 --width 1024 2048 --seed 42 --out ./outputs
|
| 318 |
+
|
| 319 |
+
|
| 320 |
+
# editing (one --ref per prompt; comma-separate sources for multi-image edit)
|
| 321 |
+
mage-flow-edit --prompt "Replace the background with a field of sunflowers" "blend these two images" \
|
| 322 |
+
--ref assets/dog.jpg "scene.png,object.png" \
|
| 323 |
+
--model_path microsoft/Mage-Flow-Edit --max_size 1024 --out ./outputs
|
| 324 |
+
```
|
| 325 |
|
| 326 |
| Flag | Scope | Meaning |
|
| 327 |
| :-------------------- | :---: | :---------------------------------------------------------------------------- |
|
|
|
|
| 339 |
| `--max_size` | edit | max size of the reference image |
|
| 340 |
| `--vl_cond_long_edge` | edit | VL-condition long edge (default `384`) |
|
| 341 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 342 |
### Gradio app
|
| 343 |
|
| 344 |
```bash
|