{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "b069b7cc-a1cd-4fdb-98e4-082a5956855a", "metadata": { "tags": [] }, "outputs": [], "source": [ "!conda install -c conda-forge libglib -y & conda update -n base conda -y" ] }, { "cell_type": "code", "execution_count": null, "id": "917ba6c9-68bd-4fd2-957c-2ad70543b191", "metadata": { "tags": [] }, "outputs": [], "source": [ "#%cd ~/sagemaker-studiolab-notebooks/\n", "!git clone --depth 1 https://github.com/AUTOMATIC1111/stable-diffusion-webui\n", "%cd ~/stable-diffusion-webui\n", "!git pull\n", "\n", "# change default settings (not necessary)\n", "%cd stable-diffusion-webui\n", "!wget https://raw.githubusercontent.com/Miraculix200/StableDiffusionUI_Colab/main/config.json\n", "!wget https://raw.githubusercontent.com/Miraculix200/StableDiffusionUI_Colab/main/ui-config.json\n", "\n", "#create softlinks for tmp outputs and models\n", "!mkdir stable-diffusion-webui/outputs\n", "!ln -vs /tmp/outputs stable-diffusion-webui/outputs\n", "!ln -vs /tmp/models stable-diffusion-webui/models/Stable-diffusion\n", "\n", "# install extensions\n", "%cd extensions\n", "!git clone --depth 1 https://github.com/etherealxx/batchlinks-webui\n" ] }, { "cell_type": "code", "execution_count": null, "id": "1755de1e-c408-44ab-a557-e6586dfb4703", "metadata": { "tags": [] }, "outputs": [], "source": [ "#load your checkpoints\n", "!curl -Lo \"/home/studio-lab-user/stable-diffusion-webui/models/Stable-diffusion/epicphotogasm.safetensors\" \"https://civitai.com/api/download/models/145885\"" ] }, { "cell_type": "code", "execution_count": null, "id": "d843b45c-4c63-4bc7-9493-4c9d0d5437a3", "metadata": { "tags": [] }, "outputs": [], "source": [ "#Check the storage available\n", "!df -h | grep -E 'Avail|home'" ] }, { "cell_type": "code", "execution_count": null, "id": "9ea3ea45-056c-4863-a06a-3f7422bf7e20", "metadata": { "tags": [] }, "outputs": [], "source": [ "#Replace your NGROK token here\n", "%cd ~/stable-diffusion-webui\n", "!python launch.py --listen --xformers --enable-insecure-extension-access --theme dark --gradio-queue --ngrok REPLACE_HERE_YOUR_TOKEN" ] }, { "cell_type": "code", "execution_count": null, "id": "431e173d-fd18-4552-befe-5f60b50bde19", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "25badd98-2ca1-407d-b48b-f68caa49a543", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "5ebb6eb5-d993-4ad0-aa71-cecdef270c15", "metadata": {}, "outputs": [], "source": [ "BELOW ONLY FOR TROUBLESHOOTING" ] }, { "cell_type": "code", "execution_count": null, "id": "38f3b678-ce14-47c8-b8ca-5b2295fc628c", "metadata": {}, "outputs": [], "source": [ "%cd ~/stable-diffusion-webui\n", "!pip install -r requirements.txt" ] }, { "cell_type": "code", "execution_count": null, "id": "6c7131fd-9ce7-4c3c-861c-a3acc252c086", "metadata": { "tags": [] }, "outputs": [], "source": [ "%cd ~/stable-diffusion-webui\n", "!python launch.py --listen --xformers --enable-insecure-extension-access --theme dark --ngrok auth" ] }, { "cell_type": "code", "execution_count": null, "id": "5bb61644-e972-402e-aff6-c6445ff99965", "metadata": { "tags": [] }, "outputs": [], "source": [ "import torch\n", "torch.cuda.get_device_name(0)" ] }, { "cell_type": "code", "execution_count": null, "id": "d6a8c055-4668-40cd-aa41-8bc6474c9ff0", "metadata": { "tags": [] }, "outputs": [], "source": [ "import torch\n", "print(torch.version.cuda)" ] }, { "cell_type": "code", "execution_count": null, "id": "6b3f9867-000e-43f4-9b04-ae5c0d9166bd", "metadata": { "tags": [] }, "outputs": [], "source": [ "!pip uninstall torchvision -y" ] }, { "cell_type": "code", "execution_count": null, "id": "2d990595-7f34-4946-9a21-197306222434", "metadata": { "tags": [] }, "outputs": [], "source": [ "!pip install torchvision==0.10.0" ] }, { "cell_type": "code", "execution_count": null, "id": "5b85fa10-c03f-4942-a227-02d1cbe90f4a", "metadata": { "tags": [] }, "outputs": [], "source": [ "!pip install torch==1.10.0" ] }, { "cell_type": "code", "execution_count": null, "id": "abc7178a-c5b7-4722-8e9e-728308d83d70", "metadata": { "tags": [] }, "outputs": [], "source": [ "!pip install xformers==0.0.20 tomesd==0.1.3 pytorch-lightning==1.9.4 accelerate==0.21.0" ] }, { "cell_type": "code", "execution_count": null, "id": "577b9843-0e8c-4dd8-aa02-8eaf8c51f1d8", "metadata": { "tags": [] }, "outputs": [], "source": [ "!conda install -c conda-forge libglib -y" ] }, { "cell_type": "code", "execution_count": null, "id": "f24321a3-700a-47e9-8995-0893dd2f834f", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "default:Python", "language": "python", "name": "conda-env-default-py" }, "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.16" } }, "nbformat": 4, "nbformat_minor": 5 }