Skip to main content

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

  1. Open DevTools in your browser
  2. Go to Storage -> Local Storage -> api.pixai.art:token
  3. 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

  1. Send createGenerationTask to initiate image generation
  2. Receive generationId as acknowledgment.

To track the progress or retrieve the generated image, use the getTaskById endpoint, passing in your generationId

  1. Use getTaskById with your generationId to get a link to the image
  2. Dowload image by link

Workflow Summary createGenerationTask -> receive generationId -> getTaskById with generationId -> receive url_to_image -> Download image from link

Project details


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)

Uploaded Source

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

Hashes for pixaiAPI-0.1.11.tar.gz
Algorithm Hash digest
SHA256 34e35900b7ddffc7d0ea85123fa3d89227653dd6800bad2c52baf9002ba97b79
MD5 9a2ab3181f19e2f9164d1d54ccc270a5
BLAKE2b-256 7307d37914401c47980d45ffe67bd74e7aca41c4cbb41677ab017fad953beb5f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page