Commit a023a15
committed
feat(diffusion): native FLUX.2-dev text-to-image + /v1/images serving + GUI
Add the `lumen-diffusion` crate: an MLX-native FLUX.2 text-to-image pipeline,
fully separate from the autoregressive LLM stack. Components (each parity-
validated against mflux / Swift references):
- VAE decoder, Mistral-Small-3.2 text encoder (layers 10/20/30 -> [1,512,15360]),
32B rectified-flow DiT (8 double + 48 single stream, 4D RoPE, AdaLN, guidance),
flow-match Euler scheduler, dev pipeline, and the FLUX.2 prompt tokenizer.
- Both 4-bit (36 GB) and non-quantized bf16 (128 GB) weights are auto-detected
per tensor (.scales presence), so the same loaders serve either footprint.
Serving (lumen-server):
- POST /v1/images/generations (OpenAI-compatible, base64 PNG).
- LUMEN_SERVE = chat | image | hybrid serve modes; image mode leaves the MLX
memory governors at their defaults (the ~31 GB diffusion working set exceeds
the LLM-tuned wired cap, which would OOM the load).
Desktop app (lumen-app):
- IMAGE-MODELS catalog card with a diagonal "IMAGE" corner badge, an image-
generation panel (prompt / size / steps / seed / guidance), and image-mode
launch wiring (+ en/ko strings).
Housekeeping:
- Resolve all FLUX.2 component repos from the local HuggingFace cache via
`hf_cache` (no machine-specific hardcoded paths).
- Fix safe pre-existing warnings (unused imports / mut, minijinja serde feature,
toml dep semver metadata).
chore(release): v0.11.01 parent ca5dbc8 commit a023a15
47 files changed
Lines changed: 5819 additions & 72 deletions
File tree
- crates
- lumen-app
- frontend
- src
- lib
- messages
- src
- lumen-core/src
- lumen-diffusion
- examples
- src
- ops
- lumen-mlx
- src
- lumen-server
- src
- routes
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
226 | 245 | | |
227 | 246 | | |
228 | 247 | | |
| |||
1465 | 1484 | | |
1466 | 1485 | | |
1467 | 1486 | | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
1468 | 1530 | | |
1469 | 1531 | | |
1470 | 1532 | | |
| |||
1591 | 1653 | | |
1592 | 1654 | | |
1593 | 1655 | | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
1594 | 1662 | | |
1595 | 1663 | | |
1596 | 1664 | | |
| |||
1959 | 2027 | | |
1960 | 2028 | | |
1961 | 2029 | | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
1962 | 2067 | | |
0 commit comments