wyquek
(Qbiwan)
October 14, 2022, 1:43pm
40
it’s possible to run all cells at one go on Nvidia 1080 8G with some minor modifications to the nb, mostly consisting of splitting up some large cells into smaller ones
{
"cells": [
{
"cell_type": "markdown",
"id": "5dcb2f23-7bcb-42d6-ae00-c336222dcd93",
"metadata": {},
"source": [
"# Stable Diffusion Deep Dive\n",
"\n",
"Stable Diffusion is a powerful text-to-image model. There are various websites and tools to make using it as easy as possible. It is also [integrated into the Huggingface diffusers library](https://huggingface.co/blog/stable_diffusion) where generating images can be as simple as:\n",
"```python\n",
"from diffusers import StableDiffusionPipeline\n",
"pipe = StableDiffusionPipeline.from_pretrained(\"CompVis/stable-diffusion-v1-4\", revision=\"fp16\", torch_dtype=torch.float16, use_auth_token=True).to(\"cuda\")\n",
"image = pipe(\"An astronaught scuba diving\").images[0]\n",
"\n",
"```\n",
"\n",
"In this notebook we're going to dig into the code behind these easy-to-use interfaces, to see what is going on under the hood. We'll begin by re-creating the functionality above as a scary chunk of code, and then one by one we'll inspect the different components and figure out what they do. By the end of this notebook that same sampling loop should feel like something you can tweak and modify as you like. "
]
},
This file has been truncated. show original
Also, the smaller images look better if you use landscape height=256
and width=512
4 Likes