💬 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
Metadata
Release files for pixaiAPI 0.1.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pixaiAPI-0.1.11.tar.gz | 3.7 kB | Details |
Release files / pixaiAPI-0.1.11.tar.gz
| Download URL | pixaiAPI-0.1.11.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
34e35900b7ddffc7d0ea85123fa3d89227653dd6800bad2c52baf9002ba97b79
|
|
BLAKE2b-256 checksum How to use checksums |
7307d37914401c47980d45ffe67bd74e7aca41c4cbb41677ab017fad953beb5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.6
|