Skip to main content

Create with AI models

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

  • Acccess to the diffusion model weights needs 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. Finally, create a HF_API_TOKEN environment variable containing your token.
  • This library requires python 3.9 or higher.
  • Requires a GPU (6 GB of VRAM) with CUDA support.

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   # or peacasso ui --port=8080
import os
from dotenv import load_dotenv
from peacasso.generator import PromptGenerator
from peacasso.datamodel import PromptConfig

# load token from .env file
load_dotenv()

token = os.environ.get("HF_API_TOKEN")
gen = PromptGenerator(token=token)
prompt = "A sea lion wandering the streets of post apocalyptic London"

prompt_config = PromptConfig(
    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.

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

Peacasso-0.0.5a0.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Peacasso-0.0.5a0-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file Peacasso-0.0.5a0.tar.gz.

File metadata

  • Download URL: Peacasso-0.0.5a0.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for Peacasso-0.0.5a0.tar.gz
Algorithm Hash digest
SHA256 8ac1f7996ed16dbc7ecefe4eef821968290dbadbdbc38c49820f0801320200fa
MD5 d76ebc7d75459ab39980d12598a79574
BLAKE2b-256 d74bc6bb1cc19310ec3403c6375ebb08a5de277ff60e0ba6355a91ada5fdb877

See more details on using hashes here.

File details

Details for the file Peacasso-0.0.5a0-py3-none-any.whl.

File metadata

  • Download URL: Peacasso-0.0.5a0-py3-none-any.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for Peacasso-0.0.5a0-py3-none-any.whl
Algorithm Hash digest
SHA256 b453981386f4c829045a20e356c994f16c48ec950f16de52dee808d48973081a
MD5 7a80a5e85a98e11ce4d5a29122e02b61
BLAKE2b-256 89e934f4ed69cc8ff9786b0280ad4829b5052b434dda4c7a1f364f720a78dcba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page