zuv0 commited on
Commit
4133dee
·
verified ·
1 Parent(s): 3e6ddc8

Upload MyRP.ipynb

Browse files
Files changed (1) hide show
  1. MyRP.ipynb +175 -0
MyRP.ipynb ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": null,
6
+ "id": "d6bdd156-e441-4f7b-bd7e-d397fc335428",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "!kill -9 $(ps -ef | grep 'relauncher.py' | grep -v 'grep' | awk '{print $2}')\n",
11
+ "!kill -9 $(ps -ef | grep 'webui' | grep -v 'grep' | awk '{print $2}')\n",
12
+ "!kill -9 $(ps -ef | grep 'launch.py' | grep -v 'grep' | awk '{print $2}')\n",
13
+ "!kill -9 $(ps -ef | grep 'run.sh' | grep -v 'grep' | awk '{print $2}')\n",
14
+ "!kill -9 $(ps -ef | grep 'run.py' | grep -v 'grep' | awk '{print $2}')"
15
+ ]
16
+ },
17
+ {
18
+ "cell_type": "code",
19
+ "execution_count": null,
20
+ "id": "f34d6131-8170-4173-ac5c-f835c9fa6ea5",
21
+ "metadata": {
22
+ "scrolled": true
23
+ },
24
+ "outputs": [],
25
+ "source": [
26
+ "%cd /workspace\n",
27
+ "!sh /workspace/run.sh\n",
28
+ "#final_args = f\"python /workspace/SD/launch.py --port 7860 --api --theme dark --allow-code --enable-insecure-extension-access --listen --share --cuda-malloc --cuda-stream --pin-shared-memory\"\n",
29
+ "#!{final_args}"
30
+ ]
31
+ },
32
+ {
33
+ "cell_type": "code",
34
+ "execution_count": null,
35
+ "id": "1778d96c-dca4-4d2a-bbe6-3ee6b29fc504",
36
+ "metadata": {},
37
+ "outputs": [],
38
+ "source": []
39
+ },
40
+ {
41
+ "cell_type": "code",
42
+ "execution_count": null,
43
+ "id": "a6dc2425-7df8-4d99-80b3-312bac52019f",
44
+ "metadata": {},
45
+ "outputs": [],
46
+ "source": [
47
+ "!git -C /workspace/SD/models fetch --all\n",
48
+ "!git -C /workspace/SD/models reset --hard origin/main\n",
49
+ "!git -C /workspace/SD/models pull\n",
50
+ "!git -C /workspace/SD/models repack -a -d --depth=250 --window=250\n",
51
+ "!rsync -r \"/workspace/SD/models/embeddings/\" \"/workspace/SD/embeddings/\"\n",
52
+ "!rm -r \"/workspace/SD/models/.git/lfs\""
53
+ ]
54
+ },
55
+ {
56
+ "cell_type": "code",
57
+ "execution_count": null,
58
+ "id": "6d5e74dc-c597-4182-927b-fb506987d7ca",
59
+ "metadata": {},
60
+ "outputs": [],
61
+ "source": [
62
+ "!sh /workspace/out.sh 0"
63
+ ]
64
+ },
65
+ {
66
+ "cell_type": "code",
67
+ "execution_count": null,
68
+ "id": "23bbfe13-0ac5-4881-848b-a94008e045ff",
69
+ "metadata": {},
70
+ "outputs": [],
71
+ "source": [
72
+ "!curl -L -O https://huggingface.co/zuv0/SDXLRF11001/resolve/main/autoUpload.sh | bash -c 'sleep 1; . ./autoUpload.sh xxxx'"
73
+ ]
74
+ },
75
+ {
76
+ "cell_type": "code",
77
+ "execution_count": null,
78
+ "id": "abb78189-95bc-4d04-b897-b75ffa5ec539",
79
+ "metadata": {},
80
+ "outputs": [],
81
+ "source": [
82
+ "import os\n",
83
+ "if os.path.exists(\"/workspace/SD/output\"):\n",
84
+ " !runpodctl send /workspace/SD/output\n",
85
+ "else:\n",
86
+ " if os.path.exists(\"/workspace/output\"):\n",
87
+ " !runpodctl send /workspace/output"
88
+ ]
89
+ },
90
+ {
91
+ "cell_type": "code",
92
+ "execution_count": null,
93
+ "id": "9ebbbb83-c8ef-47d2-b038-92145196385e",
94
+ "metadata": {},
95
+ "outputs": [],
96
+ "source": []
97
+ },
98
+ {
99
+ "cell_type": "code",
100
+ "execution_count": null,
101
+ "id": "94503b7f-e460-4eda-8679-058497ae771a",
102
+ "metadata": {
103
+ "scrolled": true
104
+ },
105
+ "outputs": [],
106
+ "source": [
107
+ "%cd /workspace/SD\n",
108
+ "!curl -L -O https://huggingface.co/zuv0/SDXLF17/resolve/main/downs.sh | bash -c 'sleep 1; . ./downs.sh d3 0'"
109
+ ]
110
+ },
111
+ {
112
+ "cell_type": "code",
113
+ "execution_count": null,
114
+ "id": "645dbd2b-0f6f-4791-8b30-435649d27ed2",
115
+ "metadata": {},
116
+ "outputs": [],
117
+ "source": [
118
+ "import torch\n",
119
+ "import torchvision\n",
120
+ "print(torch.__version__)\n",
121
+ "print(torchvision.__version__)"
122
+ ]
123
+ },
124
+ {
125
+ "cell_type": "code",
126
+ "execution_count": null,
127
+ "id": "87d3aadd-7a32-4132-a1ec-0d53b75518be",
128
+ "metadata": {},
129
+ "outputs": [],
130
+ "source": []
131
+ },
132
+ {
133
+ "cell_type": "code",
134
+ "execution_count": null,
135
+ "id": "c7f291ff-c792-454e-9a20-211759f9e208",
136
+ "metadata": {},
137
+ "outputs": [],
138
+ "source": []
139
+ },
140
+ {
141
+ "cell_type": "code",
142
+ "execution_count": null,
143
+ "id": "93a28067-28c7-47eb-88ef-cb8864eee7a4",
144
+ "metadata": {},
145
+ "outputs": [],
146
+ "source": []
147
+ }
148
+ ],
149
+ "metadata": {
150
+ "kernelspec": {
151
+ "display_name": "Python 3 (ipykernel)",
152
+ "language": "python",
153
+ "name": "python3"
154
+ },
155
+ "language_info": {
156
+ "codemirror_mode": {
157
+ "name": "ipython",
158
+ "version": 3
159
+ },
160
+ "file_extension": ".py",
161
+ "mimetype": "text/x-python",
162
+ "name": "python",
163
+ "nbconvert_exporter": "python",
164
+ "pygments_lexer": "ipython3",
165
+ "version": "3.10.12"
166
+ },
167
+ "vscode": {
168
+ "interpreter": {
169
+ "hash": "c36c8ff63afb68809d72fa6323bde02fb9b90fe01b492d36c13befd021790766"
170
+ }
171
+ }
172
+ },
173
+ "nbformat": 4,
174
+ "nbformat_minor": 5
175
+ }