UI tool to help you generate art (and experiment) with multimodal (text, image) AI models (stable diffusion)
Project description
Peacasso
Peacasso is a UI tool to help you generate art (and experiment) with multimodal (text, image) AI models (stable diffusion).
Requirements and Installation
-
Step 1: HuggingFace Access
Access to the diffusion model weights requires a HuggingFace model account and access token. Please create an account at huggingface.co, get an access token and agree to the model terms here. Next, create a
HF_API_TOKEN
environment variable containing your token.export HF_API_TOKEN=your_token
. Note that the first time you run peacasso, the weights for the SD model are cached locally on your machine. -
Step 2: Verify Environment - Pythong 3.7+ and CUDA Setup and verify that your python environment is
python 3.7
or higher (preferably, use Conda). Also verify that you have CUDA installed correctly (torch.cuda.is_available()
is true) and your GPU has about 7GB of VRAM memory.
Once requirements are met, run the following command to install the library:
pip install peacasso
Usage - UI and Python API
You can use the library from the ui by running the following command:
peacasso ui --port=8080
Then navigate to http://localhost:8080/ in your browser.
You can also use the python api by running the following command:
import os
from dotenv import load_dotenv
from peacasso.generator import ImageGenerator
from peacasso.datamodel import GeneratorConfig
token = os.environ.get("HF_API_TOKEN")
gen = ImageGenerator(token=token)
prompt = "A sea lion wandering the streets of post apocalyptic London"
prompt_config = GeneratorConfig(
prompt=prompt,
num_images=3,
width=512,
height=512,
guidance_scale=7.5,
num_inference_steps=50,
)
result = gen.generate(prompt_config)
for i, image in enumerate(result["images"]):
image.save(f"image_{i}.png")
Features and Road Map
- Command line interface
- UI Features. Query models with multiple parametrs
- Text prompting
- Image based prompting
- Image inpainting (masking)
- Latent space exploration
- Curation/sharing experiment results
Acknowledgement
This work builds on the stable diffusion model and code is adapted from the HuggingFace implementation. Please note the - CreativeML Open RAIL-M license associated with the stable diffusion model.
Project details
Release history Release notifications | RSS feed
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 Peacasso-0.0.8a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e548effe01e0e079013e44227e1f808c95f5e1261ee1a0ec1c5e1e5e8ad6f6d1 |
|
MD5 | 7b3cf9c60ee5d8e6d4d215fd0b5b5206 |
|
BLAKE2b-256 | b93e695498c3932fad53a32cf1a65ce9f1df47c39324d9cdb7571c73d416535a |