Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "novelai-python"
version = "0.7.11"
version = "0.7.12"
description = "NovelAI Python Binding With Pydantic"
authors = [
{ name = "sudoskys", email = "[email protected]" },
Expand Down
4 changes: 2 additions & 2 deletions src/novelai_python/sdk/ai/generate_image/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ def enhance_message(_prompt):
for key in input_prompt:
if key in uc_prompt:
uc_prompt.pop(key)
self.parameters.negative_prompt = ",".join(uc_prompt.values())
self.parameters.negative_prompt = ",".join(uc_prompt.values()).strip()

# Instantly remove nsfw if input contains it
elif "nsfw" in self.input and "nsfw" in self.parameters.negative_prompt:
uc_prompt = {x.strip(): x for x in self.parameters.negative_prompt.split(",")}
uc_prompt.pop("nsfw", None)

self.parameters.negative_prompt = ",".join(uc_prompt.values())
self.parameters.negative_prompt = ",".join(uc_prompt.values()).strip()

@model_validator(mode="after")
def _build_nai4_prompt(self):
Expand Down
2 changes: 1 addition & 1 deletion src/novelai_python/utils/encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def encode_access_key(username: str, password: str) -> str:
:param password: str (plaintext)
:return: str
"""
pre_salt = f"{password[:6]}{username}novelai_data_access_key"
pre_salt = f"{password[:6]}{username.lower()}novelai_data_access_key"

blake = blake2b(digest_size=16)
blake.update(pre_salt.encode())
Expand Down