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 models. Think "curtain", like wizard of oz behind the curtain. This tool lets the developer close the curtains and only focus on implementing one code base for any supported AI 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.
import pycurtain
source = pycurtain.source.SourceType.STABLE_DIFFUSION
prompt = "A blooming flower in the middle of a desert"
img_o = pycurtain.task.image.generate(source, prompt)[0]
img_o.save('output.png')
Supported Tasks
image
- generate (text2img, creation)
- vary (img2img, style transfer)
- edit (img2img, with masks)
- interrogate (img2text, description)
text
- summarize (tl;dr)
- fix_grammar (punctuation, spelling, capitalization, etc.)
- tag (subject matter, genres, subgenres, etc.)
Supported Processes
A process is a way to combine multiple tasks together. For example, you can convert a sequence of images into a video.
- text_to_video_zoom (zoom_in and_out)
from pycurtain.process import text_to_video_zoom
from pycurtain.source import SourceImageType
text_to_video_zoom.zoom_in(prompts=["A grateful dead poster"], source=SourceImageType.STABLE_DIFFUSION, n_imgs=10, file_name="output.mp4")
AI Model Sources
Currently all but one supported AI Models require an API key generated from the REST API host (Craiyon being the exception). 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
- DeepAi SRGAN https://deepai.org/
- StabilityAi Stable Diffusion https://stability.ai/
- OpenAi Dalle2, GPT3 https://openai.com/
- Craiyon (Formally DALL-E Mini) https://www.craiyon.com/
- Replicate https://replicate.com/
Road Map
-
provide prelimiary wrappers for these AI model sources
- hugging_face https://huggingface.co/
-
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
File details
Details for the file pycurtain-0.0.8.tar.gz
.
File metadata
- Download URL: pycurtain-0.0.8.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01bffe67e97cb99eb6f40914ac5c4a676bbf0eac4d7aa23a78875004b08953f5 |
|
MD5 | 67996bfd15a426348f2656b1e890f6cb |
|
BLAKE2b-256 | 7d0aa1a2c745c38140be8c83f953cd59917bde2c111a100e85092996829bdab6 |
File details
Details for the file pycurtain-0.0.8-py3-none-any.whl
.
File metadata
- Download URL: pycurtain-0.0.8-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1ca8a4c80616f9aadcb89085670aebbbe579d606a9a1ca7f1361672918297e5 |
|
MD5 | 5343a1186333480c1caed0c7902b48c4 |
|
BLAKE2b-256 | 37d983a5ed30fc7e4d581288f56219ed95dea87a56ad5ab7c87216a16e5f318c |