Skip to content

Commit

Permalink
Merge pull request #72 from LlmKira/dev
Browse files Browse the repository at this point in the history
Patch: 0.4.15
  • Loading branch information
sudoskys authored Sep 23, 2024
2 parents 00e0e03 + d8959e9 commit 3cca167
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
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.4.15"
version = "0.4.16"
description = "NovelAI Python Binding With Pydantic"
authors = [
{ name = "sudoskys", email = "[email protected]" },
Expand Down
14 changes: 10 additions & 4 deletions src/novelai_python/sdk/ai/generate_image/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,18 @@ def model_post_init(self, *args) -> None:
:param args: Any
:return: None
"""
# Must be a string
if self.parameters.negative_prompt is None:
self.parameters.negative_prompt = ""
default_negative_prompt = get_default_uc_preset(self.model, self.parameters.ucPreset)
self.parameters.negative_prompt = ", ".join(
filter(None, [default_negative_prompt, self.parameters.negative_prompt])
)

# Add negative prompt based on ucPreset
if self.parameters.ucPreset is not None:
default_negative_prompt = get_default_uc_preset(self.model, self.parameters.ucPreset)
self.parameters.negative_prompt = ", ".join(
filter(None, [default_negative_prompt, self.parameters.negative_prompt])
)

# Add quality prompt
if self.parameters.qualityToggle:
self.input += ", best quality, amazing quality, very aesthetic, absurdres"

Expand Down

0 comments on commit 3cca167

Please sign in to comment.