Skip to content

Commit

Permalink
✨ feat: add user login functionality
Browse files Browse the repository at this point in the history
- Added user login functionality to the novelai-python project.
- Updated the main function to include LoginCredential.
- Created a globe_s2 object to store the login credentials.
- Added the username and password environment variables to the dotenv file.

ShortTaskResultWithoutChanges:
:sparkles: feat: add user login functionality

- Added user login functionality to the novelai-python project.
- Updated the main function to include LoginCredential.
- Created a globe_s2 object to store the login credentials.
- Added the username and password environment variables to the dotenv file.
  • Loading branch information
sudoskys committed Feb 7, 2024
1 parent fd6984a commit 0858b51
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The goal of this repository is to use Pydantic to build legitimate requests to a

- [x] /ai/generate-image
- [x] /user/subscription
- [x] /user/login
- [ ] /ai/generate-image/suggest-tags
- [ ] /ai/annotate-image
- [ ] /ai/classify
Expand All @@ -28,15 +29,21 @@ import os
from dotenv import load_dotenv
from pydantic import SecretStr

from novelai_python import GenerateImageInfer, ImageGenerateResp, JwtCredential
from novelai_python import GenerateImageInfer, ImageGenerateResp, JwtCredential, LoginCredential

load_dotenv()

enhance = "year 2023,dynamic angle, best quality, amazing quality, very aesthetic, absurdres"


async def main():
globe_s = JwtCredential(jwt_token=SecretStr(os.getenv("NOVELAI_JWT")))
globe_s = JwtCredential(
jwt_token=SecretStr(os.getenv("NOVELAI_JWT"))
)
globe_s2 = LoginCredential(
username=os.getenv("NOVELAI_USERNAME"),
password=SecretStr(os.getenv("NOVELAI_PASSWORD"))
)
_res = await GenerateImageInfer.build(
prompt=f"1girl,{enhance}").generate(
session=globe_s)
Expand Down

0 comments on commit 0858b51

Please sign in to comment.