{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "65dbc5f6-5523-4c34-b3b6-c296e06a357c", "metadata": { "scrolled": true, "tags": [] }, "outputs": [], "source": [ "# Download and run the Anaconda3 installer\n", "import sys\n", "%cd /notebooks/\n", "!wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh\n", "!bash ./Miniconda3-latest-Linux-x86_64.sh -b -f -p /usr/local # Sorry, but it MUST be installed in /usr/local\n", "sys.path.append('/usr/local/lib/python3.7/site-packages/')\n", "!rm Miniconda3-latest-Linux-x86_64.sh" ] }, { "cell_type": "code", "execution_count": null, "id": "7a33c19e-fd40-4f72-80df-697024e50964", "metadata": { "tags": [] }, "outputs": [], "source": [ "# 1. Run this cell to download the repo installer\n", "# 2. Do `/notebooks/linux-sd.sh` in the terminal to run the installer\n", "# 3. The installer will initalize and then prompt you to download the 1.4 AI Model from Huggingface.\n", "# At this point, run the next cell then continue the installer (press enter in the terminal you're running the script it).\n", "!wget https://raw.githubusercontent.com/JoshuaKimsey/Linux-StableDiffusion-Script/main/linux-sd.sh\n", "!chmod +x /notebooks/linux-sd.sh\n", "!echo \"/notebooks/linux-sd.sh\"" ] }, { "cell_type": "code", "execution_count": null, "id": "11ede4f9-3b47-47df-b0e2-e04c9287e62e", "metadata": { "tags": [] }, "outputs": [], "source": [ "# Download the 1.4 AI Model from Huggingface.\n", "import os\n", "if os.path.exists('Models'): # if this dir doesn't exist, you need to run the linux-sd.sh script and FOLLOW DIRECTIONS!!\n", " user_token = \"\"\n", " user_header = f\"'Authorization: Bearer {user_token}'\"\n", " !wget --header={user_header} https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt -O /notebooks/Models/sd-v1-4.ckpt" ] }, { "cell_type": "code", "execution_count": null, "id": "60c0784c-cf85-4ec9-a333-a2dbe6b428e0", "metadata": {}, "outputs": [], "source": [ "# The installer will do everything needed set up your environment and will start it when finished" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.13" } }, "nbformat": 4, "nbformat_minor": 5 }