An unofficial API for pixai.art for Python
Project description
💬 Pixai.art
An unofficial API for Pixai.art for Python using request
💻 Installation
pip install PixaiAPI
🔑 Get Token
The token is needed for authorization and operation of requests from your account
- Open DevTools in your browser
- Go to Storage -> Local Storage ->
api.pixai.art:token - Copy
value
ᅠ
📙 Example
from pixai import PixaiAPI
client = PixaiAPI('TOKEN')
startGeneration = client.createGenerationTask(
prompts='girl, white hair, winter',
steps='20',
modelId='1648918127446573124'
)
imageurlurl = client.getTaskById(startGeneration)
image = client.DownloadImage(imageurlurl)
⛏️How is work (short)
Due to the unofficial nature of the API, the approach to image generation deviates from standard methods
- Send
createGenerationTaskto initiate image generation - Receive
generationIdas acknowledgment.
To track the progress or retrieve the generated image, use the getTaskById endpoint, passing in your generationId
- Use
getTaskByIdwith yourgenerationIdto get a link to the image - Dowload image by link
Workflow Summary createGenerationTask -> receive generationId -> getTaskById with generationId -> receive url_to_image -> Download image from link
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pixaiAPI-0.1.11.tar.gz
(3.7 kB
view details)
File details
Details for the file pixaiAPI-0.1.11.tar.gz.
File metadata
- Download URL: pixaiAPI-0.1.11.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34e35900b7ddffc7d0ea85123fa3d89227653dd6800bad2c52baf9002ba97b79
|
|
| MD5 |
9a2ab3181f19e2f9164d1d54ccc270a5
|
|
| BLAKE2b-256 |
7307d37914401c47980d45ffe67bd74e7aca41c4cbb41677ab017fad953beb5f
|