Skip to content

Commit

Permalink
Merge pull request #62 from LlmKira/dev
Browse files Browse the repository at this point in the history
🐛 fix: Fix issue with uncond_scale comparison in generate_image module
  • Loading branch information
sudoskys authored Jun 3, 2024
2 parents 89db8c6 + b75a7f5 commit 01d3218
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 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.10"
version = "0.4.11"
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 @@ -452,8 +452,8 @@ def calculate_cost(self, is_opus: bool = False):
* smea_factor
)
per_sample = max(math.ceil(per_sample * strength), 2)

if int(uncond_scale) != 1:
# uncond_scale is not 1.0
if not math.isclose(uncond_scale, 1.0, rel_tol=1e-5):
per_sample = math.ceil(per_sample * 1.3)

return per_sample * n_samples
Expand Down
2 changes: 1 addition & 1 deletion src/novelai_python/tool/image_metadata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ def load_image(cls,
title = img.info.get("Title", None)
prompt = img.info.get("Description", None)
comment = img.info.get("Comment", None)
assert isinstance(comment, str), ValueError("Comment Empty")
try:
assert isinstance(comment, str), ValueError("Comment Empty")
comment = json.loads(comment)
except Exception as e:
logger.debug(f"Error loading comment: {e}")
Expand Down

0 comments on commit 01d3218

Please sign in to comment.