forked from mflux-community/mflux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
201 lines (187 loc) · 8.05 KB
/
Copy pathpyproject.toml
File metadata and controls
201 lines (187 loc) · 8.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
[build-system]
requires = ["uv_build>=0.12.5,<0.13.0"]
build-backend = "uv_build"
[tool.uv.build-backend]
default-excludes = true
module-name = "mflux"
namespace = true
source-exclude = [
"**/assets/**",
"**/models/common/training/_example/images/**",
"**/optimization/_loss_derivation/**",
]
[project]
name = "mflux"
version = "0.19.1"
description = "MLX native implementations of state-of-the-art generative image models."
readme = "README.md"
keywords = ["flux", "ai", "ml", "transformers", "mlx", "huggingface", "apple-silicon", "diffusers", "qwen", "qwen-image", "seedvr2", "z-image"]
authors = [{ name = "Filip Strand", email = "strand.filip@gmail.com" }]
maintainers = [{ name = "Filip Strand", email = "strand.filip@gmail.com" }]
license = { file = "LICENSE" }
requires-python = ">=3.10"
dependencies = [
"filelock>=3.20.1",
"fonttools>=4.60.2",
"huggingface-hub>=1.1.6,<2.0",
"hf-transfer>=0.1.9,<1.0",
"matplotlib>=3.9.2,<4.0",
"mlx>=0.32.0,<0.33.0; sys_platform=='darwin'",
"mlx[cuda13]==0.32.2; sys_platform=='linux'",
"numpy>=2.0.1,<3.0",
"opencv-python>=4.10.0,<5.0",
"piexif>=1.1.3,<2.0",
"pillow>=12.3.0",
"platformdirs>=4.0,<5.0",
"regex>=2024.11.6",
"requests>=2.33.0",
"safetensors>=0.4.4,<1.0",
"sentencepiece>=0.2.1,<1.0",
"tokenizers>=0.20.3; python_version>='3.13'",
"toml>=0.10.2,<1.0",
"torch>=2.13.0,<3.0",
"tqdm>=4.66.5,<5.0",
"transformers>=5.5.0,<6.0",
"urllib3>=2.7.0",
"protobuf>=4.25.0,<8.0",
# Already present through huggingface-hub; declared so mflux-capabilities --format yaml
# does not depend on a transitive dependency staying where it is.
"pyyaml>=6.0,<7.0",
]
classifiers = [
"Intended Audience :: Developers",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
# Dev tooling may require a newer Python than the published package;
# the dist itself still supports every version in requires-python.
[dependency-groups]
dev = [
"matplotlib>=3.11,<4.0",
"pytest>=9.1,<10.0",
"pytest-timer>=1.0,<2.0",
# Pinned exactly; keep in sync with .pre-commit-config.yaml and the CI lint job.
"ruff==0.16.3",
# Pinned exactly; keep in sync with .pre-commit-config.yaml (astral-sh/ty-pre-commit rev)
# and the CI ty step. ty 0.0.72 (62ebbecc7 2026-08-14).
"ty==0.0.72",
"mlx==0.32.0; sys_platform=='darwin'",
"mlx[cuda13]==0.32.2; sys_platform=='linux'",
]
[tool.uv.dependency-groups]
# Matches the repo's dev baseline (justfile python_version, CI dev jobs).
dev = { requires-python = ">=3.13" }
[project.urls]
homepage = "https://github.com/filipstrand/mflux"
[project.scripts]
mflux-generate = "mflux.models.flux.cli.flux_generate:main"
mflux-generate-flux2 = "mflux.models.flux2.cli.flux2_generate:main"
mflux-generate-flux2-edit = "mflux.models.flux2.cli.flux2_edit_generate:main"
mflux-generate-boogu = "mflux.models.boogu.cli.boogu_image_generate:main"
mflux-generate-controlnet = "mflux.models.flux.cli.flux_generate_controlnet:main"
mflux-generate-in-context = "mflux.models.flux.cli.flux_generate_in_context_dev:main"
mflux-generate-in-context-edit = "mflux.models.flux.cli.flux_generate_in_context_edit:main"
mflux-generate-in-context-catvton = "mflux.models.flux.cli.flux_generate_in_context_catvton:main"
mflux-generate-fill = "mflux.models.flux.cli.flux_generate_fill:main"
mflux-generate-depth = "mflux.models.flux.cli.flux_generate_depth:main"
mflux-generate-redux = "mflux.models.flux.cli.flux_generate_redux:main"
mflux-generate-kontext = "mflux.models.flux.cli.flux_generate_kontext:main"
mflux-generate-qwen = "mflux.models.qwen.cli.qwen_image_generate:main"
mflux-generate-qwen-edit = "mflux.models.qwen.cli.qwen_image_edit_generate:main"
mflux-generate-fibo = "mflux.models.fibo.cli.fibo_generate:main"
mflux-generate-fibo-edit = "mflux.models.fibo.cli.fibo_edit:main"
mflux-generate-z-image = "mflux.models.z_image.cli.z_image_generate:main"
mflux-generate-z-image-turbo = "mflux.models.z_image.cli.z_image_turbo_generate:main"
mflux-generate-z-image-controlnet = "mflux.models.z_image.cli.z_image_turbo_generate_controlnet:main"
mflux-generate-ernie-image-turbo = "mflux.models.ernie_image.cli.ernie_image_turbo_generate:main"
mflux-generate-ernie-image = "mflux.models.ernie_image.cli.ernie_image_generate:main"
mflux-generate-ideogram4 = "mflux.models.ideogram4.cli.ideogram4_generate:main"
mflux-generate-krea2 = "mflux.models.krea2.cli.krea2_generate:main"
mflux-generate-lens = "mflux.models.lens.cli.lens_generate:main"
mflux-refine-fibo = "mflux.models.fibo_vlm.cli.fibo_refine:main"
mflux-inspire-fibo = "mflux.models.fibo_vlm.cli.fibo_inspire:main"
mflux-concept = "mflux.models.flux.cli.flux_concept:main"
mflux-concept-from-image = "mflux.models.flux.cli.flux_concept_from_image:main"
mflux-capabilities = "mflux.cli.capabilities:main"
mflux-save = "mflux.models.common.cli.save:main"
mflux-save-depth = "mflux.models.depth_pro.cli.save_depth:main"
mflux-train = "mflux.models.common.cli.train:main"
mflux-upscale-controlnet = "mflux.models.flux.cli.flux_upscale:main"
mflux-upscale-seedvr2 = "mflux.models.seedvr2.cli.seedvr2_upscale:main"
mflux-lora-library = "mflux.models.common.cli.lora_library:main"
mflux-info = "mflux.models.common.cli.info:main"
mflux-completions = "mflux.cli.completions.install:main"
[tool.ruff]
line-length = 120
indent-width = 4
target-version = "py310"
respect-gitignore = true
[tool.ruff.lint]
select = ["BLE", "E4", "E7", "E9", "F", "I", "ICN", "LOG", "PERF", "W"]
ignore = []
fixable = ["ALL"]
unfixable = []
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
docstring-code-format = false
docstring-code-line-length = "dynamic"
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = "test_*.py"
addopts = '-v --failed-first --showlocals --tb=long --full-trace -m "not slow and not high_memory_requirement"'
filterwarnings = [
"ignore::DeprecationWarning:transformers\\.models\\.clip\\.tokenization_clip",
"ignore:builtin type SwigPyPacked has no __module__ attribute:DeprecationWarning",
"ignore:builtin type SwigPyObject has no __module__ attribute:DeprecationWarning",
"ignore:builtin type swigvarlink has no __module__ attribute:DeprecationWarning",
]
markers = [
"fast: marks tests as fast (no image generation)",
"slow: marks tests as slow (generates images)",
"high_memory_requirement: marks tests that require high memory (deselect with '-m \"not high_memory_requirement\"')",
]
[tool.ruff.lint.isort]
case-sensitive = false
combine-as-imports = true
force-wrap-aliases = true
from-first = false
known-first-party = ["src"]
relative-imports-order = "furthest-to-closest"
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"local-folder",
]
[tool.ty.environment]
# typings/ holds an escape-hatch stub for mlx.core (compiled .so, no .pyi upstream).
extra-paths = ["typings"]
[tool.ty.rules]
# One-time migration baseline (mypy -> ty, ty 0.0.72): every rule below had
# pre-existing violations when ty was adopted (counts as of 2026-08-14).
# Plan: re-enable (delete the ignore line) and fix piecemeal, one rule at a time.
invalid-argument-type = "ignore" # 174
unresolved-attribute = "ignore" # 39
invalid-assignment = "ignore" # 36
not-subscriptable = "ignore" # 33
invalid-parameter-default = "ignore" # 10
invalid-type-form = "ignore" # 9
invalid-return-type = "ignore" # 8
too-many-positional-arguments = "ignore" # 7
missing-argument = "ignore" # 7
call-non-callable = "ignore" # 4
not-iterable = "ignore" # 3
no-matching-overload = "ignore" # 3
unsupported-operator = "ignore" # 2
unused-type-ignore-comment = "ignore" # 2