horde-model-reference 0.6.2__tar.gz → 0.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/.github/workflows/maintests.yml +2 -0
  2. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/.github/workflows/prtests.yml +2 -0
  3. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/.pre-commit-config.yaml +4 -4
  4. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/PKG-INFO +1 -1
  5. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/_version.py +2 -2
  6. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/legacy/classes/raw_legacy_model_database_records.py +2 -0
  7. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/legacy/classes/staging_model_database_records.py +3 -0
  8. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/meta_consts.py +4 -0
  9. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/model_reference_records.py +6 -0
  10. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference.egg-info/PKG-INFO +1 -1
  11. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/legacy_stable_diffusion.schema.json +49 -0
  12. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/requirements.dev.txt +6 -6
  13. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/stable_diffusion.example.json +4 -0
  14. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/stable_diffusion.schema.json +51 -1
  15. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/tests/test_scripts.py +1 -1
  16. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/.CONTRIBUTING.md +0 -0
  17. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/.github/dependabot.yml +0 -0
  18. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/.github/workflows/codeql.yml +0 -0
  19. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/.github/workflows/release.yml +0 -0
  20. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/.gitignore +0 -0
  21. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/LICENSE +0 -0
  22. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/MANIFEST.in +0 -0
  23. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/README.md +0 -0
  24. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/create_example_json.py +0 -0
  25. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/get_all_names.py +0 -0
  26. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/__init__.py +0 -0
  27. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/legacy/README.md +0 -0
  28. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/legacy/__init__.py +0 -0
  29. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/legacy/add_to_legacy_sd.py +0 -0
  30. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/legacy/classes/__init__.py +0 -0
  31. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/legacy/classes/legacy_converters.py +0 -0
  32. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/legacy/convert_all_legacy_dbs.py +0 -0
  33. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/legacy/download_live_legacy_dbs.py +0 -0
  34. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/legacy/get_all_filesizes.py +0 -0
  35. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/legacy/legacy_download_manager.py +0 -0
  36. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/legacy/validate_sd.py +0 -0
  37. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/model_reference_manager.py +0 -0
  38. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/path_consts.py +0 -0
  39. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/py.typed +0 -0
  40. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/showcase/README.md +0 -0
  41. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference/util.py +0 -0
  42. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference.egg-info/SOURCES.txt +0 -0
  43. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference.egg-info/dependency_links.txt +0 -0
  44. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference.egg-info/entry_points.txt +0 -0
  45. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference.egg-info/requires.txt +0 -0
  46. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/horde_model_reference.egg-info/top_level.txt +0 -0
  47. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/pyproject.toml +0 -0
  48. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/requirements.txt +0 -0
  49. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/setup.cfg +0 -0
  50. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/tests/__init__.py +0 -0
  51. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/tests/conftest.py +0 -0
  52. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/tests/test_consts.py +0 -0
  53. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/tests/test_convert_legacy_database.py +0 -0
  54. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/tests/test_examples.py +0 -0
  55. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/tests/test_model_reference_manager.py +0 -0
  56. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/tests/test_records.py +0 -0
  57. {horde_model_reference-0.6.2 → horde_model_reference-0.7.0}/tox.ini +0 -0
@@ -22,6 +22,8 @@ jobs:
22
22
  - uses: actions/checkout@v3
23
23
  - name: Run pre-commit
24
24
  uses: pre-commit/action@v3.0.0
25
+ with:
26
+ extra_args: --all-files
25
27
 
26
28
  no_extra_fields:
27
29
  env:
@@ -25,6 +25,8 @@ jobs:
25
25
  - uses: actions/checkout@v3
26
26
  - name: Run pre-commit
27
27
  uses: pre-commit/action@v3.0.0
28
+ with:
29
+ extra_args: --all-files
28
30
 
29
31
  no_extra_fields:
30
32
  env:
@@ -1,20 +1,20 @@
1
1
  repos:
2
2
  - repo: https://github.com/pre-commit/pre-commit-hooks
3
- rev: v4.5.0
3
+ rev: v4.6.0
4
4
  hooks:
5
5
  - id: check-yaml
6
6
  - id: end-of-file-fixer
7
7
  - id: trailing-whitespace
8
8
  - repo: https://github.com/psf/black
9
- rev: 24.2.0
9
+ rev: 24.4.2
10
10
  hooks:
11
11
  - id: black
12
12
  - repo: https://github.com/astral-sh/ruff-pre-commit
13
- rev: v0.2.2
13
+ rev: v0.4.7
14
14
  hooks:
15
15
  - id: ruff
16
16
  - repo: https://github.com/pre-commit/mirrors-mypy
17
- rev: 'v1.8.0'
17
+ rev: 'v1.10.0'
18
18
  hooks:
19
19
  - id: mypy
20
20
  additional_dependencies: [pydantic, types-requests, types-pytz, types-setuptools, types-urllib3, StrEnum]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: horde_model_reference
3
- Version: 0.6.2
3
+ Version: 0.7.0
4
4
  Summary: A helper library providing a way to work with the lists of diffusion models, utility models, and any other related files required for AI-Horde.
5
5
  Author-email: tazlin <tazlin.on.github@gmail.com>, db0 <mail@dbzer0.com>, Jug <jugdev@proton.me>
6
6
  License: GNU AFFERO GENERAL PUBLIC LICENSE
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = 'v0.6.2'
16
- __version_tuple__ = version_tuple = (0, 6, 2)
15
+ __version__ = version = 'v0.7.0'
16
+ __version_tuple__ = version_tuple = (0, 7, 0)
@@ -46,6 +46,7 @@ class RawLegacy_StableDiffusion_ModelRecord(BaseModel):
46
46
 
47
47
  name: str
48
48
  baseline: str
49
+ optimization: str | None = None
49
50
  type: str
50
51
  inpainting: bool
51
52
  description: str | None = None
@@ -58,6 +59,7 @@ class RawLegacy_StableDiffusion_ModelRecord(BaseModel):
58
59
  homepage: str | None = None
59
60
  nsfw: bool
60
61
  download_all: bool
62
+ requirements: dict[str, int | str | list[int] | list[str] | bool] | None = None
61
63
  config: Mapping[str, list[RawLegacy_FileRecord | RawLegacy_DownloadRecord]]
62
64
  available: bool | None = None
63
65
  features_not_supported: list[FEATURE_SUPPORTED] | None = None
@@ -95,6 +95,8 @@ class Legacy_StableDiffusion_ModelRecord(StagingLegacy_Generic_ModelRecord):
95
95
  trigger: list[str] | None = None
96
96
  homepage: str | None = None
97
97
  size_on_disk_bytes: int | None = None
98
+ optimization: str | None = None
99
+ requirements: dict[str, int | str | list[int] | list[str] | bool] | None = None
98
100
 
99
101
 
100
102
  class Legacy_Generic_ModelReference(BaseModel):
@@ -124,4 +126,5 @@ MODEL_REFERENCE_LEGACY_TYPE_LOOKUP: dict[MODEL_REFERENCE_CATEGORY, type[StagingL
124
126
  MODEL_REFERENCE_CATEGORY.gfpgan: StagingLegacy_Generic_ModelRecord,
125
127
  MODEL_REFERENCE_CATEGORY.safety_checker: StagingLegacy_Generic_ModelRecord,
126
128
  MODEL_REFERENCE_CATEGORY.stable_diffusion: Legacy_StableDiffusion_ModelRecord,
129
+ MODEL_REFERENCE_CATEGORY.miscellaneous: StagingLegacy_Generic_ModelRecord,
127
130
  }
@@ -60,6 +60,7 @@ class MODEL_REFERENCE_CATEGORY(StrEnum):
60
60
  gfpgan = auto()
61
61
  safety_checker = auto()
62
62
  stable_diffusion = auto()
63
+ miscellaneous = auto()
63
64
 
64
65
 
65
66
  class MODEL_PURPOSE(StrEnum):
@@ -78,6 +79,8 @@ class MODEL_PURPOSE(StrEnum):
78
79
  post_processor = auto()
79
80
  """The model is a post processor (after image generation) of some variety."""
80
81
 
82
+ miscellaneous = auto()
83
+
81
84
 
82
85
  class STABLE_DIFFUSION_BASELINE_CATEGORY(StrEnum):
83
86
  """An enum of all the stable diffusion baselines."""
@@ -98,4 +101,5 @@ MODEL_PURPOSE_LOOKUP: dict[MODEL_REFERENCE_CATEGORY, MODEL_PURPOSE] = {
98
101
  MODEL_REFERENCE_CATEGORY.gfpgan: MODEL_PURPOSE.post_processor,
99
102
  MODEL_REFERENCE_CATEGORY.safety_checker: MODEL_PURPOSE.post_processor,
100
103
  MODEL_REFERENCE_CATEGORY.stable_diffusion: MODEL_PURPOSE.image_generation,
104
+ MODEL_REFERENCE_CATEGORY.miscellaneous: MODEL_PURPOSE.miscellaneous,
101
105
  }
@@ -72,6 +72,8 @@ class StableDiffusion_ModelRecord(Generic_ModelRecord):
72
72
  """If this is an inpainting model or not."""
73
73
  baseline: STABLE_DIFFUSION_BASELINE_CATEGORY | str
74
74
  """The model on which this model is based."""
75
+ optimization: str | None = None
76
+ """The optimization type of the model."""
75
77
  tags: list[str] | None = []
76
78
  """Any tags associated with the model which may be useful for searching."""
77
79
  showcases: list[str] | None = []
@@ -88,6 +90,8 @@ class StableDiffusion_ModelRecord(Generic_ModelRecord):
88
90
  style: MODEL_STYLE | str | None = None
89
91
  """The style of the model."""
90
92
 
93
+ requirements: dict[str, int | str | list[int] | list[str] | bool] | None = None
94
+
91
95
  size_on_disk_bytes: int | None = None
92
96
 
93
97
  @model_validator(mode="after")
@@ -248,6 +252,7 @@ MODEL_REFERENCE_RECORD_TYPE_LOOKUP: dict[MODEL_REFERENCE_CATEGORY, type[Generic_
248
252
  MODEL_REFERENCE_CATEGORY.gfpgan: Generic_ModelRecord,
249
253
  MODEL_REFERENCE_CATEGORY.safety_checker: Generic_ModelRecord,
250
254
  MODEL_REFERENCE_CATEGORY.codeformer: Generic_ModelRecord,
255
+ MODEL_REFERENCE_CATEGORY.miscellaneous: Generic_ModelRecord,
251
256
  }
252
257
  """A lookup for the model record type based on the model category. See also `MODEL_REFERENCE_TYPE_LOOKUP`."""
253
258
 
@@ -260,5 +265,6 @@ MODEL_REFERENCE_TYPE_LOOKUP: dict[MODEL_REFERENCE_CATEGORY, type[Generic_ModelRe
260
265
  MODEL_REFERENCE_CATEGORY.gfpgan: Generic_ModelReference,
261
266
  MODEL_REFERENCE_CATEGORY.safety_checker: Generic_ModelReference,
262
267
  MODEL_REFERENCE_CATEGORY.codeformer: Generic_ModelReference,
268
+ MODEL_REFERENCE_CATEGORY.miscellaneous: Generic_ModelReference,
263
269
  }
264
270
  """A lookup for the model reference type based on the model category. See also `MODEL_REFERENCE_RECORD_TYPE_LOOKUP`."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: horde_model_reference
3
- Version: 0.6.2
3
+ Version: 0.7.0
4
4
  Summary: A helper library providing a way to work with the lists of diffusion models, utility models, and any other related files required for AI-Horde.
5
5
  Author-email: tazlin <tazlin.on.github@gmail.com>, db0 <mail@dbzer0.com>, Jug <jugdev@proton.me>
6
6
  License: GNU AFFERO GENERAL PUBLIC LICENSE
@@ -109,6 +109,18 @@
109
109
  "title": "Baseline",
110
110
  "type": "string"
111
111
  },
112
+ "optimization": {
113
+ "anyOf": [
114
+ {
115
+ "type": "string"
116
+ },
117
+ {
118
+ "type": "null"
119
+ }
120
+ ],
121
+ "default": null,
122
+ "title": "Optimization"
123
+ },
112
124
  "type": {
113
125
  "title": "Type",
114
126
  "type": "string"
@@ -222,6 +234,43 @@
222
234
  "title": "Download All",
223
235
  "type": "boolean"
224
236
  },
237
+ "requirements": {
238
+ "anyOf": [
239
+ {
240
+ "additionalProperties": {
241
+ "anyOf": [
242
+ {
243
+ "type": "integer"
244
+ },
245
+ {
246
+ "type": "string"
247
+ },
248
+ {
249
+ "items": {
250
+ "type": "integer"
251
+ },
252
+ "type": "array"
253
+ },
254
+ {
255
+ "items": {
256
+ "type": "string"
257
+ },
258
+ "type": "array"
259
+ },
260
+ {
261
+ "type": "boolean"
262
+ }
263
+ ]
264
+ },
265
+ "type": "object"
266
+ },
267
+ {
268
+ "type": "null"
269
+ }
270
+ ],
271
+ "default": null,
272
+ "title": "Requirements"
273
+ },
225
274
  "config": {
226
275
  "additionalProperties": {
227
276
  "items": {
@@ -1,9 +1,9 @@
1
- pytest==8.0.1
2
- mypy==1.8.0
3
- black==24.2.0
4
- ruff==0.2.2
5
- tox~=4.13.0
6
- pre-commit~=3.6.2
1
+ pytest==8.2.1
2
+ mypy==1.10.0
3
+ black==24.4.2
4
+ ruff==0.4.7
5
+ tox~=4.15.0
6
+ pre-commit~=3.7.1
7
7
  build>=0.10.0
8
8
  coverage>=7.2.7
9
9
 
@@ -18,6 +18,7 @@
18
18
  "features_not_supported": null,
19
19
  "inpainting": false,
20
20
  "baseline": "stable_diffusion_1",
21
+ "optimization": null,
21
22
  "tags": [
22
23
  "anime",
23
24
  "faces"
@@ -33,6 +34,7 @@
33
34
  "homepage": "https://www.not.a.real_website.com",
34
35
  "nsfw": false,
35
36
  "style": "generalist",
37
+ "requirements": null,
36
38
  "size_on_disk_bytes": 123456789
37
39
  },
38
40
  "example model 2": {
@@ -54,6 +56,7 @@
54
56
  "features_not_supported": null,
55
57
  "inpainting": false,
56
58
  "baseline": "stable_diffusion_1",
59
+ "optimization": null,
57
60
  "tags": [
58
61
  "anime",
59
62
  "faces"
@@ -69,6 +72,7 @@
69
72
  "homepage": "https://www.another_fake_website.com",
70
73
  "nsfw": true,
71
74
  "style": "anime",
75
+ "requirements": null,
72
76
  "size_on_disk_bytes": 123456789
73
77
  }
74
78
  }
@@ -54,7 +54,8 @@
54
54
  "controlnet",
55
55
  "clip",
56
56
  "blip",
57
- "post_processor"
57
+ "post_processor",
58
+ "miscellaneous"
58
59
  ],
59
60
  "title": "MODEL_PURPOSE",
60
61
  "type": "string"
@@ -174,6 +175,18 @@
174
175
  ],
175
176
  "title": "Baseline"
176
177
  },
178
+ "optimization": {
179
+ "anyOf": [
180
+ {
181
+ "type": "string"
182
+ },
183
+ {
184
+ "type": "null"
185
+ }
186
+ ],
187
+ "default": null,
188
+ "title": "Optimization"
189
+ },
177
190
  "tags": {
178
191
  "anyOf": [
179
192
  {
@@ -262,6 +275,43 @@
262
275
  "default": null,
263
276
  "title": "Style"
264
277
  },
278
+ "requirements": {
279
+ "anyOf": [
280
+ {
281
+ "additionalProperties": {
282
+ "anyOf": [
283
+ {
284
+ "type": "integer"
285
+ },
286
+ {
287
+ "type": "string"
288
+ },
289
+ {
290
+ "items": {
291
+ "type": "integer"
292
+ },
293
+ "type": "array"
294
+ },
295
+ {
296
+ "items": {
297
+ "type": "string"
298
+ },
299
+ "type": "array"
300
+ },
301
+ {
302
+ "type": "boolean"
303
+ }
304
+ ]
305
+ },
306
+ "type": "object"
307
+ },
308
+ {
309
+ "type": "null"
310
+ }
311
+ ],
312
+ "default": null,
313
+ "title": "Requirements"
314
+ },
265
315
  "size_on_disk_bytes": {
266
316
  "anyOf": [
267
317
  {
@@ -10,7 +10,7 @@ from horde_model_reference.path_consts import get_model_reference_file_path
10
10
  def test_download_all_model_references(base_path_for_tests: Path):
11
11
  reference_download_manager = LegacyReferenceDownloadManager(base_path=base_path_for_tests)
12
12
  download_models = reference_download_manager.download_all_legacy_model_references(overwrite_existing=True)
13
- assert len(download_models) == 8
13
+ assert len(download_models) == len(MODEL_REFERENCE_CATEGORY.__members__)
14
14
 
15
15
 
16
16
  def test_validate_stable_diffusion_model_reference(legacy_folder_for_tests: Path):