Skip to content

Commit e02d2c7

Browse files
authored
Merge pull request #124 from LlmKira/dev
🔧 fixes(auth&uc): Uppercase usernames and mutual exclusion fixes.
2 parents 0f60420 + d788c84 commit e02d2c7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "novelai-python"
3-
version = "0.7.11"
3+
version = "0.7.12"
44
description = "NovelAI Python Binding With Pydantic"
55
authors = [
66
{ name = "sudoskys", email = "coldlando@hotmail.com" },

src/novelai_python/sdk/ai/generate_image/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,14 @@ def enhance_message(_prompt):
167167
for key in input_prompt:
168168
if key in uc_prompt:
169169
uc_prompt.pop(key)
170-
self.parameters.negative_prompt = ",".join(uc_prompt.values())
170+
self.parameters.negative_prompt = ",".join(uc_prompt.values()).strip()
171171

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

177-
self.parameters.negative_prompt = ",".join(uc_prompt.values())
177+
self.parameters.negative_prompt = ",".join(uc_prompt.values()).strip()
178178

179179
@model_validator(mode="after")
180180
def _build_nai4_prompt(self):

src/novelai_python/utils/encode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def encode_access_key(username: str, password: str) -> str:
1616
:param password: str (plaintext)
1717
:return: str
1818
"""
19-
pre_salt = f"{password[:6]}{username}novelai_data_access_key"
19+
pre_salt = f"{password[:6]}{username.lower()}novelai_data_access_key"
2020

2121
blake = blake2b(digest_size=16)
2222
blake.update(pre_salt.encode())

0 commit comments

Comments
 (0)