Skip to main content

Create Disco Diffusion artworks in one line

Project description

Create compelling Disco Diffusion artworks in one line

PyPI Open in Google Colab

DiscoArt is an elegant way of creating compelling Disco Diffusion[*] artworks for generative artists, AI enthusiasts and hard-core developers. DiscoArt has a modern & professional API with a beautiful codebase, ensuring high usability and maintainability. It introduces handy features such as result recovery and persistence, gRPC/HTTP serving w/o TLS, post-analysis, easing the integration to larger cross-modal or multi-modal applications.

[*] Disco Diffusion is a Google Colab Notebook that leverages CLIP-Guided Diffusion to allow one to create compelling and beautiful images from text prompts.

👼 Available to all: fully optimized for Google Colab free tier! Perfect for those who don't own GPU by themselves.

🎨 Focus on creating not coding: one-liner create() with Pythonic interfaces and powerful features. Fetch real-time results anywhere anytime, no more worry on session outrage on Google Colab free tier.

🏭 Ready for integration & production: built on top of DocArray data structure, enjoy smooth integration with Jina, CLIP-as-service and other cross-/multi-modal applications.

Install

pip install discoart

If you are not using DiscoArt under Google Colab, then other dependencies might be required.

Get Started

This Google Colab Notebook provides a walkthrough of DiscoArt.

Create artworks

from discoart import create

da = create()

That's it! It will create with the default text prompts and parameters.

Fetch results

create() returns da, a DocumentArray-type object. It contains the following information:

  • All arguments passed to create() function, including seed, text prompts and model parameters.
  • The generated image and its intermediate images.

This allows you to further post-process, analyze, export the results with powerful DocArray API.

For example, you can display all final images in a grid:

da.plot_image_sprites(skip_empty=True, fig_size=(10, 10), show_index=True)

Or the final image of one particular run:

da[0].display()

You can zoom into that run and display images on the intermediate steps:

da[0].chunks.plot_image_sprites(skip_empty=True, fig_size=(10, 10), show_index=True)

Finally, you can review its parameters via:

da[0].tags

Recover from failure and interrupts

If you are a free-tier Google Colab user, one annoy thing is the lost of sessions from time to time. With DiscoArt, you can easily recover the results by pulling the last session ID.

  1. Find the session ID. It appears on top of the image.

  2. Pull the result via that ID on any machine at any time, not necessarily on Google Colab:

    from docarray import DocumentArray
    
    da = DocumentArray.pull('discoart-3205998582')
    

Specify parameters

DiscoArt support parameters are listed here. You can specify them directly in create():

from discoart import create

create(text_prompts='A painting of sea cliffs in a tumultuous storm, Trending on ArtStation.',
       init_image='https://d2vyhzeko0lke5.cloudfront.net/2f4f6dfa5a05e078469ebe57e77b72f0.png',
       skip_steps=100)

This docs explains those parameters in very details.

Verbose logs

You can also get verbose logs by setting the following lines before import discoart:

import os

os.environ['DISCOART_LOG_LEVEL'] = 'DEBUG'

Support

Join Us

DiscoArt is backed by Jina AI and licensed under Apache-2.0. We are actively hiring AI engineers, solution engineers to build the next neural search ecosystem in open-source.

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

discoart-0.0.2.tar.gz (33.5 kB view details)

Uploaded Source

File details

Details for the file discoart-0.0.2.tar.gz.

File metadata

  • Download URL: discoart-0.0.2.tar.gz
  • Upload date:
  • Size: 33.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.13

File hashes

Hashes for discoart-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b5209479714305adad9cf13c040aa38f9555a169a08e85b57507bb31c3f7dbbe
MD5 4358ee4f2efbe14393e0058b18fb9fd7
BLAKE2b-256 baeb1048fc9a9774f155b58ba6110080046d127b68571a958cb1d5882c7cc7b8

See more details on using hashes here.

Supported by

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