-
Notifications
You must be signed in to change notification settings - Fork 55
/
pyproject.toml
202 lines (182 loc) · 5 KB
/
pyproject.toml
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
[project]
name = "refiners"
dynamic = ["version"]
description = "The simplest way to train and run adapters on top of foundation models"
authors = [{ name = "The Finegrain Team", email = "[email protected]" }]
license = { text = "MIT License" }
dependencies = [
"torch>=2.1.1",
"safetensors>=0.4.5",
"pillow>=10.4.0",
"jaxtyping>=0.2.23",
"packaging>=23.2",
"numpy>=1.26.4",
]
readme = "README.md"
requires-python = ">= 3.10"
keywords = [
"pytorch",
"text-to-image",
"image-to-image",
"image-generation",
"diffusion-models",
"stable-diffusion",
"sd1.5",
"sdxl",
"background-generation",
"background-removal",
"shadow-generation",
"textual-inversion",
"adapters",
"controlnet",
"ip-adapter",
"t2i-adapter",
"lora",
"lcm",
"lcm-lora",
"upscaler",
"dinov2",
"segment-anything",
"sam",
]
classifiers = [
"Typing :: Typed",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"License :: OSI Approved :: MIT License",
]
[project.urls]
Homepage = "https://refine.rs/"
Documentation = "https://refine.rs/"
Repository = "https://github.com/finegrain-ai/refiners"
Issues = "https://github.com/finegrain-ai/refiners/issues"
[project.scripts]
get_weights = "refiners.conversion.cli:main"
[project.optional-dependencies]
training = [
"bitsandbytes>=0.41.2.post2",
"pydantic>=2.5.2",
"prodigyopt>=1.0",
"torchvision>=0.16.1",
"loguru>=0.7.2",
"wandb>=0.16.0",
"neptune>=1.10.4",
"datasets>=2.15.0",
"tomli>=2.0.1",
"gitpython>=3.1.43",
]
test = [
"pytest-rerunfailures>=14.0",
"diffusers>=0.26.1",
"transformers>=4.35.2",
"piq>=0.8.0",
"torchvision>=0.16.1",
# An unofficial Python package for Meta AI's Segment Anything Model: https://github.com/opengeos/segment-anything
"segment-anything-py>=1.0",
# Official Python package for HQ-SAM: https://github.com/SysCV/sam-hq
"segment-anything-hq>=0.3",
# HQ-SAM missing dependency: https://github.com/SysCV/sam-hq/pull/59
"timm>=0.5.0",
"sentencepiece>=0.2.0",
]
conversion = [
"huggingface-hub>=0.25.1",
"diffusers>=0.26.1",
"transformers>=4.35.2",
"segment-anything-py>=1.0",
"requests>=2.26.0",
"tqdm>=4.62.3",
]
doc = [
# required by mkdocs to format the signatures
"black>=24.1.1",
"mkdocs-material>=9.5.6",
"mkdocstrings[python]>=0.24.0",
"mkdocs-literate-nav>=0.6.1",
]
solutions = [
"huggingface-hub>=0.24.6",
]
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "vcs"
fallback-version = '0.0.0'
[tool.rye]
managed = true
dev-dependencies = [
"pyright==1.1.384",
"docformatter>=1.7.5",
"pytest>=8.0.0",
"coverage>=7.4.1",
"typos>=1.18.2",
"comfy-cli>=1.1.6",
]
[tool.hatch.metadata]
allow-direct-references = true
[tool.rye.scripts]
serve-docs = "mkdocs serve"
test-cov = "coverage run -m pytest"
# Work around for "Couldn't parse" errors due to e.g. opencv-python: https://github.com/nedbat/coveragepy/issues/1653
build-html-cov = { cmd = "coverage html", env = { PYTHONWARNINGS = "ignore:Couldn't parse::coverage.report_core" } }
serve-cov-report = { chain = [
"build-html-cov",
"python -m http.server 8080 -b 127.0.0.1 -d htmlcov",
] }
[tool.black]
line-length = 120
[tool.ruff]
src = ["src"] # see https://docs.astral.sh/ruff/settings/#src
line-length = 120
[tool.ruff.lint]
select = [
"I", # isort
]
ignore = [
"F722", # forward-annotation-syntax-error, because of Jaxtyping
"E731", # do-not-assign-lambda
]
[tool.ruff.lint.isort]
# Allow this kind of import on a single line:
#
# from torch import device as Device, dtype as DType
#
combine-as-imports = true
[tool.docformatter]
black = true
[tool.pyright]
include = ["src/refiners", "tests"]
strict = ["*"]
exclude = ["**/__pycache__", "tests/weights", "tests/repos"]
reportMissingTypeStubs = "warning"
[tool.coverage.run]
branch = true
source = ["src/refiners"]
# Also apply to HTML output, where appropriate
[tool.coverage.report]
ignore_errors = true # see `build-html-cov` for details
exclude_also = [
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
[tool.typos.default]
extend-ignore-identifiers-re = ["NDArray*", "interm", "af000ded", "nin"]
[tool.typos.default.extend-words]
adaptee = "adaptee" # Common name for an adapter's target
[tool.typos.default.extend-identifiers]
imaginAIry = "imaginAIry"
[tool.pytest.ini_options]
filterwarnings = [
"ignore::UserWarning:segment_anything_hq.modeling.tiny_vit_sam.*",
"ignore::DeprecationWarning:timm.models.layers.*",
"ignore::DeprecationWarning:timm.models.registry.*"
]
addopts = "--import-mode=importlib"