python-craiyon-api is a Python Library for interacting with the unofficial Craiyon API.
Grab this library and build.
Here's an example of how to use the module to generate a drawing:
import requests
from craiyonapi import CraiyonAPI
http_client = requests.Session()
api = CraiyonAPI()
prompt = "Draw a cat playing the piano"
negative_prompt = "Don't draw a dog playing the guitar"
result = api.draw(http_client, negative_prompt, prompt)
for image in result.images:
print(image)
print(f"Next prompt: {result.next_prompt}")
print(f"Generation duration: {result.duration} seconds")
Submit a PR
This module is released under the MIT License.