A community-maintained Python package for wrapping a variety of REST API calls for different AI art models.
Project description
Pycurtain
A community-maintained python package for wrapping REST APIs that interface with a variety of different AI art models. Think "curtain" like what is seen in an art gallery. This tool lets the developer close the curtains and only focus on implementing one code base for any supported AI art models.
Install
pip install pycurtain
Usage
There are tasks (image-related) and sources (AI art models) that are supported. The following is an example of how to use the package to generate an image from a model source.
from PIL import Image
import pycurtain
source = pycurtain.source.SourceType.STABILILTY_AI
prompt:str = "A blooming flower in the middle of a desert"
img_o : Image.Image = pycurtain.task.image.generate(source, prompt)
img_o.save('output.png')
AI Model Sources
Currently all supported AI Models require an API key generated from the REST API host. Pycurtain is a third-party (open-source / community driven) python wrapper SDK and is not associated with any of the AI Model providers. Each API key can be generated by signing up from the AI Model hosting site. The current implementation requires each (in-use) API key to be set in the environment variables following the secrets\stuff.py format.
No API Key or private information is stored by Pycurtain.
Sources Offical Sites
- deep_ai https://deepai.org/
- stability_sdk https://stability.ai/
- open-ai dalle2 https://openai.com/
Road Map
-
provide prelimiary wrappers for these AI model sources
- craiyon https://www.craiyon.com/
- replicate_ai https://replicate.com/
- hugging_face https://huggingface.co/
stability_aideep_aiopen_ai dalle2
-
allow users to adjust common parameters between models
-
provide utility features beyond the model wrapper
- equirectangluar images (360 degree images)
- simple inpainting mask creation
-
beyond images... videos, text, audio. All leveraging the available REST API accessible ML models of today.
Developing Pycurtain
To install pycurtain, along with the tools you need to develop and run test, run the following in your virtual environment:
pip install -e .[dev]
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
Built Distribution
Hashes for pycurtain-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14d3f3d35f074f2f792b7ba27b641959affa330c34fb90fa692bd78bb95ca906 |
|
MD5 | df019b11f9663183f3757a64c5fb90d4 |
|
BLAKE2b-256 | cee638a290ba5e372a731ec1abbe4ca32cb6e00dbea6c7594ef5d0b20688c428 |