repos
/ ai-art master

ai-art

mirror archived upstream

Art generation with VQGAN + CLIP in Docker, with a simple web UI for anyone with a GPU. A simplified and expanded take on Kevin Costa's work.

aiai-artclipdockerdocker-composegpuhandcodedimagenetpythonpytorchtorchtorchvisionvqganvqgan-clip

2.4 KB · 76 lines · markdown Raw History
 1> **Archived.** This project is no longer in use and no longer maintained. Last updated July 2022.
 2
 3# AI-Art
 4
 5![AI-Art Screenshot](./Screenshot.webp)
 6
 7Art generation using VQGAN + CLIP using docker containers. A simplified,
 8updated, and expanded upon version of
 9[Kevin Costa's work](https://github.com/kcosta42/VQGAN-CLIP-Docker). This
10project tries to make generating art as easy as possible for anyone with a GPU
11by providing a simple web UI.
12
13
14## Samples
15
16For samples check out the [AI Generated](https://isaacbythewood.com/art) section
17on the art page on my website.
18
19
20## Using ai-art
21
22This works best if you have an NVIDIA GPU however there is a fallback CPU mode
23included. I've found the CPU mode to take significantly longer than even the
24most basic of GPUs though.
25
26Install [Docker Desktop](https://www.docker.com/products/docker-desktop/) for
27your OS.
28
29
30### Quick start usage
31
32Note that this creates a new directory in your current directory called ai-art
33for all output and model storage. Make sure it's where you want it to be.
34
35    docker run -it --rm --gpus all -p 3000:3000 -v ${pwd}/ai-art:/data overshard/ai-art
36
37Once it's running you can access AI-Art in your browser at:
38
39    http://localhost:3000/
40
41
42### Development usage
43
44Get the latest version of this project from GitHub:
45
46    git clone https://github.com/overshard/ai-art.git
47
48Then run it with:
49
50    docker build --tag overshard/ai-art .
51    docker run -it --rm --gpus all -p 3000:3000 -v ${pwd}/data:/data overshard/ai-art
52
53If you are using a docker container on Windows to develop this project like I am
54then you can use something like this to mount a directory on the host system
55from your development container:
56
57    docker run -it --rm --gpus all -p 3000:3000 -v "/C/Users/Isaac Bythewood/Documents/AI-Art:/data" overshard/ai-art
58
59
60## Image sizes
61
62The larger the image the more VRAM your graphics card needs:
63
64- 6 GB of VRAM is required to generate 256x256 images.
65- 12 GB of VRAM is required to generate 512x512 images.
66- 24 GB of VRAM is required to generate 1024x1024 images.
67
68If you don't know how much VRAM your graphics card has you probably have 6 GB
69or less so stick with smaller images.
70
71That being said you can do non-square images if you want as long as you don't
72go above the number of pixels your GPU's VRAM supports, for example you could
73do ultrawide images with 6 GB of ram at "384x128" or do tall images at "128x384"
74and so on. You do not have to use numbers with a power of 2, "300x100" is also
75perfectly valid.