novelai-python 0.4.8__tar.gz → 0.4.9__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 (77) hide show
  1. {novelai_python-0.4.8 → novelai_python-0.4.9}/PKG-INFO +1 -1
  2. {novelai_python-0.4.8 → novelai_python-0.4.9}/pyproject.toml +1 -1
  3. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/_response/ai/generate_image.py +5 -4
  4. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/ai/generate/_enum.py +1 -1
  5. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/ai/generate_image/__init__.py +3 -3
  6. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/ai/generate_image/_enum.py +13 -5
  7. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/server.py +5 -1
  8. {novelai_python-0.4.8 → novelai_python-0.4.9}/LICENSE +0 -0
  9. {novelai_python-0.4.8 → novelai_python-0.4.9}/NOTICE.MD +0 -0
  10. {novelai_python-0.4.8 → novelai_python-0.4.9}/README.md +0 -0
  11. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/__init__.py +0 -0
  12. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/_exceptions.py +0 -0
  13. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/_response/__init__.py +0 -0
  14. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/_response/ai/__init__.py +0 -0
  15. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/_response/ai/generate.py +0 -0
  16. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/_response/ai/generate_stream.py +0 -0
  17. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/_response/ai/generate_voice.py +0 -0
  18. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/_response/ai/upscale.py +0 -0
  19. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/_response/schema.py +0 -0
  20. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/_response/user/__init__.py +0 -0
  21. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/_response/user/information.py +0 -0
  22. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/_response/user/login.py +0 -0
  23. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/_response/user/subscription.py +0 -0
  24. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/credential/ApiToken.py +0 -0
  25. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/credential/JwtToken.py +0 -0
  26. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/credential/UserAuth.py +0 -0
  27. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/credential/__init__.py +0 -0
  28. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/credential/_base.py +0 -0
  29. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/__init__.py +0 -0
  30. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/ai/LICENSE +0 -0
  31. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/ai/__init__.py +0 -0
  32. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/ai/generate/__init__.py +0 -0
  33. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/ai/generate/_const.py +0 -0
  34. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/ai/generate/_preset.py +0 -0
  35. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/ai/generate_image/_const.py +0 -0
  36. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/ai/generate_image/suggest_tags.py +0 -0
  37. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/ai/generate_stream.py +0 -0
  38. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/ai/generate_voice/__init__.py +0 -0
  39. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/ai/generate_voice/_enum.py +0 -0
  40. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/ai/upscale.py +0 -0
  41. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/schema.py +0 -0
  42. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/user/__init__.py +0 -0
  43. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/user/information.py +0 -0
  44. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/user/login.py +0 -0
  45. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/sdk/user/subscription.py +0 -0
  46. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tokenizer/NOTICE.MD +0 -0
  47. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tokenizer/__init__.py +0 -0
  48. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tokenizer/bpe_simple_vocab_16e6.txt.gz +0 -0
  49. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tokenizer/gpt2-genji_tokenizer.json +0 -0
  50. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tokenizer/gpt2_tokenizer.json +0 -0
  51. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tokenizer/nerdstash_v1.model +0 -0
  52. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tokenizer/nerdstash_v2.model +0 -0
  53. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tokenizer/novelai.model +0 -0
  54. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tokenizer/novelai_v2.model +0 -0
  55. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tokenizer/pile_tokenizer.json +0 -0
  56. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tokenizer/simple_tokenizer.py +0 -0
  57. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tool/__init__.py +0 -0
  58. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tool/image_metadata/__init__.py +0 -0
  59. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tool/image_metadata/lsb_extractor.py +0 -0
  60. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tool/image_metadata/lsb_injector.py +0 -0
  61. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tool/paint_mask/__init__.py +0 -0
  62. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tool/random_prompt/__init__.py +0 -0
  63. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tool/random_prompt/tag.py +0 -0
  64. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tool/random_prompt/tag_character.py +0 -0
  65. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/tool/random_prompt/tag_nsfw.py +0 -0
  66. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/utils/__init__.py +0 -0
  67. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/utils/encode.py +0 -0
  68. {novelai_python-0.4.8 → novelai_python-0.4.9}/src/novelai_python/utils/useful.py +0 -0
  69. {novelai_python-0.4.8 → novelai_python-0.4.9}/tests/__init__.py +0 -0
  70. {novelai_python-0.4.8 → novelai_python-0.4.9}/tests/test_generate_voice.py +0 -0
  71. {novelai_python-0.4.8 → novelai_python-0.4.9}/tests/test_random_prompt.py +0 -0
  72. {novelai_python-0.4.8 → novelai_python-0.4.9}/tests/test_server.py +0 -0
  73. {novelai_python-0.4.8 → novelai_python-0.4.9}/tests/test_server_run.py +0 -0
  74. {novelai_python-0.4.8 → novelai_python-0.4.9}/tests/test_upscale.py +0 -0
  75. {novelai_python-0.4.8 → novelai_python-0.4.9}/tests/test_user_information.py +0 -0
  76. {novelai_python-0.4.8 → novelai_python-0.4.9}/tests/test_user_login.py +0 -0
  77. {novelai_python-0.4.8 → novelai_python-0.4.9}/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.4.8
3
+ Version: 0.4.9
4
4
  Summary: NovelAI Python Binding With Pydantic
5
5
  Author-Email: sudoskys <coldlando@hotmail.com>
6
6
  License: Apache License 2.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "novelai-python"
3
- version = "0.4.8"
3
+ version = "0.4.9"
4
4
  description = "NovelAI Python Binding With Pydantic"
5
5
  authors = [
6
6
  { name = "sudoskys", email = "coldlando@hotmail.com" },
@@ -10,11 +10,12 @@ from pydantic import BaseModel
10
10
  from ..schema import RespBase
11
11
 
12
12
 
13
- class ImageGenerateResp(RespBase):
14
- class RequestParams(BaseModel):
15
- endpoint: str
16
- raw_request: dict = None
13
+ class RequestParams(BaseModel):
14
+ endpoint: str
15
+ raw_request: dict = None
16
+
17
17
 
18
+ class ImageGenerateResp(RespBase):
18
19
  meta: RequestParams
19
20
  files: List[Tuple[str, bytes]] = None
20
21
 
@@ -1,6 +1,6 @@
1
1
  # Description: Enum class for TextLLMModel
2
2
  from enum import Enum
3
- from typing import List, Dict
3
+ from typing import List
4
4
 
5
5
 
6
6
  class TextLLMModel(Enum):
@@ -28,7 +28,7 @@ from ._const import len_values, tempmin_value, sm_value, dyn_value, map_value
28
28
  from ._enum import Model, Sampler, NoiseSchedule, ControlNetModel, Action, UCPreset, INPAINTING_MODEL_LIST
29
29
  from ...schema import ApiBaseModel
30
30
  from ...._exceptions import APIError, AuthError, ConcurrentGenerationError, SessionHttpError
31
- from ...._response.ai.generate_image import ImageGenerateResp
31
+ from ...._response.ai.generate_image import ImageGenerateResp, RequestParams
32
32
  from ....credential import CredentialBase
33
33
  from ....utils import try_jsonfy
34
34
 
@@ -453,7 +453,7 @@ class GenerateImageInfer(ApiBaseModel):
453
453
  )
454
454
  per_sample = max(math.ceil(per_sample * strength), 2)
455
455
 
456
- if uncond_scale != 1.0:
456
+ if int(uncond_scale) != 1:
457
457
  per_sample = math.ceil(per_sample * 1.3)
458
458
 
459
459
  return per_sample * n_samples
@@ -755,7 +755,7 @@ class GenerateImageInfer(ApiBaseModel):
755
755
  data = zip_file.read(filename)
756
756
  unzip_content.append((filename, data))
757
757
  return ImageGenerateResp(
758
- meta=ImageGenerateResp.RequestParams(
758
+ meta=RequestParams(
759
759
  endpoint=self.base_url,
760
760
  raw_request=request_data,
761
761
  ),
@@ -93,6 +93,9 @@ class Model(Enum):
93
93
  NAI_DIFFUSION_3 = "nai-diffusion-3"
94
94
  NAI_DIFFUSION_3_INPAINTING = "nai-diffusion-3-inpainting"
95
95
 
96
+ NAI_DIFFUSION_FURRY_3 = "nai-diffusion-furry-3"
97
+ NAI_DIFFUSION_FURRY_3_INPAINTING = "nai-diffusion-furry-3-inpainting"
98
+
96
99
  NAI_DIFFUSION = "nai-diffusion"
97
100
  NAI_DIFFUSION_2 = "nai-diffusion-2"
98
101
  NAI_DIFFUSION_INPAINTING = "nai-diffusion-inpainting"
@@ -107,11 +110,13 @@ class Model(Enum):
107
110
  CUSTOM = "custom"
108
111
 
109
112
 
110
- INPAINTING_MODEL_LIST = [Model.NAI_DIFFUSION_3_INPAINTING,
111
- Model.NAI_DIFFUSION_INPAINTING,
112
- Model.SAFE_DIFFUSION_INPAINTING,
113
- Model.FURRY_DIFFUSION_INPAINTING
114
- ]
113
+ INPAINTING_MODEL_LIST = [
114
+ Model.NAI_DIFFUSION_3_INPAINTING,
115
+ Model.NAI_DIFFUSION_INPAINTING,
116
+ Model.SAFE_DIFFUSION_INPAINTING,
117
+ Model.FURRY_DIFFUSION_INPAINTING,
118
+ Model.NAI_DIFFUSION_FURRY_3_INPAINTING
119
+ ]
115
120
 
116
121
  PROMOTION = {
117
122
  "Stable Diffusion 1D44365E": Model.SAFE_DIFFUSION,
@@ -127,4 +132,7 @@ PROMOTION = {
127
132
  "Stable Diffusion XL B0BDF6C1": Model.NAI_DIFFUSION_3,
128
133
  "Stable Diffusion XL C1E1DE52": Model.NAI_DIFFUSION_3,
129
134
  "Stable Diffusion XL 8BA2AF87": Model.NAI_DIFFUSION_3,
135
+ "Stable Diffusion XL 4BE8C60C": Model.NAI_DIFFUSION_FURRY_3,
136
+ "Stable Diffusion XL C8704949": Model.NAI_DIFFUSION_FURRY_3,
137
+ "Stable Diffusion XL 9CC2F394": Model.NAI_DIFFUSION_FURRY_3,
130
138
  }
@@ -226,7 +226,11 @@ async def generate_voice(
226
226
  """
227
227
  生成图片
228
228
  :param current_token: Authorization
229
- :param req: GenerateImageInfer
229
+ :param text: str
230
+ :param voice: int
231
+ :param seed: Optional[str]
232
+ :param opus: bool
233
+ :param version: Union[Literal["v2", "v1"], str]
230
234
  :return:
231
235
  """
232
236
  try:
File without changes
File without changes
File without changes