novelai-python 0.6.0__tar.gz → 0.6.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 (80) hide show
  1. {novelai_python-0.6.0 → novelai_python-0.6.1}/PKG-INFO +40 -35
  2. {novelai_python-0.6.0 → novelai_python-0.6.1}/README.md +39 -34
  3. {novelai_python-0.6.0 → novelai_python-0.6.1}/pyproject.toml +1 -1
  4. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/generate_image/__init__.py +13 -9
  5. {novelai_python-0.6.0 → novelai_python-0.6.1}/LICENSE +0 -0
  6. {novelai_python-0.6.0 → novelai_python-0.6.1}/NOTICE.MD +0 -0
  7. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/__init__.py +0 -0
  8. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/_enum.py +0 -0
  9. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/_exceptions.py +0 -0
  10. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/_response/__init__.py +0 -0
  11. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/_response/ai/__init__.py +0 -0
  12. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/_response/ai/generate.py +0 -0
  13. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/_response/ai/generate_image.py +0 -0
  14. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/_response/ai/generate_stream.py +0 -0
  15. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/_response/ai/generate_voice.py +0 -0
  16. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/_response/ai/upscale.py +0 -0
  17. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/_response/schema.py +0 -0
  18. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/_response/user/__init__.py +0 -0
  19. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/_response/user/information.py +0 -0
  20. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/_response/user/login.py +0 -0
  21. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/_response/user/subscription.py +0 -0
  22. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/credential/ApiToken.py +0 -0
  23. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/credential/JwtToken.py +0 -0
  24. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/credential/UserAuth.py +0 -0
  25. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/credential/__init__.py +0 -0
  26. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/credential/_base.py +0 -0
  27. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/__init__.py +0 -0
  28. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/LICENSE +0 -0
  29. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/__init__.py +0 -0
  30. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/_const.py +0 -0
  31. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/_cost.py +0 -0
  32. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/_enum.py +0 -0
  33. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/augment_image/__init__.py +0 -0
  34. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/augment_image/_enum.py +0 -0
  35. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/generate/__init__.py +0 -0
  36. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/generate/_const.py +0 -0
  37. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/generate/_enum.py +0 -0
  38. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/generate/_schema.py +0 -0
  39. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/generate/themes.json +0 -0
  40. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/generate_image/schema.py +0 -0
  41. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/generate_image/suggest_tags.py +0 -0
  42. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/generate_stream.py +0 -0
  43. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/generate_voice/__init__.py +0 -0
  44. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/generate_voice/_enum.py +0 -0
  45. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/ai/upscale.py +0 -0
  46. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/schema.py +0 -0
  47. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/user/__init__.py +0 -0
  48. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/user/information.py +0 -0
  49. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/user/login.py +0 -0
  50. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/sdk/user/subscription.py +0 -0
  51. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/server.py +0 -0
  52. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/tokenizer/__init__.py +0 -0
  53. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/tokenizer/clip_simple_tokenizer.py +0 -0
  54. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/tokenizer/nerdstash_v1.model +0 -0
  55. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/tokenizer/nerdstash_v2.model +0 -0
  56. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/tokenizer/novelai.model +0 -0
  57. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/tokenizer/novelai_v2.model +0 -0
  58. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/tool/__init__.py +0 -0
  59. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/tool/image_metadata/__init__.py +0 -0
  60. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/tool/image_metadata/_type.py +0 -0
  61. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/tool/image_metadata/bch_utils.py +0 -0
  62. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/tool/image_metadata/lsb_extractor.py +0 -0
  63. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/tool/image_metadata/lsb_injector.py +0 -0
  64. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/tool/paint_mask/__init__.py +0 -0
  65. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/tool/random_prompt/__init__.py +0 -0
  66. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/tool/random_prompt/tag.py +0 -0
  67. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/tool/random_prompt/tag_character.py +0 -0
  68. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/tool/random_prompt/tag_nsfw.py +0 -0
  69. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/utils/__init__.py +0 -0
  70. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/utils/encode.py +0 -0
  71. {novelai_python-0.6.0 → novelai_python-0.6.1}/src/novelai_python/utils/useful.py +0 -0
  72. {novelai_python-0.6.0 → novelai_python-0.6.1}/tests/__init__.py +0 -0
  73. {novelai_python-0.6.0 → novelai_python-0.6.1}/tests/test_generate_voice.py +0 -0
  74. {novelai_python-0.6.0 → novelai_python-0.6.1}/tests/test_random_prompt.py +0 -0
  75. {novelai_python-0.6.0 → novelai_python-0.6.1}/tests/test_server.py +0 -0
  76. {novelai_python-0.6.0 → novelai_python-0.6.1}/tests/test_server_run.py +0 -0
  77. {novelai_python-0.6.0 → novelai_python-0.6.1}/tests/test_upscale.py +0 -0
  78. {novelai_python-0.6.0 → novelai_python-0.6.1}/tests/test_user_information.py +0 -0
  79. {novelai_python-0.6.0 → novelai_python-0.6.1}/tests/test_user_login.py +0 -0
  80. {novelai_python-0.6.0 → novelai_python-0.6.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.6.0
3
+ Version: 0.6.1
4
4
  Summary: NovelAI Python Binding With Pydantic
5
5
  Author-Email: sudoskys <coldlando@hotmail.com>
6
6
  License: Apache License 2.0
@@ -41,7 +41,7 @@ Description-Content-Type: text/markdown
41
41
  ---
42
42
 
43
43
  [![PyPI version](https://badge.fury.io/py/novelai-python.svg)](https://badge.fury.io/py/novelai-python)
44
- [![Downloads](https://static.pepy.tech/badge/novelai_python)](https://static.pepy.tech/project/novelai_python)
44
+ [![Downloads](https://pepy.tech/badge/novelai_python)](https://pepy.tech/project/novelai_python)
45
45
 
46
46
  ✨ NovelAI api python sdk with Pydantic, modern and user-friendly.
47
47
 
@@ -49,39 +49,19 @@ The goal of this repository is to use Pydantic to build legitimate requests to a
49
49
 
50
50
  > Python >= 3.9 is required.
51
51
 
52
- ### Roadmap 🚧
52
+ ### 📰 News
53
53
 
54
- - [x] tool.random_prompt
55
- - [x] tool.paint_mask
56
- - [x] tool.image_metadata
57
- - [x] tokenizer
58
- - [x] /ai/generate-image
59
- - [x] /user/subscription
60
- - [x] /user/login
61
- - [x] /user/information
62
- - [x] /ai/upscale
63
- - [x] /ai/generate-image/suggest-tags
64
- - [x] /ai/generate-voice
65
- - [x] /ai/generate-stream
66
- - [x] /ai/generate
67
- - [x] /ai/augment-image
68
- - [ ] /ai/annotate-image
69
- - [ ] /ai/classify
70
- - [ ] /ai/generate-prompt
54
+ - [Image Generation Model Release — NovelAI Anime Diffusion V4 Curated Preview (EN)](https://blog.novelai.net/release-novelai-anime-diffusion-v4-curated-preview-en-ca4b0b11e671)
55
+ - [Tutorial: Creating Consistent Characters with NovelAI Diffusion Anime [Female]](https://blog.novelai.net/tutorial-en-creating-consistent-characters-with-novelai-diffusion-anime-female-538b4b678a4e)
71
56
 
72
- > GenerateImageInfer.calculate_cost is correct in most cases, but please request account information to get accurate
73
- > consumption information.
74
-
75
- > This repo is maintained by me personally now. If you have any questions, please feel free to open an issue.
76
-
77
- ### Usage 🖥️
57
+ ### 📦 Usage
78
58
 
79
59
  ```shell
80
60
  pip -U install novelai-python
81
61
  ```
82
62
 
83
- More examples can be found in the [playground](https://github.com/LlmKira/novelai-python/tree/main/playground)
84
- directory, read code as documentation.
63
+ **More examples can be found in the [playground](https://github.com/LlmKira/novelai-python/tree/main/playground)
64
+ directory, read code as documentation.**
85
65
 
86
66
  ```python
87
67
  import asyncio
@@ -126,7 +106,7 @@ async def main():
126
106
  )
127
107
  cost = gen.calculate_cost(is_opus=True)
128
108
  print(f"charge: {cost} if you are vip3")
129
- resp = gen.request(session=session)
109
+ resp = await gen.request(session=session)
130
110
  resp: ImageGenerateResp
131
111
  print(resp.meta)
132
112
  file = resp.files[0]
@@ -139,7 +119,7 @@ loop.run_until_complete(main())
139
119
 
140
120
  ```
141
121
 
142
- #### LLM
122
+ #### 📦 LLM
143
123
 
144
124
  ```python
145
125
  import asyncio
@@ -190,7 +170,7 @@ loop = asyncio.get_event_loop()
190
170
  loop.run_until_complete(chat("Hello"))
191
171
  ```
192
172
 
193
- #### Random Prompt
173
+ #### 📦 Random Prompt
194
174
 
195
175
  ```python
196
176
  from novelai_python.tool.random_prompt import RandomPromptGenerator
@@ -199,14 +179,14 @@ prompt = RandomPromptGenerator(nsfw_enabled=False).random_prompt()
199
179
  print(prompt)
200
180
  ```
201
181
 
202
- #### Run A Server
182
+ #### 📦 Run A Server
203
183
 
204
184
  ```shell
205
185
  pip install novelai_python
206
186
  python3 -m novelai_python.server -h '127.0.0.1' -p 7888
207
187
  ```
208
188
 
209
- #### Tokenizer
189
+ #### 📦 Tokenizer
210
190
 
211
191
  ```python
212
192
  from novelai_python._enum import get_tokenizer_model, TextLLMModel
@@ -221,7 +201,32 @@ print(tokenizer_package.decode(tokenizer_package.encode(t_text)))
221
201
 
222
202
  ```
223
203
 
224
- ## About Nsfw 🚫
204
+ ### 🔨 Roadmap
205
+
206
+ - [x] tool.random_prompt
207
+ - [x] tool.paint_mask
208
+ - [x] tool.image_metadata
209
+ - [x] tokenizer
210
+ - [x] /ai/generate-image
211
+ - [x] /user/subscription
212
+ - [x] /user/login
213
+ - [x] /user/information
214
+ - [x] /ai/upscale
215
+ - [x] /ai/generate-image/suggest-tags
216
+ - [x] /ai/generate-voice
217
+ - [x] /ai/generate-stream
218
+ - [x] /ai/generate
219
+ - [x] /ai/augment-image
220
+ - [ ] /ai/annotate-image
221
+ - [ ] /ai/classify
222
+ - [ ] /ai/generate-prompt
223
+
224
+ > GenerateImageInfer.calculate_cost is correct in most cases, but please request account information to get accurate
225
+ > consumption information.
226
+
227
+ > This repo is maintained by me personally now. If you have any questions, please feel free to open an issue.
228
+
229
+ ## 🚫 About Nsfw
225
230
 
226
231
  You might need some solutions for identifying NSFW content and adding a mosaic to prevent operational mishaps.
227
232
 
@@ -229,7 +234,7 @@ https://dghs-imgutils.deepghs.org/main/api_doc/detect/nudenet.html
229
234
 
230
235
  https://dghs-imgutils.deepghs.org/main/api_doc/operate/censor.html
231
236
 
232
- ## Acknowledgements 🙏
237
+ ## 🙏 Acknowledgements
233
238
 
234
239
  [BackEnd](https://api.novelai.net/docs)
235
240
 
@@ -3,7 +3,7 @@
3
3
  ---
4
4
 
5
5
  [![PyPI version](https://badge.fury.io/py/novelai-python.svg)](https://badge.fury.io/py/novelai-python)
6
- [![Downloads](https://static.pepy.tech/badge/novelai_python)](https://static.pepy.tech/project/novelai_python)
6
+ [![Downloads](https://pepy.tech/badge/novelai_python)](https://pepy.tech/project/novelai_python)
7
7
 
8
8
  ✨ NovelAI api python sdk with Pydantic, modern and user-friendly.
9
9
 
@@ -11,39 +11,19 @@ The goal of this repository is to use Pydantic to build legitimate requests to a
11
11
 
12
12
  > Python >= 3.9 is required.
13
13
 
14
- ### Roadmap 🚧
14
+ ### 📰 News
15
15
 
16
- - [x] tool.random_prompt
17
- - [x] tool.paint_mask
18
- - [x] tool.image_metadata
19
- - [x] tokenizer
20
- - [x] /ai/generate-image
21
- - [x] /user/subscription
22
- - [x] /user/login
23
- - [x] /user/information
24
- - [x] /ai/upscale
25
- - [x] /ai/generate-image/suggest-tags
26
- - [x] /ai/generate-voice
27
- - [x] /ai/generate-stream
28
- - [x] /ai/generate
29
- - [x] /ai/augment-image
30
- - [ ] /ai/annotate-image
31
- - [ ] /ai/classify
32
- - [ ] /ai/generate-prompt
16
+ - [Image Generation Model Release — NovelAI Anime Diffusion V4 Curated Preview (EN)](https://blog.novelai.net/release-novelai-anime-diffusion-v4-curated-preview-en-ca4b0b11e671)
17
+ - [Tutorial: Creating Consistent Characters with NovelAI Diffusion Anime [Female]](https://blog.novelai.net/tutorial-en-creating-consistent-characters-with-novelai-diffusion-anime-female-538b4b678a4e)
33
18
 
34
- > GenerateImageInfer.calculate_cost is correct in most cases, but please request account information to get accurate
35
- > consumption information.
36
-
37
- > This repo is maintained by me personally now. If you have any questions, please feel free to open an issue.
38
-
39
- ### Usage 🖥️
19
+ ### 📦 Usage
40
20
 
41
21
  ```shell
42
22
  pip -U install novelai-python
43
23
  ```
44
24
 
45
- More examples can be found in the [playground](https://github.com/LlmKira/novelai-python/tree/main/playground)
46
- directory, read code as documentation.
25
+ **More examples can be found in the [playground](https://github.com/LlmKira/novelai-python/tree/main/playground)
26
+ directory, read code as documentation.**
47
27
 
48
28
  ```python
49
29
  import asyncio
@@ -88,7 +68,7 @@ async def main():
88
68
  )
89
69
  cost = gen.calculate_cost(is_opus=True)
90
70
  print(f"charge: {cost} if you are vip3")
91
- resp = gen.request(session=session)
71
+ resp = await gen.request(session=session)
92
72
  resp: ImageGenerateResp
93
73
  print(resp.meta)
94
74
  file = resp.files[0]
@@ -101,7 +81,7 @@ loop.run_until_complete(main())
101
81
 
102
82
  ```
103
83
 
104
- #### LLM
84
+ #### 📦 LLM
105
85
 
106
86
  ```python
107
87
  import asyncio
@@ -152,7 +132,7 @@ loop = asyncio.get_event_loop()
152
132
  loop.run_until_complete(chat("Hello"))
153
133
  ```
154
134
 
155
- #### Random Prompt
135
+ #### 📦 Random Prompt
156
136
 
157
137
  ```python
158
138
  from novelai_python.tool.random_prompt import RandomPromptGenerator
@@ -161,14 +141,14 @@ prompt = RandomPromptGenerator(nsfw_enabled=False).random_prompt()
161
141
  print(prompt)
162
142
  ```
163
143
 
164
- #### Run A Server
144
+ #### 📦 Run A Server
165
145
 
166
146
  ```shell
167
147
  pip install novelai_python
168
148
  python3 -m novelai_python.server -h '127.0.0.1' -p 7888
169
149
  ```
170
150
 
171
- #### Tokenizer
151
+ #### 📦 Tokenizer
172
152
 
173
153
  ```python
174
154
  from novelai_python._enum import get_tokenizer_model, TextLLMModel
@@ -183,7 +163,32 @@ print(tokenizer_package.decode(tokenizer_package.encode(t_text)))
183
163
 
184
164
  ```
185
165
 
186
- ## About Nsfw 🚫
166
+ ### 🔨 Roadmap
167
+
168
+ - [x] tool.random_prompt
169
+ - [x] tool.paint_mask
170
+ - [x] tool.image_metadata
171
+ - [x] tokenizer
172
+ - [x] /ai/generate-image
173
+ - [x] /user/subscription
174
+ - [x] /user/login
175
+ - [x] /user/information
176
+ - [x] /ai/upscale
177
+ - [x] /ai/generate-image/suggest-tags
178
+ - [x] /ai/generate-voice
179
+ - [x] /ai/generate-stream
180
+ - [x] /ai/generate
181
+ - [x] /ai/augment-image
182
+ - [ ] /ai/annotate-image
183
+ - [ ] /ai/classify
184
+ - [ ] /ai/generate-prompt
185
+
186
+ > GenerateImageInfer.calculate_cost is correct in most cases, but please request account information to get accurate
187
+ > consumption information.
188
+
189
+ > This repo is maintained by me personally now. If you have any questions, please feel free to open an issue.
190
+
191
+ ## 🚫 About Nsfw
187
192
 
188
193
  You might need some solutions for identifying NSFW content and adding a mosaic to prevent operational mishaps.
189
194
 
@@ -191,7 +196,7 @@ https://dghs-imgutils.deepghs.org/main/api_doc/detect/nudenet.html
191
196
 
192
197
  https://dghs-imgutils.deepghs.org/main/api_doc/operate/censor.html
193
198
 
194
- ## Acknowledgements 🙏
199
+ ## 🙏 Acknowledgements
195
200
 
196
201
  [BackEnd](https://api.novelai.net/docs)
197
202
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "novelai-python"
3
- version = "0.6.0"
3
+ version = "0.6.1"
4
4
  description = "NovelAI Python Binding With Pydantic"
5
5
  authors = [
6
6
  { name = "sudoskys", email = "coldlando@hotmail.com" },
@@ -7,7 +7,6 @@ import json
7
7
  import math
8
8
  import random
9
9
  from copy import deepcopy
10
- from dataclasses import field
11
10
  from io import BytesIO
12
11
  from typing import Optional, Union, Tuple, List
13
12
  from urllib.parse import urlparse
@@ -28,7 +27,7 @@ from novelai_python.sdk.ai._cost import CostCalculator
28
27
  from novelai_python.sdk.ai._enum import Model, Sampler, NoiseSchedule, ControlNetModel, Action, UCPreset, \
29
28
  INPAINTING_MODEL_LIST, get_default_uc_preset, \
30
29
  ModelTypeAlias, UCPresetTypeAlias, get_default_noise_schedule, get_supported_noise_schedule, \
31
- get_model_group, ModelGroups, get_supported_params, get_modifiers
30
+ get_model_group, ModelGroups, get_supported_params, get_modifiers, ImageBytesTypeAlias
32
31
  from .schema import Character, V4Prompt, V4NegativePrompt
33
32
  from ...schema import ApiBaseModel
34
33
  from ...._exceptions import APIError, AuthError, ConcurrentGenerationError, SessionHttpError
@@ -79,7 +78,7 @@ class Params(BaseModel):
79
78
  """Noise Schedule"""
80
79
  legacy_v3_extend: Optional[bool] = False
81
80
  """Legacy V3 Extend"""
82
- mask: Union[bytes, str] = None
81
+ mask: ImageBytesTypeAlias = None
83
82
  """Mask for Inpainting"""
84
83
  seed: int = Field(
85
84
  default_factory=lambda: random.randint(0, 4294967295 - 7),
@@ -87,13 +86,13 @@ class Params(BaseModel):
87
86
  le=4294967295 - 7,
88
87
  )
89
88
  """Seed"""
90
- image: Union[bytes, str] = None
89
+ image: ImageBytesTypeAlias = None
91
90
  """Image for img2img"""
92
91
  negative_prompt: Optional[str] = ''
93
92
  """Negative Prompt"""
94
- reference_image_multiple: Optional[List[Union[str, bytes]]] = field(default_factory=list)
93
+ reference_image_multiple: Optional[List[Union[str, bytes]]] = Field(default_factory=list)
95
94
  """Reference Image For Vibe Mode"""
96
- reference_information_extracted_multiple: Optional[List[float]] = field(default_factory=list)
95
+ reference_information_extracted_multiple: Optional[List[float]] = Field(default_factory=list)
97
96
  """Reference Information Extracted For Vibe Mode"""
98
97
  reference_strength_multiple: Optional[List[float]] = Field(
99
98
  default=list,
@@ -113,7 +112,7 @@ class Params(BaseModel):
113
112
  """
114
113
  use_coords: bool = Field(True, description="Use Coordinates")
115
114
  """Use Coordinates"""
116
- characterPrompts: List[Character] = field(default_factory=list)
115
+ characterPrompts: List[Character] = Field(default_factory=list)
117
116
  """Character Prompts"""
118
117
 
119
118
  v4_prompt: Optional[V4Prompt] = Field(None, description="V4 Prompt")
@@ -136,6 +135,12 @@ class Params(BaseModel):
136
135
  uncond_scale: Optional[float] = Field(None, ge=0, le=1.5, multiple_of=0.05)
137
136
  """Undesired Content Strength"""
138
137
 
138
+ @model_validator(mode="after")
139
+ def v_character(self):
140
+ if len(self.characterPrompts) > 6:
141
+ raise ValueError("Too many character given")
142
+ return self
143
+
139
144
  @field_validator('uncond_scale')
140
145
  def v_uncond_scale(cls, v: float):
141
146
  """
@@ -684,10 +689,9 @@ class GenerateImageInfer(ApiBaseModel):
684
689
 
685
690
  If you need to define more parameters, you should initialize the Param class yourself.
686
691
 
687
- :param controlnet_strength:
688
692
  :param strength:
689
693
  :param image:
690
- :param noise: For img2img
694
+ :param noise: For image to image
691
695
  :param extra_noise_seed: Get extra_noise_seed
692
696
  :param reference_information_extracted_multiple:
693
697
  :param reference_strength_multiple:
File without changes
File without changes