novelai-python 0.7.1__tar.gz → 0.7.2__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.
- {novelai_python-0.7.1 → novelai_python-0.7.2}/PKG-INFO +1 -1
- {novelai_python-0.7.1 → novelai_python-0.7.2}/pyproject.toml +1 -1
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/generate_image/__init__.py +48 -3
- {novelai_python-0.7.1 → novelai_python-0.7.2}/LICENSE +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/NOTICE.MD +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/README.md +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/__init__.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_enum.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_exceptions.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_response/__init__.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_response/ai/__init__.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_response/ai/generate.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_response/ai/generate_image.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_response/ai/generate_stream.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_response/ai/generate_voice.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_response/ai/upscale.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_response/schema.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_response/user/__init__.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_response/user/information.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_response/user/login.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_response/user/subscription.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/credential/ApiToken.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/credential/JwtToken.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/credential/UserAuth.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/credential/__init__.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/credential/_base.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/__init__.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/LICENSE +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/__init__.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/_const.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/_cost.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/_enum.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/augment_image/__init__.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/augment_image/_enum.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/generate/__init__.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/generate/_const.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/generate/_enum.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/generate/_schema.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/generate/themes.json +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/generate_image/schema.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/generate_image/suggest_tags.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/generate_stream.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/generate_voice/__init__.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/generate_voice/_enum.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/upscale.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/schema.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/user/__init__.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/user/information.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/user/login.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/user/subscription.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/server.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tokenizer/__init__.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tokenizer/clip_simple_tokenizer.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tokenizer/nerdstash_v1.model +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tokenizer/nerdstash_v2.model +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tokenizer/novelai.model +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tokenizer/novelai_v2.model +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tool/__init__.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tool/image_metadata/__init__.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tool/image_metadata/bch_utils.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tool/image_metadata/lsb_extractor.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tool/image_metadata/lsb_injector.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tool/paint_mask/__init__.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tool/random_prompt/__init__.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tool/random_prompt/generate_scene_composition.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tool/random_prompt/generate_scene_tags.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tool/random_prompt/generate_tags.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/utils/__init__.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/utils/encode.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/utils/useful.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/tests/__init__.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/tests/test_generate_voice.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/tests/test_random_prompt.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/tests/test_server.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/tests/test_server_run.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/tests/test_tokenizer.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/tests/test_upscale.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/tests/test_user_information.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/tests/test_user_login.py +0 -0
- {novelai_python-0.7.1 → novelai_python-0.7.2}/tests/test_user_subscription.py +0 -0
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/generate_image/__init__.py
RENAMED
|
@@ -344,6 +344,35 @@ class Params(BaseModel):
|
|
|
344
344
|
|
|
345
345
|
class GenerateImageInfer(ApiBaseModel):
|
|
346
346
|
_endpoint: str = PrivateAttr("https://image.novelai.net")
|
|
347
|
+
_mutual_exclusion: bool = PrivateAttr(False)
|
|
348
|
+
"""Positive words and negative words are mutually exclusive, and conflicting negative words are deleted first."""
|
|
349
|
+
_quality_modifier: bool = PrivateAttr(True)
|
|
350
|
+
"""Add Quality Modifier To Input"""
|
|
351
|
+
|
|
352
|
+
def set_mutual_exclusion(self, value: bool):
|
|
353
|
+
"""
|
|
354
|
+
**Enable This will modify the negative prompt.**
|
|
355
|
+
Default is False.
|
|
356
|
+
|
|
357
|
+
Positive words and negative words are mutually exclusive, and conflicting negative words are deleted first.
|
|
358
|
+
:param value: bool
|
|
359
|
+
:return: self
|
|
360
|
+
"""
|
|
361
|
+
self._mutual_exclusion = bool(value)
|
|
362
|
+
return self
|
|
363
|
+
|
|
364
|
+
def set_quality_modifier(self, value: bool):
|
|
365
|
+
"""
|
|
366
|
+
**Enable This will modify the input prompt.**
|
|
367
|
+
Default is True.
|
|
368
|
+
|
|
369
|
+
Add Quality Modifier To Input.
|
|
370
|
+
Whether to add the quality vocabulary used by the web application.
|
|
371
|
+
:param value:
|
|
372
|
+
:return:
|
|
373
|
+
"""
|
|
374
|
+
self._quality_modifier = bool(value)
|
|
375
|
+
return self
|
|
347
376
|
|
|
348
377
|
@property
|
|
349
378
|
def endpoint(self):
|
|
@@ -429,7 +458,19 @@ class GenerateImageInfer(ApiBaseModel):
|
|
|
429
458
|
)
|
|
430
459
|
return _prompt
|
|
431
460
|
|
|
432
|
-
|
|
461
|
+
if self._quality_modifier:
|
|
462
|
+
logger.trace("Enhancing input with quality modifier, will modify input prompt.")
|
|
463
|
+
self.input = enhance_message(self.input)
|
|
464
|
+
|
|
465
|
+
if self._mutual_exclusion:
|
|
466
|
+
logger.trace("Mutual exclusion is enabled, will modify negative prompt.")
|
|
467
|
+
input_prompt = {x.strip(): x for x in self.input.split(",")}
|
|
468
|
+
uc_prompt = {x.strip(): x for x in self.parameters.negative_prompt.split(",")}
|
|
469
|
+
# Remove conflicting negative words
|
|
470
|
+
for key in input_prompt:
|
|
471
|
+
if key in uc_prompt:
|
|
472
|
+
uc_prompt.pop(key)
|
|
473
|
+
self.parameters.negative_prompt = ",".join(uc_prompt.values())
|
|
433
474
|
|
|
434
475
|
@model_validator(mode="after")
|
|
435
476
|
def _build_nai4_prompt(self):
|
|
@@ -467,7 +508,9 @@ class GenerateImageInfer(ApiBaseModel):
|
|
|
467
508
|
@model_validator(mode="after")
|
|
468
509
|
def _backend_logic(self):
|
|
469
510
|
"""
|
|
470
|
-
|
|
511
|
+
Calibration results.
|
|
512
|
+
|
|
513
|
+
**NOTE: It is forbidden to write logic that does not belong to novelai.net here**
|
|
471
514
|
:return: self
|
|
472
515
|
"""
|
|
473
516
|
if self.action == Action.GENERATE:
|
|
@@ -949,7 +992,9 @@ class GenerateImageInfer(ApiBaseModel):
|
|
|
949
992
|
override_headers: Optional[dict] = None,
|
|
950
993
|
) -> ImageGenerateResp:
|
|
951
994
|
"""
|
|
952
|
-
Generate images using NovelAI's diffusion models
|
|
995
|
+
**Generate images using NovelAI's diffusion models.**
|
|
996
|
+
|
|
997
|
+
According to our Terms of Service, all generation requests must be initiated by a human action. Automating text or image generation to create excessive load on our systems is not allowed.
|
|
953
998
|
|
|
954
999
|
:param override_headers: the headers to override
|
|
955
1000
|
:param session: session
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_response/ai/generate_image.py
RENAMED
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_response/ai/generate_stream.py
RENAMED
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_response/ai/generate_voice.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_response/user/information.py
RENAMED
|
File without changes
|
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/_response/user/subscription.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/augment_image/__init__.py
RENAMED
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/augment_image/_enum.py
RENAMED
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/generate/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/generate/themes.json
RENAMED
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/generate_image/schema.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/generate_voice/__init__.py
RENAMED
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/sdk/ai/generate_voice/_enum.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tokenizer/clip_simple_tokenizer.py
RENAMED
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tokenizer/nerdstash_v1.model
RENAMED
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tokenizer/nerdstash_v2.model
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tool/image_metadata/__init__.py
RENAMED
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tool/image_metadata/bch_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tool/image_metadata/lsb_injector.py
RENAMED
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tool/paint_mask/__init__.py
RENAMED
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tool/random_prompt/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{novelai_python-0.7.1 → novelai_python-0.7.2}/src/novelai_python/tool/random_prompt/generate_tags.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|