-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from LlmKira/dev
Dev
- Loading branch information
Showing
17 changed files
with
331 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# -*- coding: utf-8 -*- | ||
# @Time : 2024/2/13 下午8:25 | ||
# @Author : sudoskys | ||
# @File : suggest_tag.py | ||
# @Software: PyCharm | ||
import asyncio | ||
import os | ||
|
||
from dotenv import load_dotenv | ||
from loguru import logger | ||
from pydantic import SecretStr | ||
|
||
from novelai_python import APIError | ||
from novelai_python import SuggestTags, SuggestTagsResp, JwtCredential | ||
|
||
load_dotenv() | ||
|
||
token = None | ||
jwt = os.getenv("NOVELAI_JWT") or token | ||
|
||
|
||
async def main(): | ||
globe_s = JwtCredential(jwt_token=SecretStr(jwt)) | ||
try: | ||
_res = await SuggestTags().request( | ||
session=globe_s | ||
) | ||
_res: SuggestTagsResp | ||
print(f"Information: {_res}") | ||
print(_res.model_dump()) | ||
except APIError as e: | ||
logger.exception(e) | ||
print(e.__dict__) | ||
return | ||
|
||
|
||
loop = asyncio.get_event_loop() | ||
loop.run_until_complete(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[project] | ||
name = "novelai-python" | ||
version = "0.3.1" | ||
version = "0.3.2" | ||
description = "Novelai Python Binding With Pydantic" | ||
authors = [ | ||
{ name = "sudoskys", email = "[email protected]" }, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# -*- coding: utf-8 -*- | ||
# @Time : 2024/2/13 下午8:10 | ||
# @Author : sudoskys | ||
# @File : _enum.py | ||
# @Software: PyCharm | ||
from enum import Enum, IntEnum | ||
|
||
|
||
class Sampler(Enum): | ||
K_EULER = "k_euler" | ||
K_EULER_ANCESTRAL = "k_euler_ancestral" | ||
K_DPMPP_2S_ANCESTRAL = "k_dpmpp_2s_ancestral" | ||
K_DPMPP_2M = "k_dpmpp_2m" | ||
K_DPMPP_SDE = "k_dpmpp_sde" | ||
DDIM_V3 = "ddim_v3" | ||
|
||
|
||
class NoiseSchedule(Enum): | ||
NATIVE = "native" | ||
KARRAS = "karras" | ||
EXPONENTIAL = "exponential" | ||
POLYEXPONENTIAL = "polyexponential" | ||
|
||
|
||
class UCPreset(IntEnum): | ||
TYPE0 = 0 | ||
TYPE1 = 1 | ||
TYPE2 = 2 | ||
TYPE3 = 3 | ||
|
||
|
||
class Action(Enum): | ||
GENERATE = "generate" | ||
"""Generate Image""" | ||
IMG2IMG = "img2img" | ||
"""Image to Image""" | ||
INFILL = "infill" | ||
"""Inpainting""" | ||
|
||
|
||
class ControlNetModel(Enum): | ||
HED = "hed" | ||
"""边缘检测""" | ||
MIDAS = "midas" | ||
"""景深""" | ||
FAKE_SCRIBBLE = "fake_scribble" | ||
"""伪涂鸦""" | ||
M_LSD = "mlsd" | ||
"""(建筑)线条检测""" | ||
LANDSCAPER = "uniformer" | ||
"""风景生成""" | ||
|
||
|
||
class Resolution(Enum): | ||
RES_512_768 = (512, 768) | ||
RES_768_512 = (768, 512) | ||
RES_640_640 = (640, 640) | ||
RES_832_1216 = (832, 1216) | ||
RES_1216_832 = (1216, 832) | ||
RES_1024_1024 = (1024, 1024) | ||
RES_1024_1536 = (1024, 1536) | ||
RES_1536_1024 = (1536, 1024) | ||
RES_1472_1472 = (1472, 1472) | ||
RES_1088_1920 = (1088, 1920) | ||
RES_1920_1088 = (1920, 1088) | ||
|
||
class Model(Enum): | ||
NAI_DIFFUSION_3 = "nai-diffusion-3" | ||
NAI_DIFFUSION_3_INPAINTING = "nai-diffusion-3-inpainting" | ||
|
||
NAI_DIFFUSION = "nai-diffusion" | ||
NAI_DIFFUSION_INPAINTING = "nai-diffusion-inpainting" | ||
|
||
SAFE_DIFFUSION = "safe-diffusion" | ||
SAFE_DIFFUSION_INPAINTING = "safe-diffusion-inpainting" | ||
|
||
NAI_DIFFUSION_FURRY = "nai-diffusion-furry" | ||
FURRY_DIFFUSION_INPAINTING = "furry-diffusion-inpainting" |
Oops, something went wrong.