novelai-python 0.7.8__tar.gz → 0.7.10__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 (82) hide show
  1. {novelai_python-0.7.8 → novelai_python-0.7.10}/PKG-INFO +5 -3
  2. {novelai_python-0.7.8 → novelai_python-0.7.10}/README.md +4 -2
  3. {novelai_python-0.7.8 → novelai_python-0.7.10}/pyproject.toml +1 -1
  4. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/_enum.py +130 -41
  5. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/augment_image/_enum.py +2 -1
  6. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/generate_image/__init__.py +173 -448
  7. novelai_python-0.7.10/src/novelai_python/sdk/ai/generate_image/params.py +543 -0
  8. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/generate_image/schema.py +8 -4
  9. {novelai_python-0.7.8 → novelai_python-0.7.10}/LICENSE +0 -0
  10. {novelai_python-0.7.8 → novelai_python-0.7.10}/NOTICE.MD +0 -0
  11. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/__init__.py +0 -0
  12. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/_enum.py +0 -0
  13. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/_exceptions.py +0 -0
  14. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/_response/__init__.py +0 -0
  15. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/_response/ai/__init__.py +0 -0
  16. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/_response/ai/generate.py +0 -0
  17. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/_response/ai/generate_image.py +0 -0
  18. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/_response/ai/generate_stream.py +0 -0
  19. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/_response/ai/generate_voice.py +0 -0
  20. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/_response/ai/upscale.py +0 -0
  21. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/_response/schema.py +0 -0
  22. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/_response/user/__init__.py +0 -0
  23. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/_response/user/information.py +0 -0
  24. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/_response/user/login.py +0 -0
  25. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/_response/user/subscription.py +0 -0
  26. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/credential/ApiToken.py +0 -0
  27. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/credential/JwtToken.py +0 -0
  28. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/credential/UserAuth.py +0 -0
  29. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/credential/__init__.py +0 -0
  30. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/credential/_base.py +0 -0
  31. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/__init__.py +0 -0
  32. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/LICENSE +0 -0
  33. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/__init__.py +0 -0
  34. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/_const.py +0 -0
  35. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/_cost.py +0 -0
  36. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/augment_image/__init__.py +0 -0
  37. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/generate/__init__.py +0 -0
  38. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/generate/_const.py +0 -0
  39. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/generate/_enum.py +0 -0
  40. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/generate/_schema.py +0 -0
  41. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/generate/themes.json +0 -0
  42. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/generate_image/suggest_tags.py +0 -0
  43. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/generate_image/tokenizer.py +0 -0
  44. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/generate_stream.py +0 -0
  45. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/generate_voice/__init__.py +0 -0
  46. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/generate_voice/_enum.py +0 -0
  47. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/ai/upscale.py +0 -0
  48. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/schema.py +0 -0
  49. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/user/__init__.py +0 -0
  50. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/user/information.py +0 -0
  51. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/user/login.py +0 -0
  52. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/sdk/user/subscription.py +0 -0
  53. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/server.py +0 -0
  54. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/tokenizer/__init__.py +0 -0
  55. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/tokenizer/clip_simple_tokenizer.py +0 -0
  56. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/tokenizer/nerdstash_v1.model +0 -0
  57. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/tokenizer/nerdstash_v2.model +0 -0
  58. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/tokenizer/novelai.model +0 -0
  59. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/tokenizer/novelai_v2.model +0 -0
  60. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/tool/__init__.py +0 -0
  61. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/tool/image_metadata/__init__.py +0 -0
  62. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/tool/image_metadata/bch_utils.py +0 -0
  63. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/tool/image_metadata/lsb_extractor.py +0 -0
  64. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/tool/image_metadata/lsb_injector.py +0 -0
  65. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/tool/paint_mask/__init__.py +0 -0
  66. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/tool/random_prompt/__init__.py +0 -0
  67. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/tool/random_prompt/generate_scene_composition.py +0 -0
  68. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/tool/random_prompt/generate_scene_tags.py +0 -0
  69. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/tool/random_prompt/generate_tags.py +0 -0
  70. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/utils/__init__.py +0 -0
  71. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/utils/encode.py +0 -0
  72. {novelai_python-0.7.8 → novelai_python-0.7.10}/src/novelai_python/utils/useful.py +0 -0
  73. {novelai_python-0.7.8 → novelai_python-0.7.10}/tests/__init__.py +0 -0
  74. {novelai_python-0.7.8 → novelai_python-0.7.10}/tests/test_generate_voice.py +0 -0
  75. {novelai_python-0.7.8 → novelai_python-0.7.10}/tests/test_random_prompt.py +0 -0
  76. {novelai_python-0.7.8 → novelai_python-0.7.10}/tests/test_server.py +0 -0
  77. {novelai_python-0.7.8 → novelai_python-0.7.10}/tests/test_server_run.py +0 -0
  78. {novelai_python-0.7.8 → novelai_python-0.7.10}/tests/test_tokenizer.py +0 -0
  79. {novelai_python-0.7.8 → novelai_python-0.7.10}/tests/test_upscale.py +0 -0
  80. {novelai_python-0.7.8 → novelai_python-0.7.10}/tests/test_user_information.py +0 -0
  81. {novelai_python-0.7.8 → novelai_python-0.7.10}/tests/test_user_login.py +0 -0
  82. {novelai_python-0.7.8 → novelai_python-0.7.10}/tests/test_user_subscription.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: novelai-python
3
- Version: 0.7.8
3
+ Version: 0.7.10
4
4
  Summary: NovelAI Python Binding With Pydantic
5
5
  Author-Email: sudoskys <coldlando@hotmail.com>
6
6
  License: Apache License 2.0
@@ -48,10 +48,11 @@ Description-Content-Type: text/markdown
48
48
  The goal of this repository is to use Pydantic to build legitimate requests to access
49
49
  the [NovelAI API service](https://api.novelai.net/docs).
50
50
 
51
- > Python >= 3.9 is required.
51
+ > Python >= 3.9 <3.13 is required.
52
52
 
53
53
  ### 📰 News
54
54
 
55
+ - [New Model. No Restrictions. V4.5 Full Is Here.](https://blog.novelai.net/novelai-diffusion-v4-5-full-release-678318c86205)
55
56
  - [NovelAI Diffusion V4.5 Curated is Here!](https://blog.novelai.net/novelai-diffusion-v4-5-curated-is-here-9e5ba1f628f3)
56
57
  - [Image Generation Model Release — NovelAI Anime Diffusion V4 Curated Preview (EN)](https://blog.novelai.net/release-novelai-anime-diffusion-v4-curated-preview-en-ca4b0b11e671)
57
58
  - [Tutorial: Creating Consistent Characters with NovelAI Diffusion Anime [Female]](https://blog.novelai.net/tutorial-en-creating-consistent-characters-with-novelai-diffusion-anime-female-538b4b678a4e)
@@ -88,7 +89,7 @@ prompt = "2girls, fisheye, closeup, from above"
88
89
  async def main():
89
90
  gen = GenerateImageInfer.build_generate(
90
91
  prompt=prompt,
91
- model=Model.NAI_DIFFUSION_4_5_CURATED,
92
+ model=Model.NAI_DIFFUSION_4_5_FULL,
92
93
  character_prompts=[
93
94
  Character(
94
95
  prompt="1girl, head tilt, short hair, black hair, grey eyes, small breasts, looking at viewer",
@@ -107,6 +108,7 @@ async def main():
107
108
  qualityToggle=True,
108
109
  decrisp_mode=False,
109
110
  variety_boost=True,
111
+ furry_mode=False,
110
112
  # Checkbox in novelai.net
111
113
  )
112
114
  cost = gen.calculate_cost(is_opus=True)
@@ -10,10 +10,11 @@
10
10
  The goal of this repository is to use Pydantic to build legitimate requests to access
11
11
  the [NovelAI API service](https://api.novelai.net/docs).
12
12
 
13
- > Python >= 3.9 is required.
13
+ > Python >= 3.9 <3.13 is required.
14
14
 
15
15
  ### 📰 News
16
16
 
17
+ - [New Model. No Restrictions. V4.5 Full Is Here.](https://blog.novelai.net/novelai-diffusion-v4-5-full-release-678318c86205)
17
18
  - [NovelAI Diffusion V4.5 Curated is Here!](https://blog.novelai.net/novelai-diffusion-v4-5-curated-is-here-9e5ba1f628f3)
18
19
  - [Image Generation Model Release — NovelAI Anime Diffusion V4 Curated Preview (EN)](https://blog.novelai.net/release-novelai-anime-diffusion-v4-curated-preview-en-ca4b0b11e671)
19
20
  - [Tutorial: Creating Consistent Characters with NovelAI Diffusion Anime [Female]](https://blog.novelai.net/tutorial-en-creating-consistent-characters-with-novelai-diffusion-anime-female-538b4b678a4e)
@@ -50,7 +51,7 @@ prompt = "2girls, fisheye, closeup, from above"
50
51
  async def main():
51
52
  gen = GenerateImageInfer.build_generate(
52
53
  prompt=prompt,
53
- model=Model.NAI_DIFFUSION_4_5_CURATED,
54
+ model=Model.NAI_DIFFUSION_4_5_FULL,
54
55
  character_prompts=[
55
56
  Character(
56
57
  prompt="1girl, head tilt, short hair, black hair, grey eyes, small breasts, looking at viewer",
@@ -69,6 +70,7 @@ async def main():
69
70
  qualityToggle=True,
70
71
  decrisp_mode=False,
71
72
  variety_boost=True,
73
+ furry_mode=False,
72
74
  # Checkbox in novelai.net
73
75
  )
74
76
  cost = gen.calculate_cost(is_opus=True)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "novelai-python"
3
- version = "0.7.8"
3
+ version = "0.7.10"
4
4
  description = "NovelAI Python Binding With Pydantic"
5
5
  authors = [
6
6
  { name = "sudoskys", email = "coldlando@hotmail.com" },
@@ -94,6 +94,9 @@ class Model(Enum):
94
94
  """
95
95
  Nai Diffusion series
96
96
  """
97
+ NAI_DIFFUSION_4_5_FULL = "nai-diffusion-4-5-full"
98
+ NAI_DIFFUSION_4_5_FULL_INPAINTING = 'nai-diffusion-4-5-full-inpainting'
99
+
97
100
  NAI_DIFFUSION_4_5_CURATED = 'nai-diffusion-4-5-curated'
98
101
  NAI_DIFFUSION_4_5_CURATED_INPAINTING = 'nai-diffusion-4-5-curated-inpainting'
99
102
 
@@ -141,7 +144,8 @@ INPAINTING_MODEL_LIST = [
141
144
  Model.NAI_DIFFUSION_FURRY_3_INPAINTING,
142
145
  Model.NAI_DIFFUSION_4_CURATED_INPAINTING,
143
146
  Model.NAI_DIFFUSION_4_FULL_INPAINTING,
144
- Model.NAI_DIFFUSION_4_5_CURATED_INPAINTING
147
+ Model.NAI_DIFFUSION_4_5_CURATED_INPAINTING,
148
+ Model.NAI_DIFFUSION_4_5_FULL_INPAINTING,
145
149
  ]
146
150
 
147
151
  PROMOTION = {
@@ -158,17 +162,27 @@ PROMOTION = {
158
162
  "Stable Diffusion XL B0BDF6C1": Model.NAI_DIFFUSION_3,
159
163
  "Stable Diffusion XL C1E1DE52": Model.NAI_DIFFUSION_3,
160
164
  "Stable Diffusion XL 7BCCAA2C": Model.NAI_DIFFUSION_3,
165
+ "Stable Diffusion XL 1120E6A9": Model.NAI_DIFFUSION_3,
161
166
  "Stable Diffusion XL 8BA2AF87": Model.NAI_DIFFUSION_3,
162
167
  "Stable Diffusion XL 4BE8C60C": Model.NAI_DIFFUSION_FURRY_3,
163
168
  "Stable Diffusion XL C8704949": Model.NAI_DIFFUSION_FURRY_3,
164
169
  "Stable Diffusion XL 37C2B166": Model.NAI_DIFFUSION_FURRY_3,
170
+ "Stable Diffusion XL F306816B": Model.NAI_DIFFUSION_FURRY_3,
165
171
  "Stable Diffusion XL 9CC2F394": Model.NAI_DIFFUSION_FURRY_3,
166
- 'NovelAI Diffusion V4 4F49EC75': Model.NAI_DIFFUSION_4_FULL,
167
- 'NovelAI Diffusion V4 CA4B7203': Model.NAI_DIFFUSION_4_FULL,
172
+ 'NovelAI Diffusion V4.5 B9F340FD': Model.NAI_DIFFUSION_4_5_FULL,
173
+ 'NovelAI Diffusion V4.5 F3D95188': Model.NAI_DIFFUSION_4_5_FULL,
168
174
  'NovelAI Diffusion V4.5 5AB81C7C': Model.NAI_DIFFUSION_4_5_CURATED,
169
175
  "NovelAI Diffusion V4.5 B5A2A797": Model.NAI_DIFFUSION_4_5_CURATED,
170
176
  "NovelAI Diffusion V4 5AB81C7C": Model.NAI_DIFFUSION_4_5_CURATED,
171
177
  "NovelAI Diffusion V4 B5A2A797": Model.NAI_DIFFUSION_4_5_CURATED,
178
+ "NovelAI Diffusion V4 37442FCA": Model.NAI_DIFFUSION_4_FULL,
179
+ "NovelAI Diffusion V4 4F49EC75": Model.NAI_DIFFUSION_4_FULL,
180
+ "NovelAI Diffusion V4 CA4B7203": Model.NAI_DIFFUSION_4_FULL,
181
+ "NovelAI Diffusion V4 79F47848": Model.NAI_DIFFUSION_4_FULL,
182
+ "NovelAI Diffusion V4 F6302A9D": Model.NAI_DIFFUSION_4_FULL,
183
+ "NovelAI Diffusion V4 7ABFFA2A": Model.NAI_DIFFUSION_4_CURATED_PREVIEW,
184
+ "NovelAI Diffusion V4 C1CCBA86": Model.NAI_DIFFUSION_4_CURATED_PREVIEW,
185
+ "NovelAI Diffusion V4 770A9E12": Model.NAI_DIFFUSION_4_CURATED_PREVIEW,
172
186
  }
173
187
 
174
188
  ModelTypeAlias = Optional[Union[Model, str]]
@@ -198,6 +212,9 @@ class SupportCondition:
198
212
  numericEmphasis: bool
199
213
  encodedVibes: bool
200
214
  cfgDelaySigma: int
215
+ enhancePromptAdd: bool # For enhance mode, see https://github.com/llmkira/novelai-python/blob/main/playground/enhance.py
216
+ hasFurryMode: bool
217
+ img2imgInpainting: bool
201
218
 
202
219
 
203
220
  def get_supported_params(model: Model):
@@ -237,7 +254,10 @@ def get_supported_params(model: Model):
237
254
  scaleRecommendedMax=25,
238
255
  numericEmphasis=False,
239
256
  encodedVibes=False,
240
- cfgDelaySigma=19
257
+ cfgDelaySigma=19,
258
+ enhancePromptAdd=False,
259
+ hasFurryMode=False,
260
+ img2imgInpainting=False
241
261
  )
242
262
  if model in [Model.NAI_DIFFUSION_2]:
243
263
  return SupportCondition(
@@ -260,7 +280,10 @@ def get_supported_params(model: Model):
260
280
  scaleRecommendedMax=25,
261
281
  numericEmphasis=False,
262
282
  encodedVibes=False,
263
- cfgDelaySigma=19
283
+ cfgDelaySigma=19,
284
+ enhancePromptAdd=False,
285
+ hasFurryMode=False,
286
+ img2imgInpainting=False
264
287
  )
265
288
  if model in [
266
289
  Model.NAI_DIFFUSION_XL,
@@ -289,7 +312,10 @@ def get_supported_params(model: Model):
289
312
  scaleRecommendedMax=8,
290
313
  numericEmphasis=False,
291
314
  encodedVibes=False,
292
- cfgDelaySigma=19
315
+ cfgDelaySigma=19,
316
+ enhancePromptAdd=False,
317
+ hasFurryMode=False,
318
+ img2imgInpainting=False
293
319
  )
294
320
  if model in [
295
321
  Model.NAI_DIFFUSION_4_CURATED_PREVIEW,
@@ -299,8 +325,8 @@ def get_supported_params(model: Model):
299
325
  ]:
300
326
  return SupportCondition(
301
327
  controlnet=False,
302
- vibetransfer=False,
303
- scaleMax=20,
328
+ vibetransfer=True,
329
+ scaleMax=10,
304
330
  negativePromptGuidance=True,
305
331
  noiseSchedule=True,
306
332
  inpainting=True,
@@ -317,7 +343,10 @@ def get_supported_params(model: Model):
317
343
  scaleRecommendedMax=6,
318
344
  numericEmphasis=True,
319
345
  encodedVibes=True,
320
- cfgDelaySigma=19
346
+ cfgDelaySigma=19,
347
+ enhancePromptAdd=False,
348
+ hasFurryMode=True,
349
+ img2imgInpainting=False
321
350
  )
322
351
  if model in [Model.CUSTOM]:
323
352
  return SupportCondition(
@@ -340,11 +369,16 @@ def get_supported_params(model: Model):
340
369
  scaleRecommendedMax=None,
341
370
  numericEmphasis=True,
342
371
  encodedVibes=True,
343
- cfgDelaySigma=58
372
+ cfgDelaySigma=58,
373
+ enhancePromptAdd=False,
374
+ hasFurryMode=True,
375
+ img2imgInpainting=False
344
376
  )
345
377
  if model in [
346
378
  Model.NAI_DIFFUSION_4_5_CURATED,
347
379
  Model.NAI_DIFFUSION_4_5_CURATED_INPAINTING,
380
+ Model.NAI_DIFFUSION_4_5_FULL,
381
+ Model.NAI_DIFFUSION_4_5_FULL_INPAINTING,
348
382
  ]:
349
383
  return SupportCondition(
350
384
  controlnet=False,
@@ -366,7 +400,10 @@ def get_supported_params(model: Model):
366
400
  scaleRecommendedMax=None,
367
401
  numericEmphasis=True,
368
402
  encodedVibes=False,
369
- cfgDelaySigma=58
403
+ cfgDelaySigma=58,
404
+ enhancePromptAdd=True,
405
+ hasFurryMode=True,
406
+ img2imgInpainting=False
370
407
  )
371
408
  return SupportCondition(
372
409
  controlnet=False,
@@ -388,7 +425,10 @@ def get_supported_params(model: Model):
388
425
  scaleRecommendedMax=99,
389
426
  numericEmphasis=False,
390
427
  encodedVibes=False,
391
- cfgDelaySigma=19
428
+ cfgDelaySigma=19,
429
+ enhancePromptAdd=False,
430
+ hasFurryMode=False,
431
+ img2imgInpainting=False
392
432
  )
393
433
 
394
434
 
@@ -400,7 +440,7 @@ class Modifier(object):
400
440
 
401
441
  def find_model_by_hashcode(hashcode: str) -> ModelTypeAlias:
402
442
  if "NovelAI Diffusion V4.5" in hashcode:
403
- return PROMOTION.get(hashcode, Model.NAI_DIFFUSION_4_5_CURATED)
443
+ return PROMOTION.get(hashcode, Model.NAI_DIFFUSION_4_5_FULL)
404
444
  if "NovelAI Diffusion V4" in hashcode:
405
445
  return PROMOTION.get(hashcode, Model.NAI_DIFFUSION_4_CURATED_PREVIEW)
406
446
  return PROMOTION.get(hashcode, None)
@@ -414,12 +454,20 @@ def get_modifiers(model: Model) -> Modifier:
414
454
  """
415
455
  if model in [
416
456
  Model.CUSTOM,
457
+ Model.NAI_DIFFUSION_4_5_FULL,
458
+ Model.NAI_DIFFUSION_4_5_FULL_INPAINTING
459
+ ]:
460
+ return Modifier(
461
+ qualityTags="",
462
+ suffix=", location, very aesthetic, masterpiece, no text"
463
+ )
464
+ if model in [
417
465
  Model.NAI_DIFFUSION_4_5_CURATED,
418
466
  Model.NAI_DIFFUSION_4_5_CURATED_INPAINTING
419
467
  ]:
420
468
  return Modifier(
421
469
  qualityTags="",
422
- suffix=", location, masterpiece, no text, -0.8::feet::, rating:general"
470
+ suffix=", very aesthetic, location, masterpiece, no text, -0.8::feet::, rating:general"
423
471
  )
424
472
  if model in [
425
473
  Model.NAI_DIFFUSION_4_FULL,
@@ -487,6 +535,8 @@ def filter_by_model_noise_schedule(model: Model, noise_schedule: List[NoiseSched
487
535
  if model in [
488
536
  Model.NAI_DIFFUSION_4_5_CURATED,
489
537
  Model.NAI_DIFFUSION_4_5_CURATED_INPAINTING,
538
+ Model.NAI_DIFFUSION_4_5_FULL,
539
+ Model.NAI_DIFFUSION_4_5_FULL_INPAINTING,
490
540
  Model.NAI_DIFFUSION_4_CURATED_PREVIEW,
491
541
  Model.NAI_DIFFUSION_4_FULL,
492
542
  Model.NAI_DIFFUSION_4_FULL_INPAINTING,
@@ -547,34 +597,42 @@ def get_default_noise_schedule(sample_type: Sampler) -> NoiseSchedule:
547
597
 
548
598
 
549
599
  def get_model_group(model: ModelTypeAlias) -> ModelGroups:
550
- # 一般情况禁止转换
551
- if isinstance(model, Enum):
552
- model = model.value
553
- else:
554
- model = str(model)
600
+ """
601
+ Get model group
602
+ If the model is not in the mapping, return STABLE_DIFFUSION
603
+ :param model: Model enum or model name string
604
+ :return: Model group
605
+ """
606
+ if isinstance(model, str):
607
+ try:
608
+ model = Model(model)
609
+ except ValueError:
610
+ return ModelGroups.STABLE_DIFFUSION
555
611
  mapping = {
556
- "stable-diffusion": ModelGroups.STABLE_DIFFUSION,
557
- "nai-diffusion": ModelGroups.STABLE_DIFFUSION,
558
- "safe-diffusion": ModelGroups.STABLE_DIFFUSION,
559
- "waifu-diffusion": ModelGroups.STABLE_DIFFUSION,
560
- "nai-diffusion-furry": ModelGroups.STABLE_DIFFUSION,
561
- "curated-diffusion-test": ModelGroups.STABLE_DIFFUSION,
562
- "nai-diffusion-inpainting": ModelGroups.STABLE_DIFFUSION,
563
- "safe-diffusion-inpainting": ModelGroups.STABLE_DIFFUSION,
564
- "furry-diffusion-inpainting": ModelGroups.STABLE_DIFFUSION,
565
- "nai-diffusion-2": ModelGroups.STABLE_DIFFUSION_GROUP_2,
566
- "nai-diffusion-xl": ModelGroups.STABLE_DIFFUSION_XL,
567
- "nai-diffusion-3": ModelGroups.STABLE_DIFFUSION_XL,
568
- "nai-diffusion-3-inpainting": ModelGroups.STABLE_DIFFUSION_XL,
569
- "custom": ModelGroups.V4,
570
- "nai-diffusion-furry-3": ModelGroups.STABLE_DIFFUSION_XL_FURRY,
571
- "nai-diffusion-furry-3-inpainting": ModelGroups.STABLE_DIFFUSION_XL_FURRY,
572
- "nai-diffusion-4-curated-preview": ModelGroups.V4,
573
- 'nai-diffusion-4-full': ModelGroups.V4,
574
- 'nai-diffusion-4-full-inpainting': ModelGroups.V4,
575
- 'nai-diffusion-4-curated-inpainting': ModelGroups.V4,
576
- 'nai-diffusion-4-5-curated': ModelGroups.V4,
577
- 'nai-diffusion-4-5-curated-inpainting': ModelGroups.V4,
612
+ Model.STABLE_DIFFUSION: ModelGroups.STABLE_DIFFUSION,
613
+ Model.NAI_DIFFUSION: ModelGroups.STABLE_DIFFUSION,
614
+ Model.SAFE_DIFFUSION: ModelGroups.STABLE_DIFFUSION,
615
+ Model.WAIFU_DIFFUSION: ModelGroups.STABLE_DIFFUSION,
616
+ Model.NAI_DIFFUSION_FURRY: ModelGroups.STABLE_DIFFUSION,
617
+ Model.CURATED_DIFFUSION_TEST: ModelGroups.STABLE_DIFFUSION,
618
+ Model.NAI_DIFFUSION_INPAINTING: ModelGroups.STABLE_DIFFUSION,
619
+ Model.SAFE_DIFFUSION_INPAINTING: ModelGroups.STABLE_DIFFUSION,
620
+ Model.FURRY_DIFFUSION_INPAINTING: ModelGroups.STABLE_DIFFUSION,
621
+ Model.NAI_DIFFUSION_2: ModelGroups.STABLE_DIFFUSION_GROUP_2,
622
+ Model.NAI_DIFFUSION_XL: ModelGroups.STABLE_DIFFUSION_XL,
623
+ Model.NAI_DIFFUSION_3: ModelGroups.STABLE_DIFFUSION_XL,
624
+ Model.NAI_DIFFUSION_3_INPAINTING: ModelGroups.STABLE_DIFFUSION_XL,
625
+ Model.CUSTOM: ModelGroups.V4,
626
+ Model.NAI_DIFFUSION_FURRY_3: ModelGroups.STABLE_DIFFUSION_XL_FURRY,
627
+ Model.NAI_DIFFUSION_FURRY_3_INPAINTING: ModelGroups.STABLE_DIFFUSION_XL_FURRY,
628
+ Model.NAI_DIFFUSION_4_CURATED_PREVIEW: ModelGroups.V4,
629
+ Model.NAI_DIFFUSION_4_FULL: ModelGroups.V4,
630
+ Model.NAI_DIFFUSION_4_FULL_INPAINTING: ModelGroups.V4,
631
+ Model.NAI_DIFFUSION_4_CURATED_INPAINTING: ModelGroups.V4,
632
+ Model.NAI_DIFFUSION_4_5_CURATED: ModelGroups.V4,
633
+ Model.NAI_DIFFUSION_4_5_CURATED_INPAINTING: ModelGroups.V4,
634
+ Model.NAI_DIFFUSION_4_5_FULL: ModelGroups.V4,
635
+ Model.NAI_DIFFUSION_4_5_FULL_INPAINTING: ModelGroups.V4,
578
636
  }
579
637
  return mapping.get(model, ModelGroups.STABLE_DIFFUSION)
580
638
 
@@ -768,6 +826,37 @@ def get_uc_preset(model: ModelTypeAlias) -> List[UcPrompt]:
768
826
  text=""
769
827
  ),
770
828
  ]
829
+ elif model in [
830
+ Model.NAI_DIFFUSION_4_5_FULL,
831
+ Model.NAI_DIFFUSION_4_5_FULL_INPAINTING,
832
+ ]:
833
+ prompts = [
834
+ UcPrompt(
835
+ category="heavy",
836
+ name="heavy",
837
+ text="lowres, artistic error, film grain, scan artifacts, worst quality, bad quality, jpeg artifacts, very displeasing, chromatic aberration, dithering, halftone, screentone, multiple views, logo, too many watermarks, negative space, blank page"
838
+ ),
839
+ UcPrompt(
840
+ category="light",
841
+ name="light",
842
+ text="lowres, artistic error, scan artifacts, worst quality, bad quality, jpeg artifacts, multiple views, very displeasing, too many watermarks, negative space, blank page"
843
+ ),
844
+ UcPrompt(
845
+ category="furry",
846
+ name="furryFocus",
847
+ text="{worst quality}, distracting watermark, unfinished, bad quality, {widescreen}, upscale, {sequence}, {{grandfathered content}}, blurred foreground, chromatic aberration, sketch, everyone, [sketch background], simple, [flat colors], ych (character), outline, multiple scenes, [[horror (theme)]], comic"
848
+ ),
849
+ UcPrompt(
850
+ category="human",
851
+ name="humanFocus",
852
+ text="lowres, artistic error, film grain, scan artifacts, worst quality, bad quality, jpeg artifacts, very displeasing, chromatic aberration, dithering, halftone, screentone, multiple views, logo, too many watermarks, negative space, blank page, @_@, mismatched pupils, glowing eyes, bad anatomy"
853
+ ),
854
+ UcPrompt(
855
+ category="none",
856
+ name="none",
857
+ text=""
858
+ ),
859
+ ]
771
860
  return prompts
772
861
 
773
862
 
@@ -3,7 +3,7 @@ from enum import Enum
3
3
 
4
4
  class ReqType(Enum):
5
5
  """
6
- typing.Literal["bg-removal", "colorize", "lineart", "sketch", "emotion", "declutter"]
6
+ typing.Literal["bg-removal", "colorize", "lineart", "sketch", "emotion", "declutter", "declutter-keep-bubbles"]
7
7
  """
8
8
  BG_REMOVAL = "bg-removal"
9
9
  COLORIZE = "colorize"
@@ -11,6 +11,7 @@ class ReqType(Enum):
11
11
  SKETCH = "sketch"
12
12
  EMOTION = "emotion"
13
13
  DECLUTTER = "declutter"
14
+ DECLUTTER_KEEP_BUBBLES = "declutter-keep-bubbles"
14
15
 
15
16
 
16
17
  class Moods(Enum):