You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+83-62Lines changed: 83 additions & 62 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ This repository hosts a high-performance API server that provides OpenAI-compati
40
40
- 📈 **Performance and queue monitoring endpoints**
41
41
- 🧑💻 **Easy Python and CLI usage**
42
42
- 🛡️ **Robust error handling and request management**
43
-
- 🎛️ **LoRA adapter support** for fine-tuned image generation
43
+
- 🎛️ **LoRA adapter support** for fine-tuned image generation and editing
44
44
- ⚡ **Configurable quantization** (4-bit, 8-bit, 16-bit) for optimal performance
45
45
- 🧠 **Customizable context length** for memory optimization and performance tuning
46
46
@@ -97,8 +97,8 @@ The server supports six types of MLX models:
97
97
98
98
1.**Text-only models** (`--model-type lm`) - Uses the `mlx-lm` library for pure language models
99
99
2.**Multimodal models** (`--model-type multimodal`) - Uses the `mlx-vlm` library for multimodal models that can process text, images, and audio
100
-
3.**Image generation models** (`--model-type image-generation`) - Uses the `mflux` library for Flux-series image generation models with enhanced configurations ⚠️ *Requires manual installation of `mflux`*
101
-
4.**Image editing models** (`--model-type image-edit`) - Uses the `mflux` library for Flux-series image editing models ⚠️ *Requires manual installation of `mflux`*
100
+
3.**Image generation models** (`--model-type image-generation`) - Uses the `mflux` library for Flux-series image generation models with enhanced configurations
101
+
4.**Image editing models** (`--model-type image-edit`) - Uses the `mflux` library for Flux-series image editing models
102
102
5.**Embeddings models** (`--model-type embeddings`) - Uses the `mlx-embeddings` library for text embeddings generation with optimized memory management
103
103
6.**Whisper models** (`--model-type whisper`) - Uses the `mlx-whisper` library for audio transcription and speech recognition ⚠️ *Requires ffmpeg installation*
104
104
@@ -108,21 +108,21 @@ The server supports six types of MLX models:
108
108
109
109
### Flux-Series Image Models
110
110
111
-
> **⚠️ Note:** Image generation and editing capabilities require manual installation of `mflux`: `pip install git+https://github.com/cubist38/mflux.git`
112
-
113
-
The server supports multiple Flux model configurations for advanced image generation and editing:
111
+
The server supports multiple Flux and Qwen model configurations for advanced image generation and editing:
114
112
115
113
#### Image Generation Models
116
114
-**`flux-schnell`** - Fast generation with 4 default steps, no guidance (best for quick iterations)
>**Note:** If you try to use image generation or editing without `mflux` installed, you'll receive a clear error message directing you to install it manually.
260
+
- Qwen Image model support
261
+
- LoRA adapter support for fine-tuned generation and editing
277
262
278
263
#### Whisper Models Support
279
264
For whisper models to work properly, you need to install ffmpeg:
@@ -315,21 +300,21 @@ python -m app.main \
315
300
--queue-timeout 300 \
316
301
--queue-size 100
317
302
318
-
# For image generation models (Flux-series)
303
+
# For image generation models (Flux-series or Qwen)
- `--context-length`: Context length for language models. Controls the maximum sequence length for text processing and memory usage optimization. Default: `None` (uses model's default context length).
422
-
- `--config-name`: Flux model configuration to use. Only used for`image-generation` and `image-edit` model types:
423
-
- For `image-generation`: `flux-schnell`, `flux-dev`, `flux-krea-dev`
424
-
- For `image-edit`: `flux-kontext-dev`
407
+
- `--config-name`: Model configuration to use. Only used for `image-generation` and `image-edit` model types:
408
+
- For `image-generation`: `flux-schnell`, `flux-dev`, `flux-krea-dev`, `qwen-image`
409
+
- For `image-edit`: `flux-kontext-dev`, `qwen-image-edit`
425
410
- Default: `flux-schnell` for image-generation, `flux-kontext-dev` for image-edit
426
411
- `--quantize`: Quantization level for Flux models. Available options: `4`, `8`, `16`. Default: `8`
427
412
- `--lora-paths`: Comma-separated paths to LoRA adapter files.
-`async_mode`: Whether to process asynchronously (default: false)
914
938
915
-
>**Note:** Image generation requires running the server with `--model-type image-generation` and manual installation of `mflux`: `pip install git+https://github.com/cubist38/mflux.git`. The server uses MLX Flux-series models for high-quality image generation with configurable quality/speed trade-offs.
939
+
> **Note:** Image generation requires running the server with `--model-type image-generation`. The server supports MLX Flux-series models (flux-schnell, flux-dev, flux-krea-dev) and Qwen Image models (qwen-image) for high-quality image generation with configurable quality/speed trade-offs.
@@ -981,13 +1003,13 @@ if response.status_code == 200:
981
1003
-`prompt`: Text description of the desired edit (required, max 1000 characters)
982
1004
-`model`: Model identifier (defaults to "flux-kontext-dev")
983
1005
-`negative_prompt`: What to avoid in the edited image (optional)
984
-
- `guidance_scale`: Controls how closely the model follows the prompt (default: 2.5)
985
-
- `steps`: Number of inference steps, 1-50 (default: 4)
1006
+
-`guidance_scale`: Controls how closely the model follows the prompt (default: 2.5 for flux-kontext-dev, 4.0 for qwen-image-edit)
1007
+
-`steps`: Number of inference steps, 1-50 (default: 4 for flux-kontext-dev, 50 for qwen-image-edit)
986
1008
-`seed`: Random seed for reproducible editing (default: 42)
987
1009
-`size`: Output image dimensions - "256x256", "512x512", or "1024x1024" (optional)
988
1010
-`response_format`: Response format - "b64_json" (default: "b64_json")
989
1011
990
-
>**Note:** Image editing requires running the server with `--model-type image-edit` and manual installation of `mflux`: `pip install git+https://github.com/cubist38/mflux.git`. The server uses MLX Flux-series models for high-quality image editing with configurable quality/speed trade-offs.
1012
+
> **Note:** Image editing requires running the server with `--model-type image-edit`. The server supports MLX Flux-series models (flux-kontext-dev) and Qwen Image Edit models (qwen-image-edit) for high-quality image editing with configurable quality/speed trade-offs.
991
1013
992
1014
#### Function Calling
993
1015
```python
@@ -1474,23 +1496,22 @@ The repository includes example notebooks to help you get started with different
1474
1496
- Exploring different types of audio analysis prompts
1475
1497
- Understanding audio transcription and content analysis capabilities
1476
1498
1477
-
- **image_generations.ipynb**: A comprehensive guide to image generation using MLX Flux-series models, including:
1499
+
-**image_generations.ipynb**: A comprehensive guide to image generation using MLX Flux-series and Qwen Image models, including:
1478
1500
- Setting up connection to MLX Server for image generation
0 commit comments