Releases: LlmKira/novelai-python
Releases · LlmKira/novelai-python
pypi_0.7.4 Fix qualityToggle
pypi_0.7.3 fix generate_voice, better logger
Break Change
try:
voice_gen = VoiceGenerate.build(
text=text,
- voice_engine=VoiceSpeakerV1.Crina, # VoiceSpeakerV2.Ligeia,
+ speaker=VoiceSpeakerV2.Ligeia, # VoiceSpeakerV2.Ligeia,
)
result = await voice_gen.request(
session=credential
What's Changed
fix #96
Full Changelog: pypi_0.7.2...pypi_0.7.3
pypi_0.7.2 generate_image: Fine-grained control
What's Changed
GenerateImageInfer
def set_mutual_exclusion(self, value: bool):
"""
**Enable This will modify the negative prompt.**
Default is False.
Positive words and negative words are mutually exclusive, and conflicting negative words are deleted first.
:param value: bool
:return: self
"""
self._mutual_exclusion = bool(value)
return self
def set_quality_modifier(self, value: bool):
"""
**Enable This will modify the input prompt.**
Default is True.
Add Quality Modifier To Input.
Whether to add the quality vocabulary used by the web application.
:param value:
:return:
"""
self._quality_modifier = bool(value)
return self
Full Changelog: pypi_0.7.1...pypi_0.7.2
pypi_0.7.1 Fix bug
pypi_0.7.0 randomPrompt for scene
⚠️ BreakChange
- ImageMetadata :4ef1564#diff-e06ec54276da93f2efb9406fca4be01f7bfbaacb26cc704f40a92920788b762e
- random Prompt :4ef1564#diff-91350bef130e6b3438acbc35149a682f8b1bf4259455d069244c0342d254f06c
What's Changed
- 🔧 feat(tokenizer): add T5 model support and enhance tokenizer usage by @sudoskys in #87
- feat: implement image metadata extraction and verification by @sudoskys in #89
Full Changelog: pypi_0.6.1...pypi_0.7.0
pypi_0.6.1 nai-diffusion-4-curated-preview
⚠️ BreakChange
- GenerateImageInfer.build(
+ GenerateImageInfer.build_generate(
+ GenerateImageInfer.build_img2img(
+ GenerateImageInfer.build_infill(
- support nai-diffusion-4-curated-preview
- remove nai-diffusion-1
What's Changed
- patch readme by @sudoskys in #83
- patch readme again by @sudoskys in #84
- ✨ refactor(generate_image): update field imports and type aliases by @sudoskys in #85
Full Changelog: pypi_0.6.0...pypi_0.6.1
pypi_0.6.0 support nai-diffusion-4-curated-preview
⚠️ BreakChange
- GenerateImageInfer.build(
+ GenerateImageInfer.build_generate(
+ GenerateImageInfer.build_img2img(
+ GenerateImageInfer.build_infill(
What's Changed
Full Changelog: pypi_0.5.3...pypi_0.6.0
pypi_0.5.3 Fix datetime error
What's Changed
Full Changelog: pypi_0.5.2...pypi_0.5.3
pypi_0.5.2 Add ImageVerifier for tool.image_metadata
What's Changed
- (feat):Update Readme by @sudoskys in #77
- (refactor): Add ImageVerifier for tool.image_metadata / add bch_utils by @sudoskys in #78
!! Breakchange
- delete
ImageMetadata.verify_image_is_novelai
, useImageVerifier.verify
instead
Usage
from pathlib import Path
from novelai_python.tool.image_metadata import ImageMetadata, ImageVerifier
image = Path(__file__).parent.joinpath("sample-0316.png")
image_clear = ImageMetadata.reset_alpha(
image=image
)
try:
meta = ImageMetadata.load_image(image)
except ValueError:
raise LookupError("Cant find a MetaData")
print(meta.Title)
print(f"Description: {meta.Description}")
print(f"Comment: {meta.Comment}")
print(f"Request Method: {meta.Comment.request_type}")
print(f"Used image model: {meta.used_model}")
# Verify if the image is from NovelAI
is_novelai, have_latent = ImageVerifier().verify(image=image)
print(f"Is NovelAI: {is_novelai}")
print(f"Have Latent: {have_latent}")
Full Changelog: pypi_0.5.1...pypi_0.5.2
pypi_0.5.1 Support llama3, new endpoint
What's Changed
- fix(0.5.1): add tokenizer.get_vocab() | Diff generation endpoint / text.novelai.net or api.novelai.net by @sudoskys in #76
- (fix): If the model is a string, a cost calculation error will be raised by @sudoskys in #74
- (feat): Novelai tokenizer re-implement || New LLM by @sudoskys in #75
Preset
Preset -> https://github.com/LlmKira/novelai-python/blob/main/src/novelai_python/sdk/ai/generate/_enum.py#L199
async def chat(prompt: str):
try:
model = TextLLMModel.ERATO # llama3
parameters = get_default_preset(model).parameters
agent = LLM.build(
prompt=prompt,
model=model,
parameters=None # Auto Select or get from preset
)
result = await agent.request(session=login_credential)
except APIError as e:
raise Exception(f"Error: {e.message}")
print(f"Result: \n{result.text}")
Full Changelog: pypi_0.5.0...pypi_0.5.1