novelai-python 0.9.0__tar.gz → 0.9.1__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 (132) hide show
  1. {novelai_python-0.9.0 → novelai_python-0.9.1}/PKG-INFO +1 -1
  2. {novelai_python-0.9.0 → novelai_python-0.9.1}/pyproject.toml +1 -1
  3. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/_cost.py +0 -5
  4. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/generate_image/params.py +3 -2
  5. novelai_python-0.9.1/tests/test_seed.py +16 -0
  6. {novelai_python-0.9.0 → novelai_python-0.9.1}/LICENSE +0 -0
  7. {novelai_python-0.9.0 → novelai_python-0.9.1}/NOTICE.MD +0 -0
  8. {novelai_python-0.9.0 → novelai_python-0.9.1}/README.md +0 -0
  9. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/__init__.py +0 -0
  10. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/_enum.py +0 -0
  11. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/_exceptions.py +0 -0
  12. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/_response/__init__.py +0 -0
  13. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/_response/ai/__init__.py +0 -0
  14. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/_response/ai/generate.py +0 -0
  15. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/_response/ai/generate_image.py +0 -0
  16. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/_response/ai/generate_stream.py +0 -0
  17. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/_response/ai/generate_voice.py +0 -0
  18. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/_response/ai/upscale.py +0 -0
  19. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/_response/schema.py +0 -0
  20. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/_response/user/__init__.py +0 -0
  21. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/_response/user/data.py +0 -0
  22. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/_response/user/information.py +0 -0
  23. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/_response/user/login.py +0 -0
  24. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/_response/user/priority.py +0 -0
  25. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/_response/user/subscription.py +0 -0
  26. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/_response/user/trial_status.py +0 -0
  27. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/_retry.py +0 -0
  28. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/credential/ApiToken.py +0 -0
  29. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/credential/JwtToken.py +0 -0
  30. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/credential/UserAuth.py +0 -0
  31. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/credential/__init__.py +0 -0
  32. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/credential/_base.py +0 -0
  33. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/metrics.py +0 -0
  34. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/__init__.py +0 -0
  35. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/LICENSE +0 -0
  36. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/__init__.py +0 -0
  37. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/_const.py +0 -0
  38. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/_enum.py +0 -0
  39. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/augment_image/__init__.py +0 -0
  40. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/augment_image/_enum.py +0 -0
  41. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/encode_vibe.py +0 -0
  42. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/generate/__init__.py +0 -0
  43. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/generate/_const.py +0 -0
  44. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/generate/_enum.py +0 -0
  45. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/generate/_schema.py +0 -0
  46. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/generate/themes.json +0 -0
  47. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/generate_image/__init__.py +0 -0
  48. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/generate_image/auto_text.py +0 -0
  49. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/generate_image/schema.py +0 -0
  50. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/generate_image/suggest_tags.py +0 -0
  51. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/generate_image/tokenizer.py +0 -0
  52. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/generate_stream.py +0 -0
  53. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/generate_voice/__init__.py +0 -0
  54. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/generate_voice/_enum.py +0 -0
  55. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/openai_compat.py +0 -0
  56. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/ai/upscale.py +0 -0
  57. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/schema.py +0 -0
  58. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/user/__init__.py +0 -0
  59. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/user/data.py +0 -0
  60. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/user/information.py +0 -0
  61. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/user/login.py +0 -0
  62. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/user/persistent_token.py +0 -0
  63. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/user/priority.py +0 -0
  64. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/user/subscription.py +0 -0
  65. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/sdk/user/trial_status.py +0 -0
  66. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/server.py +0 -0
  67. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tokenizer/__init__.py +0 -0
  68. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tokenizer/_definition.py +0 -0
  69. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tokenizer/clip_tokenizer.py +0 -0
  70. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/__init__.py +0 -0
  71. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/image_metadata/__init__.py +0 -0
  72. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/image_metadata/bch.py +0 -0
  73. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/image_metadata/bch_utils.py +0 -0
  74. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/image_metadata/lsb_extractor.py +0 -0
  75. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/image_metadata/lsb_injector.py +0 -0
  76. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/paint_mask/__init__.py +0 -0
  77. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/random_prompt/__init__.py +0 -0
  78. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/random_prompt/data/__init__.py +0 -0
  79. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/random_prompt/data/anime_v3_data.py +0 -0
  80. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/random_prompt/data/anime_v4_data.py +0 -0
  81. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/random_prompt/data/furry_data.py +0 -0
  82. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/random_prompt/data/holiday.py +0 -0
  83. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/random_prompt/data/nsfw_data.py +0 -0
  84. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/random_prompt/generate_scene_composition.py +0 -0
  85. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/random_prompt/generate_scene_tags.py +0 -0
  86. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/random_prompt/generate_tags.py +0 -0
  87. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/random_prompt/generators/__init__.py +0 -0
  88. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/random_prompt/generators/anime_v3.py +0 -0
  89. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/random_prompt/generators/anime_v4.py +0 -0
  90. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/random_prompt/generators/furry.py +0 -0
  91. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/random_prompt/generators/holiday.py +0 -0
  92. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/tool/random_prompt/logic.py +0 -0
  93. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/utils/__init__.py +0 -0
  94. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/utils/daily_limit.py +0 -0
  95. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/utils/encode.py +0 -0
  96. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/utils/pacing.py +0 -0
  97. {novelai_python-0.9.0 → novelai_python-0.9.1}/src/novelai_python/utils/useful.py +0 -0
  98. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/__init__.py +0 -0
  99. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/conftest.py +0 -0
  100. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/fixtures/bch_vectors.json +0 -0
  101. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/fixtures/dependency_golden.json +0 -0
  102. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/fixtures/mask_ori.png +0 -0
  103. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/fixtures/mask_sketch.png +0 -0
  104. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/fixtures/tokenizer_golden.json +0 -0
  105. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/fixtures/v5_signed.webp +0 -0
  106. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_auto_text.py +0 -0
  107. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_bch.py +0 -0
  108. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_browser_identity.py +0 -0
  109. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_cost.py +0 -0
  110. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_daily_limit.py +0 -0
  111. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_dependency_golden.py +0 -0
  112. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_from_metadata.py +0 -0
  113. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_generate_image_v5.py +0 -0
  114. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_generate_text.py +0 -0
  115. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_generate_voice.py +0 -0
  116. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_image_metadata_v5.py +0 -0
  117. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_login_proxy.py +0 -0
  118. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_metrics.py +0 -0
  119. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_new_endpoints.py +0 -0
  120. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_pacing.py +0 -0
  121. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_presets_and_usage.py +0 -0
  122. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_random_prompt.py +0 -0
  123. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_retry_session.py +0 -0
  124. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_server.py +0 -0
  125. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_server_roundtrip.py +0 -0
  126. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_server_run.py +0 -0
  127. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_suggest_tags.py +0 -0
  128. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_tokenizer.py +0 -0
  129. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_upscale.py +0 -0
  130. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_user_information.py +0 -0
  131. {novelai_python-0.9.0 → novelai_python-0.9.1}/tests/test_user_login.py +0 -0
  132. {novelai_python-0.9.0 → novelai_python-0.9.1}/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.9.0
3
+ Version: 0.9.1
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.9.0"
3
+ version = "0.9.1"
4
4
  description = "NovelAI Python Binding With Pydantic"
5
5
  authors = [
6
6
  { name = "sudoskys", email = "coldlando@hotmail.com" },
@@ -4,7 +4,6 @@ Anlas cost of image requests, as the novelai.net web client computes it
4
4
  """
5
5
 
6
6
  import math
7
- import random
8
7
 
9
8
  from pydantic import BaseModel
10
9
 
@@ -61,10 +60,6 @@ class Args(BaseModel):
61
60
  inpaint_strength: float | None = None
62
61
 
63
62
 
64
- def generate_random_seed() -> int:
65
- return random.randint(0, 2**32 - 1)
66
-
67
-
68
63
  def _resize_within(width: int, height: int, max_pixels: int) -> tuple[int, int]:
69
64
  if width * height <= max_pixels:
70
65
  return width, height
@@ -87,11 +87,12 @@ class Params(BaseModel):
87
87
  inpaintImg2ImgStrength: float | None = Field(default=None, ge=0, le=1, multiple_of=0.01)
88
88
  """For SameFeel"""
89
89
  seed: int = Field(
90
- default_factory=lambda: random.randint(0, 4294967295 - 7),
90
+ default_factory=lambda: random.randint(1, 4294967295 - 7),
91
91
  gt=0,
92
92
  le=4294967295 - 7,
93
93
  )
94
- """Seed"""
94
+ """Seed. Image i of a batch is drawn with seed + i. The API reads it as uint64, so -1 is a 400;
95
+ 0 is accepted but draws a random image and the metadata still says 0, so it is refused here."""
95
96
  characterPrompts: list[Character] = Field(default_factory=list)
96
97
  """Character Prompts"""
97
98
  straight_alpha: bool | None = None
@@ -0,0 +1,16 @@
1
+ import random
2
+
3
+ from novelai_python.sdk.ai.generate_image.params import Params
4
+
5
+
6
+ def test_default_seed_lower_bound_passes_validation(monkeypatch):
7
+ monkeypatch.setattr(random, "randint", lambda low, high: low)
8
+ params = Params()
9
+ assert params.seed == 1
10
+ assert Params.model_validate(params.model_dump()).seed == 1
11
+
12
+
13
+ def test_default_seed_upper_bound_passes_validation(monkeypatch):
14
+ monkeypatch.setattr(random, "randint", lambda low, high: high)
15
+ params = Params()
16
+ assert Params.model_validate(params.model_dump()).seed == params.seed
File without changes
File without changes
File without changes