SVA Computational Art - Spring 22
In this course we will explore:
- AI techniques and best practices for artists
- Generative / procedural art techiques and best practices for artists
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
We won't be writing code
However, we will be running some deep learning models using iPython Notebooks (both online using Google Colab and locally Jupyter Notebooks). So you will do some basic editing like changing example file names to match the names of the files you upload.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Early-access mode unlocked
When you are comfortable running an editing Notebooks code, you will be able to test and create content using the latest and greatest AI models– without needing to wait for anyone to create a UI for you.
Class 1
Discussion
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
What are the use cases for AI in creative productions?
-
concept art
- characters
- environments
- textures
-
product design
- information architecture
- user interfaces
- code
-
mocap / rigging
- human pose estimation
- rigging and retargeting
Most popular deep learning libraries
- PyTorch (Facebook)
- Tensorflow (Google)
Workshop
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
In this workshop, we run and edit our first ML models using TensorflowHub
First, we look at MoveNet, a pose estimation model
Second, we look at Arbitrary Image Stylization, a style transfer model
Finally, we look at the web UI for Stable Diffision and watch an explainer video on how stable diffusion works
Pose Estimation
Movenet estimates 17 key joints in a human (or other biped character)
Movenet Tutorial
Movenet Google Colab
Results and Limitations
In our tests, we noticed that occlusion can hamper the model from detecting all 17 joints.
In this example, Captain America's shield prevents the model from identifying the joints in his right arm.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Style Transfer
https://colab.research.google.com/github/tensorflow/hub/blob/master/examples/colab/tf2_arbitrary_image_stylization.ipynb
Stable Diffusion
Explainer from AI Coffee Break
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Class 2
How to run Stable Diffusion Locally
Install Miniconda
-
Download Miniconda
-
Install it for Just Me
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
Change Destination Folder to a writeable folder
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Note In our lab, only the U:\
drive is writeable, so we use U:\miniconda
for the install location.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
Run Anaconda Prompt
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
create a conda environment
conda create --name art
-
Activate the environment
conda activate art
-
Install python 3.10.2
conda install python=3.10.2 -c conda-forge
-
Install Cuda Toolkit
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Warning The remaining instructions are for machines that have NVIDIA GPUs. Before installing, confirm that your machine has an NVIDIA GPU with CUDA of version 11.7 or later installed.
run this command to check the version of Cuda
nvidia-smi
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Warning If your CUDA version is less than 11.7, you will need to update your graphics drivers before continuing.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Warning If the nvidia-smi
command returns an error, your system most likely does not have a CUDA compatible NVIDIA GPU. Do not continue with the steps below. Instead, select the Conda installation options for your system on the Pytorch installation website.
If nvidia-smi
returns a CUDA Version >= 11.7, run this command to install CUDA Toolkit
conda install -c "nvidia/label/cuda-11.7.1" cuda-toolkit
-
Install Pytorch
conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c conda-forge -c nvidia
Install Stable Diffusion Web UI
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Warning Before running any of these commands, make sure your terminal has activated the conda environment named art
environment that we set up in the previous section.
Run conda activate art
if you are not sure.
-
Clone the automatic1111 repo
-
Clone the stable diffusion repo inside of the automatic1111 repo
-
Install the necessary dependencies
Use Custom Checkpoints With Stable Diffusion Web UI
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Note We can use Stable Diffusion model checkpoints that were trained and shared by other artists. In this example, we'll use a checkpoint from CivitAI
-
Find a checkpoint that produces results in your desired style.
In this example, I use https://civitai.com/models/2540/elldreths-stolendreams-mix
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
Move the checkpoint into the folder .\stable-diffusion-webui\models\Stable-diffusion\
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Run the Stable Diffusion Web UI
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Warning Before running any of these commands, make sure your terminal has activated the conda environment named art
environment that we set up in the previous section.
Run conda activate art
if you are not sure.
-
Run the python command from the stable-diffusion-webui
directory
-
Open the local URL in your browser

Stable Diffusion Workshop
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
In this workshop we run this notebook: Stable Diffusion in Google Colab
Tutorial from Chris Johnston
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
txt2img parameters

-
img2img parameters

-
tips
- Check lexica prompts (especially the end)
- Check hugging face for models
- Check civitai.com
- Check huggingface for textual inversion
Theory behind stable difffusion
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Class 3
Installing Dreambooth
Save the 1.5-pruned checkpoint from
https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt
to your directory: .\models\Stable-diffusion
Dreambooth Setup
-
Create Model
-
Settings


-
Concepts
- We use our 512x512 cropped images of our face in the
dataset directory
- We make an empty directory for the classification dataset directory (we will generate 300 images here in a later step)

- The
instance prompt
uses the rare token ohwx
and our classifier man
- The
class prompt
uses a comparible image photo of a man
- The
sample image prompt
uses our rare token combined with the class prompt photo of ohwx man

- These settings use best practices for number of images as specified by the research papers

-
Saving

-
Generate Class images

(you should see images genearating in the output tab and in the console)

(note that I am getting around 4 iterations per second)

Class 4 Posing with ControlNet
tutorial:
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Instructions for installing ControlNet
- Enable the
sd-webui-controlnet
stable diffusion extension
- Save the checkpoints from this link to the folder
stable-diffusion-webui\extensions\sd-webui-controlnet\models
Using ControlNet
- Generate an image

- Send to Img2Img
- Put in the new prompts

- Modify ControlNet settings
- Before clicking generate:
- Enable ControlNet
- Select the OpenPose Preprocessor
- Select the OpenPose Model

- You should see both the image and the detected pose generate in the output section


Class 5
Training subject and style with dreambooth
For the subject (60 images)
- 30% Headshot
- 30% Portrait
- 30% Full body
- 10% Wacky shots
For the aesthetic (105 images)
- vary characters and environments to that only the style is consistent