Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
831 lines (796 loc) · 54.9 KB
/
Copy pathpyproject.toml
File metadata and controls
831 lines (796 loc) · 54.9 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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
[build-system]
requires = ["setuptools", "pip", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "InvokeAI"
description = "A full-featured AI-assisted image generation environment designed for creatives and enthusiasts."
requires-python = ">=3.12, <3.13"
readme = { content-type = "text/markdown", file = "README.md" }
keywords = ["stable-diffusion", "AI"]
dynamic = ["version"]
license = { file = "LICENSE" }
authors = [{ name = "Invoke", email = "support@invoke.ai" }]
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: GPU',
'Environment :: GPU :: NVIDIA CUDA',
'Environment :: MacOS X',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.12',
'Topic :: Artistic Software',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Server',
'Topic :: Multimedia :: Graphics',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Scientific/Engineering :: Image Processing',
]
dependencies = [
# Core generation dependencies, pinned for reproducible builds.
"accelerate",
"bitsandbytes; sys_platform!='darwin' and (sys_platform != 'win32' or platform_machine != 'ARM64')",
"bitsandbytes>=0.50.1; sys_platform == 'win32' and platform_machine == 'ARM64'", # 0.50.1 added the CUDA 13.4 win_arm64 build for RTX Spark
"compel>=2.4.0,<3",
"diffusers[torch]==0.42.1",
"gguf",
# Not on Windows ARM64: the only win_arm64 mediapipe wheel (0.10.35+) is the Tasks-API build without the
# legacy `solutions` API the face preprocessor and Face Tools use; those nodes report the platform when run.
"mediapipe==0.10.14; (sys_platform != 'win32' or platform_machine != 'ARM64')", # needed for "mediapipeface" controlnet model
"mistral-common>=1.5.4,<2", # canonical Tekken tokenizer for FLUX.2 [dev] Mistral encoder; the
# loader depends on private surface (Tekkenizer internals) that
# moves across majors, so cap below 2.x (validated against 1.11.6)
"tiktoken==0.13.0; sys_platform == 'win32' and platform_machine == 'ARM64'", # mistral-common dependency; self-built win_arm64 wheel (see invoke-win-arm64-wheels)
"numpy<2.0.0; (sys_platform != 'win32' or platform_machine != 'ARM64')",
"numpy>=2.3,<2.4; sys_platform == 'win32' and platform_machine == 'ARM64'", # first win_arm64 wheels are 2.3; <2.4 is mistral-common's cap on 3.12
"onnx==1.22.0",
"onnxruntime==1.19.2; (sys_platform != 'win32' or platform_machine != 'ARM64')",
"onnxruntime>=1.24.2; sys_platform == 'win32' and platform_machine == 'ARM64'", # CPU execution provider only; no GPU build exists for win_arm64
"opencv-contrib-python; (sys_platform != 'win32' or platform_machine != 'ARM64')",
"opencv-contrib-python==4.11.0.86; sys_platform == 'win32' and platform_machine == 'ARM64'", # self-built win_arm64 wheel (see invoke-win-arm64-wheels)
"imageio[ffmpeg]>=2.37; (sys_platform != 'win32' or platform_machine != 'ARM64')", # video encode (for Wan 2.2 T2V/I2V output); encode behavior (macro_block_size) is version-sensitive
# imageio-ffmpeg's wheels exist only to bundle an ffmpeg binary, and there is none for win_arm64: the sdist builds a
# pure wheel and get_ffmpeg_exe() falls back to the ffmpeg on PATH (or IMAGEIO_FFMPEG_EXE).
"imageio>=2.37; sys_platform == 'win32' and platform_machine == 'ARM64'",
"imageio-ffmpeg>=0.6; sys_platform == 'win32' and platform_machine == 'ARM64'",
"psutil>=6", # video decode worker process-tree termination
"safetensors",
"sentencepiece==0.2.2", # 0.2.0 has a heap overflow; 0.2.1 coredumped on windows loading the t5 tokenizer
"spandrel",
# Loosely pinned, will respect requirement of `diffusers[torch]`. Split by platform: linux/win allow
# the 2.13 line every backend extra pins (the lock itself is held there by `constraint-dependencies` in
# [tool.uv]), while macOS stays on 2.7.x — newer macOS torch wheels exercise MPS on CI runners (no
# usable Metal GPU) and fail with MPS OOM.
# Deliberately NOT capped below 2.12 here. torch 2.12.x+rocm7.1 was reported to break generation (#9410),
# but this range is what every backend-agnostic install resolves against — manual installs use
# `--torch-backend=<x>` with no extra (see docs/start-here/manual), so a blanket cap would also
# reject torch>=2.12 on Windows/Linux CUDA, CPU and ARM64, where 2.12 has no known problem.
# The ROCm path is constrained where it can actually be targeted: the `rocm` extra below pins an
# exact version, AMD's 2.13.0+rocm10.0.0.
"torch>=2.7.0,<3.0; sys_platform != 'darwin'",
"torch>=2.7.0,<2.8.0; sys_platform == 'darwin'",
# Windows on ARM64 (NVIDIA RTX Spark): NVIDIA's out-of-tree build is the only torch with win_arm64 wheels, so it is
# pinned here for every extra (see `torch-nvidia-win-arm64` below). The wheel bundles its CUDA 13.4 libraries.
"torch==2.14.0+cu134; sys_platform == 'win32' and platform_machine == 'ARM64'",
"torchvision==0.29.0+cu134; sys_platform == 'win32' and platform_machine == 'ARM64'",
"torchsde", # diffusers needs this for SDE solvers, but it is not an explicit dep of diffusers
"torchvision",
"transformers>=5.10.4,<5.11",
# Core application dependencies, pinned for reproducible builds.
"fastapi-events",
# The old pin sat at 0.118.3 because 0.119.0 crashed generating our OpenAPI schema. That was a FastAPI bug, not
# ours (`KeyError: '$ref'` in fastapi/_compat/v2.py, which assumed every field mapping carries a `$ref`), and it
# is fixed as of 0.124.0 — no change to AnyInvocation was needed.
#
# Two later changes did need adapting to, both handled: 0.130 emits `contentMediaType` instead of
# `format: binary` for file uploads (see the Blob mapping in frontend/api/scripts/typegen.js), and 0.141 keeps
# included routers as a single node in `app.routes` rather than copying their routes into it (see
# `_iter_route_contexts` in tests/app/routers/test_model_manager_authorization.py). Keep the minor-version bound:
# both of those were silent breakages that only surfaced because something happened to assert on them.
"fastapi>=0.141.1,<0.142",
"huggingface-hub",
"networkx",
"pydantic-settings",
"pydantic",
"python-socketio",
# Schema migrations that run on every database backend are written with Alembic's operations (no Alembic
# environment or revision scripts).
"alembic>=1.20,<2",
# The database layer compiles every query through SQLAlchemy Core. Keep the minor-version bound: dialect
# compilation and the pysqlite transaction handling it relies on are exactly what changes between minors.
"sqlalchemy>=2.1,<2.2",
"uvicorn[standard]; (sys_platform != 'win32' or platform_machine != 'ARM64')",
# [standard] pulls httptools, which has no win_arm64 wheel; uvicorn falls back to h11. websockets and watchfiles
# are the parts of [standard] the app uses.
"uvicorn; sys_platform == 'win32' and platform_machine == 'ARM64'",
"websockets; sys_platform == 'win32' and platform_machine == 'ARM64'",
"watchfiles; sys_platform == 'win32' and platform_machine == 'ARM64'",
# Auxiliary dependencies, pinned only if necessary.
"blake3; (sys_platform != 'win32' or platform_machine != 'ARM64')",
"blake3==1.0.9; sys_platform == 'win32' and platform_machine == 'ARM64'", # self-built win_arm64 wheel (see invoke-win-arm64-wheels)
"bcrypt>=4.1,<6", # used directly (not via passlib, which is incompatible with bcrypt>=4.1 -- the first release with win_arm64 wheels)
"Deprecated",
"dnspython",
"dynamicprompts",
"einops",
"email-validator>=2.0.0",
"fonttools[woff]; (sys_platform != 'win32' or platform_machine != 'ARM64')",
"fonttools; sys_platform == 'win32' and platform_machine == 'ARM64'", # [woff] needs brotli, which has no win_arm64 wheel; woff2 fonts are skipped there
"picklescan",
"pillow>=13.0.0",
"prompt-toolkit",
"pypatchmatch",
"PyJWT>=2.15.0",
"python-multipart",
"requests",
"semver~=3.0.1",
"PyWavelets; (sys_platform != 'win32' or platform_machine != 'ARM64')",
"PyWavelets>=1.10; sys_platform == 'win32' and platform_machine == 'ARM64'", # first win_arm64 wheels
# Semantic image index (image map / semantic search).
# numba is a umap-learn transitive, pinned to the range this stack has been
# exercised against rather than for numpy compatibility: every release from
# 0.59 to at least 0.63 accepts the numpy 1.26.x resolved under numpy<2.0
# above (0.62 widened its floor back to >=1.22). Raise the ceiling once a
# newer numba has been run against the image map, not just resolved.
# Not on Windows ARM64: numba/llvmlite ship win_arm64 wheels for Python 3.14 only. The image map falls back to a
# PCA projection there (see image_index/projection.py).
"umap-learn~=0.5.7; (sys_platform != 'win32' or platform_machine != 'ARM64')",
"scikit-learn~=1.5",
"numba>=0.59,<0.62; (sys_platform != 'win32' or platform_machine != 'ARM64')",
]
[project.optional-dependencies]
"xformers" = [
# Core generation dependencies, pinned for reproducible builds.
"xformers>=0.0.28.post1; sys_platform!='darwin' and (sys_platform != 'win32' or platform_machine != 'ARM64')",
# torch 2.4+cu carries its own triton dependency
]
# The +cpu/+cu130/+xpu pins live on PyTorch's WHL indexes, the +rocm10.0.0 pins on AMD's, and
# all are gated to the platforms the project resolves and tests them on: Windows x64 and Linux
# x86_64. Windows ARM64 gets NVIDIA's build, the only torch there, in every extra. macOS is
# capped below torch 2.8 (see the base requirement), and linux_aarch64 stays on the CPU-only
# PyPI 2.7.1 it was set up with (an aarch64 install requesting `cuda` gets CPU torch), so both fall back to the base `torch` / `torchvision` from PyPI. The index has
# carried aarch64 torchvision since 0.28, so moving aarch64 onto the pinned pairs -- and real
# CUDA-on-aarch64 (e.g. Grace/GH200) -- is open, just untested.
#
# cu130 builds cover compute capability 7.5 and newer (Turing through Blackwell) and need
# an NVIDIA driver from the R580 series or newer. CUDA 13 cannot build for Maxwell, Pascal
# or Volta; the cu126 builds that still can have no Blackwell kernels, and cu128 stops at
# torch 2.11.
"cpu" = [
"torch==2.13.0+cpu; (sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')",
"torchvision==0.28.0+cpu; (sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')",
# macOS / linux_aarch64 fallback, resolved from PyPI. Without these explicit entries
# the extra's conflict-universe would contain no torch at all there (uv partitions
# the base declarations into the no-extra universe).
"torch==2.7.1; sys_platform == 'darwin' or (sys_platform == 'linux' and platform_machine == 'aarch64')",
"torchvision==0.22.1; sys_platform == 'darwin' or (sys_platform == 'linux' and platform_machine == 'aarch64')",
# Windows ARM64 fallback: NVIDIA's build is the only torch there (see the base `torch` pin).
"torch==2.14.0+cu134; sys_platform == 'win32' and platform_machine == 'ARM64'",
"torchvision==0.29.0+cu134; sys_platform == 'win32' and platform_machine == 'ARM64'",
]
"cuda" = [
"torch==2.13.0+cu130; (sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')",
"torchvision==0.28.0+cu130; (sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')",
# The Linux torch wheel requires triton; the Windows wheel requires none. triton-windows is the Windows build
# (no win_arm64 wheel); its minor version must match the Triton that torch 2.13 is built against.
"triton-windows>=3.7,<3.8; sys_platform == 'win32' and platform_machine != 'ARM64'",
# macOS / linux_aarch64 fallback, see note under "cpu"
"torch==2.7.1; sys_platform == 'darwin' or (sys_platform == 'linux' and platform_machine == 'aarch64')",
"torchvision==0.22.1; sys_platform == 'darwin' or (sys_platform == 'linux' and platform_machine == 'aarch64')",
# Windows ARM64 fallback, see note under "cpu"
"torch==2.14.0+cu134; sys_platform == 'win32' and platform_machine == 'ARM64'",
"torchvision==0.29.0+cu134; sys_platform == 'win32' and platform_machine == 'ARM64'",
]
# ROCm 10 for Linux x86_64 and Windows, from AMD's index (PyTorch publishes no ROCm wheels for Windows, and none
# built against ROCm 10). AMD splits the build: torch/torchvision and the ROCm runtime (`rocm-sdk-core`,
# `rocm-sdk-libraries`) are shared, the GPU kernels come in one package per target and library. uv applies an
# index source to direct requirements only, so every package that exists only on AMD's index is listed here.
# The extra installs the kernels of every target AMD builds; the launcher leaves out the targets the machine
# does not have (`uv sync --no-install-package`). ROCm 10 dropped gfx900/gfx906 (Vega 10/20, MI25/MI50), which
# the previous 2.13.0+rocm7.2 pin from PyTorch's index still covered.
"rocm" = [
"torch==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"torchvision==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
# The Linux torch wheel requires AMD's triton build; the Windows wheel requires none.
"triton==3.8.0+git4cff872c.rocm10.0.0; sys_platform == 'linux' and platform_machine == 'x86_64'",
"rocm==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-core==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-libraries==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
# 0.50.2 is the first release with a Windows ROCm binary, and the first that finds its Linux one for these wheels:
# they report HIP 7.15, which 0.49 turns into `libbitsandbytes_rocm85.so` (7 * 10 + 15) where 0.50 ships `rocm715`.
"bitsandbytes>=0.50.2; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
# GPU kernels: per target, torch's, torchvision's and the ROCm runtime's; gfx110x, gfx115x and gfx12-0
# are torch's kernels shared by a whole family.
"amd-torch-device-gfx1010==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1010==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1010==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1011==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1011==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1011==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1012==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1012==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1012==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1030==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1030==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1030==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1031==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1031==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1031==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1032==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1032==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1032==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1033==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1033==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1033==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1034==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1034==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1034==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1035==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1035==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1035==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1036==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1036==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1036==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx110x==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1100==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1100==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1100==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1101==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1101==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1101==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1102==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1102==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1102==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1103==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1103==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1103==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx115x==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1150==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1150==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1150==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1151==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1151==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1151==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1152==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1152==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1152==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1153==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1153==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1153==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx12-0==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1200==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1200==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1200==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx1201==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx1201==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx1201==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx908==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx908==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx908==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torch-device-gfx90a==2.13.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"amd-torchvision-device-gfx90a==0.28.0+rocm10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"rocm-sdk-device-gfx90a==10.0.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
# Targets AMD builds for Linux only.
"amd-torch-device-gfx1250==2.13.0+rocm10.0.0; sys_platform == 'linux' and platform_machine == 'x86_64'",
"amd-torchvision-device-gfx1250==0.28.0+rocm10.0.0; sys_platform == 'linux' and platform_machine == 'x86_64'",
"rocm-sdk-device-gfx1250==10.0.0; sys_platform == 'linux' and platform_machine == 'x86_64'",
"amd-torch-device-gfx942==2.13.0+rocm10.0.0; sys_platform == 'linux' and platform_machine == 'x86_64'",
"amd-torchvision-device-gfx942==0.28.0+rocm10.0.0; sys_platform == 'linux' and platform_machine == 'x86_64'",
"rocm-sdk-device-gfx942==10.0.0; sys_platform == 'linux' and platform_machine == 'x86_64'",
"amd-torch-device-gfx950==2.13.0+rocm10.0.0; sys_platform == 'linux' and platform_machine == 'x86_64'",
"amd-torchvision-device-gfx950==0.28.0+rocm10.0.0; sys_platform == 'linux' and platform_machine == 'x86_64'",
"rocm-sdk-device-gfx950==10.0.0; sys_platform == 'linux' and platform_machine == 'x86_64'",
# macOS / linux_aarch64 fallback, see note under "cpu"
"torch==2.7.1; sys_platform == 'darwin' or (sys_platform == 'linux' and platform_machine == 'aarch64')",
"torchvision==0.22.1; sys_platform == 'darwin' or (sys_platform == 'linux' and platform_machine == 'aarch64')",
# Windows ARM64 fallback, see note under "cpu"
"torch==2.14.0+cu134; sys_platform == 'win32' and platform_machine == 'ARM64'",
"torchvision==0.29.0+cu134; sys_platform == 'win32' and platform_machine == 'ARM64'",
]
# Intel XPU (Arc / Battlemage) wheels are published only for linux-x86_64 and
# windows-amd64 on PyTorch's WHL index. Gate the +xpu pins to those platforms (the
# Windows clause excludes ARM64 explicitly, since `sys_platform` alone is 'win32' there too); the
# Intel oneAPI runtime libs (intel-sycl-rt, etc.) come in automatically as deps of
# torch+xpu.
# Intel's XPU backend matured considerably after 2.7.1: torch.xpu.mem_get_info() works on
# driver/kernel combinations where it previously raised, and the bundled oneAPI runtime ships
# with the wheel (intel-sycl-rt), so upgrading torch upgrades the user-space runtime too.
"xpu" = [
"torch==2.13.0+xpu; (sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')",
"torchvision==0.28.0+xpu; (sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')",
# XPU triton (for torch.compile); the WHL index ships linux-x86_64 and win_amd64 wheels.
# Renamed from pytorch-triton-xpu to triton-xpu upstream.
"triton-xpu==3.7.2; (sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')",
# Windows ARM64 has no +xpu wheels either: NVIDIA's build, as everywhere else on that platform.
"torch==2.14.0+cu134; sys_platform == 'win32' and platform_machine == 'ARM64'",
"torchvision==0.29.0+cu134; sys_platform == 'win32' and platform_machine == 'ARM64'",
# macOS / linux_aarch64 have no +xpu wheels: fall back to base torch so the extra's
# conflict-universe always contains a torch. See note under "cpu".
"torch==2.7.1; sys_platform == 'darwin' or (sys_platform == 'linux' and platform_machine == 'aarch64')",
"torchvision==0.22.1; sys_platform == 'darwin' or (sys_platform == 'linux' and platform_machine == 'aarch64')",
]
# Driver for running the application database on MySQL or MariaDB instead of SQLite.
"mysql" = ["pymysql>=1.2.3,<2"]
"onnx" = ["onnxruntime"]
# Neither GPU build of onnxruntime has win_arm64 wheels; the markers drop the package there, so on Windows ARM64
# these extras install nothing.
"onnx-cuda" = ["onnxruntime-gpu; (sys_platform != 'win32' or platform_machine != 'ARM64')"]
"onnx-directml" = ["onnxruntime-directml; (sys_platform != 'win32' or platform_machine != 'ARM64')"]
"dist" = ["pip-tools", "pipdeptree", "twine"]
"dev" = ["jurigged", "pudb", "snakeviz", "gprof2dot"]
"test" = [
"ruff~=0.11.2",
"ruff-lsp~=0.0.62",
"mypy",
"pre-commit",
"pytest>6.0.0",
"pytest-cov",
"pytest-timeout",
"pytest-xdist",
"pytest-datadir",
"requests_testadapter",
"httpx",
"polyfactory==2.19.0",
"humanize==4.12.1",
]
[tool.uv]
# Prevent opencv-python from ever being chosen during dependency resolution.
# This prevents conflicts with opencv-contrib-python, which Invoke requires.
override-dependencies = ["opencv-python; sys_platform=='never'"]
conflicts = [[{ extra = "cpu" }, { extra = "cuda" }, { extra = "rocm" }, { extra = "xpu" }]]
index-strategy = "unsafe-best-match"
# Restrict resolution to the platforms we support: x86_64/aarch64 Linux, Windows
# (x64 and ARM64 -- both are `win32`), and macOS. (ROCm and the PyTorch WHL-index
# pins are x86_64-only; on aarch64 Linux torch/torchvision fall back to PyPI and on
# Windows ARM64 to NVIDIA's index via the markers below.)
environments = ["sys_platform == 'win32' or sys_platform == 'darwin' or (sys_platform == 'linux' and (platform_machine == 'x86_64' or platform_machine == 'aarch64'))"]
# Windows on ARM64 must stay installable: uv refuses to lock a wheel-only package that has no
# win_arm64 wheel. It does not cover packages that also publish an sdist (uv would happily lock
# one and the build would fail on the user's machine), which is why the `; sys_platform == 'win32'
# and platform_machine == 'ARM64'` forks above pin ARM64-capable versions explicitly, and why
# scripts/check_platform_locks.py walks the platform's whole closure for wheel availability.
required-environments = ["sys_platform == 'win32' and platform_machine == 'ARM64'"]
# Hold every resolution on Windows and Linux x86_64 to the torch the backend extras pin -- including the
# no-extra one, which is what CI installs and tests. Without this the lock is free to keep an older torch
# there, or move it to the newest PyPI release, independently of the extras. `tool.uv` never reaches the
# published metadata, so installing the released package with `--torch-backend` keeps the open range of the base
# requirement; only `uv pip install` inside a checkout is held to it.
# `==2.13.0` also matches the local builds (+cpu, +cu130, +rocm10.0.0, +xpu).
constraint-dependencies = [
"torch==2.13.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
"torchvision==0.28.0; (sys_platform == 'win32' and platform_machine != 'ARM64') or (sys_platform == 'linux' and platform_machine == 'x86_64')",
]
# compel, could you please not pull in all of Jupyter. (compel declares `notebook>=6.5.7` but does not
# reference IPython/Jupyter anywhere in its code.) Dropping it takes ~65 packages out of the environment.
#
# Deliberately the *global* form rather than `{ package = ..., dependencies = ... }`: the per-package form
# needs uv >= 0.11.25 and is a hard parse error on 0.10.0 - 0.11.24, while this form has been understood
# since uv 0.9.8 and resolves to exactly the same set. Older uv only warns and ignores it, so no install
# path breaks -- and the launcher syncs `--frozen` from the lockfile below, so users get the trimmed
# environment whichever uv they have. Keep it that way: a `required-version` here would hard-fail the uv
# 0.6.12 bundled in launcher <= 1.8.1 for no gain, since CI's `uv lock --locked` already catches a
# lockfile regenerated by a uv too old to honor this.
exclude-dependencies = ["notebook"]
# The Linux and Windows wheels of this build share a version but not their requirements: only the Linux wheel
# requires (AMD's) triton, without a marker. uv reads one wheel's metadata for both, so restate the union here.
[[tool.uv.dependency-metadata]]
name = "torch"
version = "2.13.0+rocm10.0.0"
requires-dist = [
"filelock",
"typing-extensions>=4.10.0",
"setuptools>=77.0.3",
"sympy>=1.13.3",
"networkx>=2.5.1",
"jinja2",
"fsspec>=0.8.5",
"rocm[libraries]==10.0.0",
"rocm-bootstrap",
"triton==3.8.0+git4cff872c.rocm10.0.0; sys_platform == 'linux'",
]
# `rocm` is published only as an sdist whose build asks the machine's GPU which kernel package to require, so the
# lock would depend on the machine that wrote it. Its target-independent requirements, from rocm_sdk._dist_info;
# the kernel packages are listed in the rocm extra instead.
[[tool.uv.dependency-metadata]]
name = "rocm"
version = "10.0.0"
requires-dist = [
"rocm-sdk-core==10.0.0",
"rocm-sdk-libraries==10.0.0; extra == 'libraries'",
]
provides-extras = ["libraries"]
[tool.uv.sources]
# Keep linux_aarch64 and macOS off the PyTorch and AMD indexes so that uv resolves their
# 2.7.1 fallback pins from PyPI; see the note above the extras. Windows ARM64 is routed, with or without
# an extra, to NVIDIA's out-of-tree index.
torch = [
{ index = "torch-nvidia-win-arm64", marker = "sys_platform == 'win32' and platform_machine == 'ARM64'" },
{ index = "torch-cpu", extra = "cpu", marker = "(sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')" },
{ index = "torch-cuda", extra = "cuda", marker = "(sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')" },
{ index = "torch-rocm", extra = "rocm", marker = "(sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')" },
{ index = "torch-xpu", extra = "xpu", marker = "(sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')" },
{ index = "pypi", marker = "sys_platform == 'linux' and platform_machine == 'aarch64'" },
]
torchvision = [
{ index = "torch-nvidia-win-arm64", marker = "sys_platform == 'win32' and platform_machine == 'ARM64'" },
{ index = "torch-cpu", extra = "cpu", marker = "(sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')" },
{ index = "torch-cuda", extra = "cuda", marker = "(sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')" },
{ index = "torch-rocm", extra = "rocm", marker = "(sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')" },
{ index = "torch-xpu", extra = "xpu", marker = "(sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')" },
{ index = "pypi", marker = "sys_platform == 'linux' and platform_machine == 'aarch64'" },
]
# Only the rocm extra takes AMD's triton; cuda and the no-extra resolution keep PyPI's.
triton = [
{ index = "torch-rocm", extra = "rocm", marker = "sys_platform == 'linux' and platform_machine == 'x86_64'" },
]
# Packages that exist only on AMD's index.
rocm = { index = "torch-rocm" }
rocm-sdk-core = { index = "torch-rocm" }
rocm-sdk-libraries = { index = "torch-rocm" }
amd-torch-device-gfx1010 = { index = "torch-rocm" }
amd-torchvision-device-gfx1010 = { index = "torch-rocm" }
rocm-sdk-device-gfx1010 = { index = "torch-rocm" }
amd-torch-device-gfx1011 = { index = "torch-rocm" }
amd-torchvision-device-gfx1011 = { index = "torch-rocm" }
rocm-sdk-device-gfx1011 = { index = "torch-rocm" }
amd-torch-device-gfx1012 = { index = "torch-rocm" }
amd-torchvision-device-gfx1012 = { index = "torch-rocm" }
rocm-sdk-device-gfx1012 = { index = "torch-rocm" }
amd-torch-device-gfx1030 = { index = "torch-rocm" }
amd-torchvision-device-gfx1030 = { index = "torch-rocm" }
rocm-sdk-device-gfx1030 = { index = "torch-rocm" }
amd-torch-device-gfx1031 = { index = "torch-rocm" }
amd-torchvision-device-gfx1031 = { index = "torch-rocm" }
rocm-sdk-device-gfx1031 = { index = "torch-rocm" }
amd-torch-device-gfx1032 = { index = "torch-rocm" }
amd-torchvision-device-gfx1032 = { index = "torch-rocm" }
rocm-sdk-device-gfx1032 = { index = "torch-rocm" }
amd-torch-device-gfx1033 = { index = "torch-rocm" }
amd-torchvision-device-gfx1033 = { index = "torch-rocm" }
rocm-sdk-device-gfx1033 = { index = "torch-rocm" }
amd-torch-device-gfx1034 = { index = "torch-rocm" }
amd-torchvision-device-gfx1034 = { index = "torch-rocm" }
rocm-sdk-device-gfx1034 = { index = "torch-rocm" }
amd-torch-device-gfx1035 = { index = "torch-rocm" }
amd-torchvision-device-gfx1035 = { index = "torch-rocm" }
rocm-sdk-device-gfx1035 = { index = "torch-rocm" }
amd-torch-device-gfx1036 = { index = "torch-rocm" }
amd-torchvision-device-gfx1036 = { index = "torch-rocm" }
rocm-sdk-device-gfx1036 = { index = "torch-rocm" }
amd-torch-device-gfx110x = { index = "torch-rocm" }
amd-torch-device-gfx1100 = { index = "torch-rocm" }
amd-torchvision-device-gfx1100 = { index = "torch-rocm" }
rocm-sdk-device-gfx1100 = { index = "torch-rocm" }
amd-torch-device-gfx1101 = { index = "torch-rocm" }
amd-torchvision-device-gfx1101 = { index = "torch-rocm" }
rocm-sdk-device-gfx1101 = { index = "torch-rocm" }
amd-torch-device-gfx1102 = { index = "torch-rocm" }
amd-torchvision-device-gfx1102 = { index = "torch-rocm" }
rocm-sdk-device-gfx1102 = { index = "torch-rocm" }
amd-torch-device-gfx1103 = { index = "torch-rocm" }
amd-torchvision-device-gfx1103 = { index = "torch-rocm" }
rocm-sdk-device-gfx1103 = { index = "torch-rocm" }
amd-torch-device-gfx115x = { index = "torch-rocm" }
amd-torch-device-gfx1150 = { index = "torch-rocm" }
amd-torchvision-device-gfx1150 = { index = "torch-rocm" }
rocm-sdk-device-gfx1150 = { index = "torch-rocm" }
amd-torch-device-gfx1151 = { index = "torch-rocm" }
amd-torchvision-device-gfx1151 = { index = "torch-rocm" }
rocm-sdk-device-gfx1151 = { index = "torch-rocm" }
amd-torch-device-gfx1152 = { index = "torch-rocm" }
amd-torchvision-device-gfx1152 = { index = "torch-rocm" }
rocm-sdk-device-gfx1152 = { index = "torch-rocm" }
amd-torch-device-gfx1153 = { index = "torch-rocm" }
amd-torchvision-device-gfx1153 = { index = "torch-rocm" }
rocm-sdk-device-gfx1153 = { index = "torch-rocm" }
amd-torch-device-gfx12-0 = { index = "torch-rocm" }
amd-torch-device-gfx1200 = { index = "torch-rocm" }
amd-torchvision-device-gfx1200 = { index = "torch-rocm" }
rocm-sdk-device-gfx1200 = { index = "torch-rocm" }
amd-torch-device-gfx1201 = { index = "torch-rocm" }
amd-torchvision-device-gfx1201 = { index = "torch-rocm" }
rocm-sdk-device-gfx1201 = { index = "torch-rocm" }
amd-torch-device-gfx908 = { index = "torch-rocm" }
amd-torchvision-device-gfx908 = { index = "torch-rocm" }
rocm-sdk-device-gfx908 = { index = "torch-rocm" }
amd-torch-device-gfx90a = { index = "torch-rocm" }
amd-torchvision-device-gfx90a = { index = "torch-rocm" }
rocm-sdk-device-gfx90a = { index = "torch-rocm" }
amd-torch-device-gfx1250 = { index = "torch-rocm" }
amd-torchvision-device-gfx1250 = { index = "torch-rocm" }
rocm-sdk-device-gfx1250 = { index = "torch-rocm" }
amd-torch-device-gfx942 = { index = "torch-rocm" }
amd-torchvision-device-gfx942 = { index = "torch-rocm" }
rocm-sdk-device-gfx942 = { index = "torch-rocm" }
amd-torch-device-gfx950 = { index = "torch-rocm" }
amd-torchvision-device-gfx950 = { index = "torch-rocm" }
rocm-sdk-device-gfx950 = { index = "torch-rocm" }
# PyPI's xformers wheels are built against CUDA 12.8 and cannot load their extension next to a CUDA 13 torch (every
# memory-efficient attention call then fails); PyTorch's cu130 index carries the CUDA 13 build of the same release.
# Not scoped to the `cuda` extra: uv only allows that for packages the extra itself lists, and the CUDA 13 torch that
# PyPI serves on Linux needs the same build. The cpu/rocm/xpu builds cannot use xformers' CUDA kernels either way.
xformers = [
{ index = "torch-cuda", marker = "(sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')" },
]
triton-xpu = [
{ index = "torch-xpu", marker = "(sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')" },
]
# Windows ARM64 wheels PyPI does not provide, built by .github/workflows/build-win-arm64-wheels.yml
# and served from the release's index page. Elsewhere these resolve from PyPI as usual.
opencv-contrib-python = [{ index = "invoke-win-arm64-wheels", marker = "sys_platform == 'win32' and platform_machine == 'ARM64'" }]
blake3 = [{ index = "invoke-win-arm64-wheels", marker = "sys_platform == 'win32' and platform_machine == 'ARM64'" }]
tiktoken = [{ index = "invoke-win-arm64-wheels", marker = "sys_platform == 'win32' and platform_machine == 'ARM64'" }]
[[tool.uv.index]]
name = "pypi"
url = "https://pypi.org/simple"
[[tool.uv.index]]
name = "torch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[[tool.uv.index]]
name = "torch-cuda"
url = "https://download.pytorch.org/whl/cu130"
explicit = true
# AMD's index also mirrors PyPI packages (numpy, pillow, sympy, ...) without hashes, so it must stay explicit.
[[tool.uv.index]]
name = "torch-rocm"
url = "https://stable.repo.amd.com/rocm/whl-next/"
explicit = true
[[tool.uv.index]]
name = "torch-xpu"
url = "https://download.pytorch.org/whl/xpu"
explicit = true
# NVIDIA's out-of-tree PyTorch for Windows on ARM64 (RTX Spark): torch 2.14.0+cu134 and torchvision
# 0.29.0+cu134, win_arm64 only. The torch wheel bundles cuBLAS, cuDNN, cuFFT and NVRTC (1.85 GB).
[[tool.uv.index]]
name = "torch-nvidia-win-arm64"
url = "https://pypi.nvidia.com/nvtorch_oot/"
explicit = true
# A flat (find-links style) page listing this repo's self-built win_arm64 wheels, published as
# release assets by .github/workflows/build-win-arm64-wheels.yml. Bump the tag together with the
# ARM64 pins of the packages it serves.
[[tool.uv.index]]
name = "invoke-win-arm64-wheels"
url = "https://github.com/invoke-ai/InvokeAI/releases/download/win-arm64-wheels-v1/index.html"
format = "flat"
explicit = true
[project.scripts]
"invokeai-web" = "invokeai.app.run_app:run_app"
"invoke-useradd" = "invokeai.app.util.user_management:useradd"
"invoke-userdel" = "invokeai.app.util.user_management:userdel"
"invoke-userlist" = "invokeai.app.util.user_management:userlist"
"invoke-usermod" = "invokeai.app.util.user_management:usermod"
"invoke-db-copy" = "invokeai.app.util.database_copy:main"
[project.urls]
"Homepage" = "https://invoke.ai/"
"Documentation" = "https://invoke.ai/"
"Source" = "https://github.com/invoke-ai/InvokeAI/"
"Bug Reports" = "https://github.com/invoke-ai/InvokeAI/issues"
"Discord" = "https://discord.gg/ZmtBAhwWhy"
[tool.setuptools.dynamic]
version = { attr = "invokeai.version.__version__" }
[tool.setuptools.packages.find]
"where" = ["."]
"include" = [
"invokeai.assets.fonts*",
"invokeai.version*",
"invokeai.generator*",
"invokeai.backend*",
"invokeai.frontend*",
"invokeai.frontend.webv1.dist*",
"invokeai.frontend.webv1.static*",
"invokeai.configs*",
"invokeai.app*",
"invokeai.invocation_api*",
]
[tool.setuptools.package-data]
"invokeai.app.assets" = ["**/*.png"]
"invokeai.backend.qwen3" = ["tokenizer/*.json", "tokenizer/*.json.gz"]
"invokeai.backend.qwen3_vl" = ["tokenizer/*.json", "tokenizer/*.json.gz", "config/*.json"]
"invokeai.backend.qwen3_5" = ["*.json", "tokenizer/*.json", "tokenizer/*.json.gz"]
"invokeai.backend.qwen2_5_vl" = ["*.json", "tokenizer/*.json", "tokenizer/*.json.gz"]
# Read at load time by the MiniMax H3 single-file encoder loader. Without this the file is
# absent from a wheel install and that loader raises FileNotFoundError.
"invokeai.backend.minimax_h3" = ["*.json"]
"invokeai.backend.t5" = ["tokenizer/*.json"]
# Fitted working-memory coefficients, read by every estimator that declares an EstimatorSpec.
"invokeai.backend.working_memory" = ["data/*.json"]
"invokeai.backend.clip" = ["*.json", "tokenizer/*.json", "tokenizer/*.gz"]
"invokeai.app.services.image_index" = ["*.txt"]
"invokeai.app.services.workflow_records.default_workflows" = ["*.json"]
"invokeai.backend.hidiffusion" = ["sd_module_key/*.txt"]
"invokeai.app.services.style_preset_records" = ["*.json"]
"invokeai.app.services.style_preset_images.default_style_preset_images" = [
"*.png",
]
"invokeai.assets.fonts" = ["**/*.ttf"]
"invokeai.backend" = ["**.png", "**/*.icc"]
"invokeai.configs" = ["*.example", "**/*.yaml", "*.txt"]
"invokeai.frontend.webv1.dist" = ["**"]
"invokeai.frontend.webv2.dist" = ["**"]
"invokeai.frontend.webv1.static" = ["**"]
"invokeai.app.invocations" = ["**"]
#=== Begin: PyTest and Coverage
[tool.pytest.ini_options]
# `--dist loadfile` keeps a file's tests together on one xdist worker, so module-scoped
# fixtures are set up once per file instead of in every worker that received part of it.
# It is not isolation: a worker process runs many files, in an order that depends on the
# worker count and on which file finished first, so a file must still set up its own
# process-global state. It costs nothing -- per-test distribution measured the same wall
# clock on the full suite -- and it lives here rather than in the CI command so that it
# also holds when `-n` is passed by hand. Coverage is opt-in via `--cov`.
addopts = "--strict-markers --dist loadfile -m \"not slow\""
markers = [
"slow: Marks tests as slow. Disabled by default. To run all tests, use -m \"\". To run only slow tests, use -m \"slow\".",
"timeout: Marks the timeout override.",
"uses_database: Runs on the `empty_database` fixture, which targets INVOKEAI_TEST_DB_URL when it is set and SQLite otherwise. Applied by the collection hook in tests/conftest.py.",
"sqlite_only: Depends on SQLite internals (query plans, PRAGMAs, the single connection); skipped when INVOKEAI_TEST_DB_URL targets another backend.",
"platform_independent: The outcome cannot depend on the operating system for the same dependency set: import-graph boundaries in a fresh interpreter, static source scans, deterministic counts and shapes. Windows CI, which installs the linux dependency set, deselects them.",
"ffmpeg: Runs an ffmpeg binary or loads the libav libraries. The windows-cpu CI job, whose Server Core runner cannot load them, deselects them; windows-ffmpeg runs only these.",
]
# A cache-key or other SQLAlchemy warning is a bug in the query layer, not noise.
filterwarnings = ["error::sqlalchemy.exc.SAWarning"]
[tool.coverage.run]
branch = true
source = ["invokeai"]
omit = ["*tests*", "*migrations*", ".venv/*", "*.env"]
[tool.coverage.report]
show_missing = true
fail_under = 85 # let's set something sensible on Day 1 ...
[tool.coverage.json]
output = "coverage/coverage.json"
pretty_print = true
[tool.coverage.html]
directory = "coverage/html"
[tool.coverage.xml]
output = "coverage/index.xml"
#=== End: PyTest and Coverage
#=== Begin: Ruff
[tool.ruff]
line-length = 120
exclude = [
".git",
"__pycache__",
"build",
"dist",
"invokeai/frontend/api/node_modules/",
"invokeai/frontend/webv1/node_modules/",
"invokeai/frontend/webv2/node_modules/",
".venv*",
"*.ipynb",
"invokeai/backend/image_util/mediapipe_face/", # External code
"invokeai/backend/image_util/mlsd/", # External code
"invokeai/backend/image_util/normal_bae/", # External code
"invokeai/backend/image_util/pidi/", # External code
"invokeai/backend/image_util/imwatermark/", # External code
]
[tool.ruff.lint]
ignore = [
"E501", # https://docs.astral.sh/ruff/rules/line-too-long/
"C901", # https://docs.astral.sh/ruff/rules/complex-structure/
"B008", # https://docs.astral.sh/ruff/rules/function-call-in-default-argument/
"B904", # https://docs.astral.sh/ruff/rules/raise-without-from-inside-except/
]
select = ["B", "C", "E", "F", "W", "I", "TID"]
[tool.ruff.lint.per-file-ignores]
# Vendored from the diffusers MiniMax-H3 branch (see invokeai/backend/minimax_h3/__init__.py);
# kept as close to upstream as possible, so upstream's zip() style is tolerated.
"invokeai/backend/minimax_h3/transformer_minimax_h3.py" = ["B905"]
"invokeai/backend/minimax_h3/autoencoder_kl_minimax_h3.py" = ["B905"]
"invokeai/backend/minimax_h3/autoencoder_kl_minimax_h3_audio.py" = ["B905"]
"invokeai/backend/minimax_h3/scheduling_minimax_h3.py" = ["B905"]
# Vendored from OpenMOSS-Team/MOSS-Image-Base (see invokeai/backend/moss_image/__init__.py). Upstream's
# import order is kept so that a diff against upstream shows nothing but the code removed locally.
"invokeai/backend/moss_image/pipeline_moss_image.py" = ["I001"]
[tool.ruff.format]
# The vendored MiniMax-H3 files are kept byte-identical to upstream diffusers (modulo the
# absolute-import rewrite) so that re-syncing when a tagged diffusers ships them is a clean copy
# rather than a manual re-application of formatting. Upstream wraps at a narrower line length, so
# `ruff format` would rewrap lines for no semantic gain. `ruff check` still runs on them, so the
# import sorting this project does enforce stays enforced.
#
# Listed file by file rather than as a directory glob: the package also holds first-party modules
# (presets.py, sampling.py, denoise.py, int8_convrot.py, ...) which must stay formatted.
exclude = [
"invokeai/backend/minimax_h3/packing.py",
"invokeai/backend/minimax_h3/transformer_minimax_h3.py",
"invokeai/backend/minimax_h3/autoencoder_kl_minimax_h3.py",
"invokeai/backend/minimax_h3/autoencoder_kl_minimax_h3_audio.py",
"invokeai/backend/minimax_h3/scheduling_minimax_h3.py",
# Vendored MOSS-Image model code, kept identical to upstream (see invokeai/backend/moss_image/__init__.py).
"invokeai/backend/moss_image/pipeline_moss_image.py",
]
[tool.ruff.lint.flake8-tidy-imports]
# Disallow all relative imports.
ban-relative-imports = "all"
#=== End: Ruff
#=== Begin: MyPy
# global mypy config
[tool.mypy]
ignore_missing_imports = true # ignores missing types in third-party libraries
strict = true
plugins = "pydantic.mypy"
exclude = ["tests/*"]
# overrides for specific modules
[[tool.mypy.overrides]]
follow_imports = "skip" # skips type checking of the modules listed below
module = [
"invokeai.app.api.routers.models",
"invokeai.app.invocations.text_encoder.compel",
"invokeai.app.invocations.sd.denoise_latents",
"invokeai.app.services.invocation_stats.invocation_stats_default",
"invokeai.app.services.model_manager.model_manager_base",
"invokeai.app.services.model_manager.model_manager_default",
"invokeai.app.services.model_manager.store.model_records_sql",
"invokeai.app.util.controlnet_utils",
"invokeai.backend.image_util.txt2mask",
"invokeai.backend.image_util.safety_checker",
"invokeai.backend.image_util.patchmatch",
"invokeai.backend.image_util.invisible_watermark",
"invokeai.backend.install.model_install_backend",
"invokeai.backend.ip_adapter.ip_adapter",
"invokeai.backend.ip_adapter.resampler",
"invokeai.backend.ip_adapter.unet_patcher",
"invokeai.backend.model_management.convert_ckpt_to_diffusers",
"invokeai.backend.model_management.lora",
"invokeai.backend.model_management.model_cache",
"invokeai.backend.model_management.model_manager",
"invokeai.backend.model_management.model_merge",
"invokeai.backend.model_management.model_probe",
"invokeai.backend.model_management.model_search",
"invokeai.backend.model_management.models.*", # this is needed to ignore the module's `__init__.py`
"invokeai.backend.model_management.models.base",
"invokeai.backend.model_management.models.controlnet",
"invokeai.backend.model_management.models.ip_adapter",
"invokeai.backend.model_management.models.lora",
"invokeai.backend.model_management.models.sdxl",
"invokeai.backend.model_management.models.stable_diffusion",
"invokeai.backend.model_management.models.vae",
"invokeai.backend.model_management.seamless",
"invokeai.backend.model_management.util",
"invokeai.backend.stable_diffusion.diffusers_pipeline",
"invokeai.backend.stable_diffusion.diffusion.shared_invokeai_diffusion",
"invokeai.backend.util.hotfixes",
"invokeai.backend.util.mps_fixes",
"invokeai.backend.util.util",
"invokeai.frontend.install.model_install",
]
#=== End: MyPy
[tool.pyright]
# Start from strict mode
typeCheckingMode = "strict"
# This errors whenever an import is missing a type stub file - way too noisy
reportMissingTypeStubs = "none"
# These are the rest of the rules enabled by strict mode - enable them @ warning
reportConstantRedefinition = "warning"
reportDeprecated = "warning"
reportDuplicateImport = "warning"
reportIncompleteStub = "warning"
reportInconsistentConstructor = "warning"
reportInvalidStubStatement = "warning"
reportMatchNotExhaustive = "warning"
reportMissingParameterType = "warning"
reportMissingTypeArgument = "warning"
reportPrivateUsage = "warning"
reportTypeCommentUsage = "warning"
reportUnknownArgumentType = "warning"
reportUnknownLambdaType = "warning"
reportUnknownMemberType = "warning"
reportUnknownParameterType = "warning"
reportUnknownVariableType = "warning"
reportUnnecessaryCast = "warning"
reportUnnecessaryComparison = "warning"
reportUnnecessaryContains = "warning"
reportUnnecessaryIsInstance = "warning"
reportUnusedClass = "warning"
reportUnusedImport = "warning"
reportUnusedFunction = "warning"
reportUnusedVariable = "warning"
reportUntypedBaseClass = "warning"
reportUntypedClassDecorator = "warning"
reportUntypedFunctionDecorator = "warning"
reportUntypedNamedTuple = "warning"