TheLastBen commited on
Commit
6154420
1 Parent(s): 19314ac

Create Fast-SD-A1111.ipynb

Browse files
Files changed (1) hide show
  1. Notebooks/Fast-SD-A1111.ipynb +155 -0
Notebooks/Fast-SD-A1111.ipynb ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "6441563f-5e6b-4987-abe3-2a1b8c25a789",
6
+ "metadata": {},
7
+ "source": [
8
+ "## A1111 Paperspace Notebook From https://github.com/TheLastBen/fast-stable-diffusion, if you encounter any issues, feel free to discuss them. [Support](https://ko-fi.com/thelastben)"
9
+ ]
10
+ },
11
+ {
12
+ "cell_type": "markdown",
13
+ "id": "840f2f6a-41d1-4938-a846-d51f76682b76",
14
+ "metadata": {},
15
+ "source": [
16
+ "# Dependencies"
17
+ ]
18
+ },
19
+ {
20
+ "cell_type": "code",
21
+ "execution_count": null,
22
+ "id": "62e22de7-f054-45a7-b7e3-b63b9a0188a1",
23
+ "metadata": {},
24
+ "outputs": [],
25
+ "source": [
26
+ "# Install the dependencies\n",
27
+ "\n",
28
+ "force_reinstall= False\n",
29
+ "\n",
30
+ "# Set to true only if you want to install the dependencies again.\n",
31
+ "\n",
32
+ "\n",
33
+ "#--------------------\n",
34
+ "with open('/dev/null', 'w') as devnull:import requests, time, importlib;open('/notebooks/mainpaperspaceA1111.py', 'wb').write(requests.get('https://huggingface.co/datasets/TheLastBen/PPS/raw/main/Scripts/mainpaperspaceA1111.py').content);os.chdir('/notebooks');time.sleep(3);import mainpaperspaceA1111;importlib.reload(mainpaperspaceA1111);from mainpaperspaceA1111 import *;Deps(force_reinstall)"
35
+ ]
36
+ },
37
+ {
38
+ "cell_type": "markdown",
39
+ "id": "e21f3583-2d0f-4218-9da2-303f9e202820",
40
+ "metadata": {
41
+ "tags": []
42
+ },
43
+ "source": [
44
+ "# Install/Update AUTOMATIC1111 repo"
45
+ ]
46
+ },
47
+ {
48
+ "cell_type": "code",
49
+ "execution_count": null,
50
+ "id": "ed6cebed-8a4f-4a35-b5c3-36126be008b9",
51
+ "metadata": {},
52
+ "outputs": [],
53
+ "source": [
54
+ "# Don't skip this cell to make sure the repo is up to date and functioning correctly\n",
55
+ "\n",
56
+ "#--------------------\n",
57
+ "repo()"
58
+ ]
59
+ },
60
+ {
61
+ "cell_type": "markdown",
62
+ "id": "ab0521c7-8c68-4ea2-915a-bc3f4b67f6e7",
63
+ "metadata": {},
64
+ "source": [
65
+ "## Model Download/Load"
66
+ ]
67
+ },
68
+ {
69
+ "cell_type": "code",
70
+ "execution_count": null,
71
+ "id": "a6f367e0-df08-41fd-91b5-e2afbcbd42e4",
72
+ "metadata": {},
73
+ "outputs": [],
74
+ "source": [
75
+ "Original_Model_Version = \"v1.5\"\n",
76
+ "\n",
77
+ "# Choices are \"v1.5\", \"v2-512\", \"v2-768\"\n",
78
+ "\n",
79
+ "\n",
80
+ "Path_to_MODEL = \"\"\n",
81
+ "\n",
82
+ "# Insert the full path of your trained model or to a folder containing multiple models.\n",
83
+ "\n",
84
+ "\n",
85
+ "MODEL_LINK = \"\"\n",
86
+ "\n",
87
+ "# A direct link to a Model or a shared gdrive link.\n",
88
+ "\n",
89
+ "safetensors= False\n",
90
+ "\n",
91
+ "# Set to True if the model from the link is in safetensors format.\n",
92
+ "\n",
93
+ "Temporary_Storage = True\n",
94
+ "\n",
95
+ "# Download the model to a temporary storage, bigger capacity but will be removed at session shutdown.\n",
96
+ "\n",
97
+ "\n",
98
+ "#--------------------\n",
99
+ "model=mdl(Original_Model_Version, Path_to_MODEL, MODEL_LINK, safetensors, Temporary_Storage)"
100
+ ]
101
+ },
102
+ {
103
+ "cell_type": "markdown",
104
+ "id": "e0baf0c4-a410-432f-891b-975c7250c77d",
105
+ "metadata": {},
106
+ "source": [
107
+ "## Start Stable-Diffusion"
108
+ ]
109
+ },
110
+ {
111
+ "cell_type": "code",
112
+ "execution_count": null,
113
+ "id": "0121ea1d-1aa0-4961-b916-c5dbb900e05f",
114
+ "metadata": {},
115
+ "outputs": [],
116
+ "source": [
117
+ "User = \"\"\n",
118
+ "\n",
119
+ "Password= \"\"\n",
120
+ "\n",
121
+ "# Add credentials to your Gradio interface (optional).\n",
122
+ "\n",
123
+ "Use_localtunnel = False\n",
124
+ "\n",
125
+ "# If you have trouble using Gradio server, use this one.\n",
126
+ "\n",
127
+ "\n",
128
+ "#-----------------\n",
129
+ "configf=sd(User, Password, Use_localtunnel)\n",
130
+ "!python /notebooks/sd/stable-diffusion-webui/webui.py --ckpt $model $configf"
131
+ ]
132
+ }
133
+ ],
134
+ "metadata": {
135
+ "kernelspec": {
136
+ "display_name": "Python 3 (ipykernel)",
137
+ "language": "python",
138
+ "name": "python3"
139
+ },
140
+ "language_info": {
141
+ "codemirror_mode": {
142
+ "name": "ipython",
143
+ "version": 3
144
+ },
145
+ "file_extension": ".py",
146
+ "mimetype": "text/x-python",
147
+ "name": "python",
148
+ "nbconvert_exporter": "python",
149
+ "pygments_lexer": "ipython3",
150
+ "version": "3.9.13"
151
+ }
152
+ },
153
+ "nbformat": 4,
154
+ "nbformat_minor": 5
155
+ }