pip install -U prodiapy
Login to Prodia then get your API key on profile page, free account can generate up to 1000 images per months.
import prodiapy
prodia = prodiapy.Prodia(api_key="your api key")
prompt = "kittens on cloud"
job = prodia.sd.generate(prompt=prompt)
result = prodia.wait(job)
print(result.image_url)