Upload 3 files
Browse files- easydiffusion/_main.ipynb +5 -8
- easydiffusion/_start.ipynb +4 -4
easydiffusion/_main.ipynb
CHANGED
|
@@ -31,8 +31,6 @@
|
|
| 31 |
" else:\n",
|
| 32 |
" print(\"git clone failed\")\n",
|
| 33 |
"\n",
|
| 34 |
-
"os.chdir(\"sd-ui-files\")\n",
|
| 35 |
-
"\n",
|
| 36 |
"def fix_script():\n",
|
| 37 |
" file_path = f\"{current_dir}/sd-ui-files/scripts/check_modules.py\"\n",
|
| 38 |
"\n",
|
|
@@ -55,23 +53,22 @@
|
|
| 55 |
" print(\"check_modules.py file has been repaired.\")\n",
|
| 56 |
"\n",
|
| 57 |
"fix_script()\n",
|
| 58 |
-
"\n",
|
| 59 |
"!python ./scripts/check_modules.py #安装依赖&环境\n",
|
| 60 |
-
"\n",
|
| 61 |
"\n",
|
| 62 |
"!curl -Lo /content/models/stable-diffusion/chilloutmix_NiPrunedFp32Fix-chonghui.safetensors https://huggingface.co/spaces/weo1101/111/resolve/main/chilloutmix_NiPrunedFp32Fix-inpainting.inpainting.safetensors\n",
|
| 63 |
"!curl -Lo /content/models/stable-diffusion/chilloutmix_NiPrunedFp32Fix.safetensors https://huggingface.co/spaces/weo1101/111/resolve/main/chilloutmix_NiPrunedFp32Fix-inpainting.inpainting.safetensors\n",
|
| 64 |
"\n",
|
| 65 |
-
"!curl -Lo content/apply_func.py https://github.com/Van-wise/sd-colab/raw/main/easydiffusion/apply_func.py\n",
|
| 66 |
-
"!rm -rf /usr/local/lib/python3.10/dist-packages/pytorch_lightning/utilities/apply_func.py\n",
|
| 67 |
-
"!cp /content/apply_func.py /usr/local/lib/python3.10/dist-packages/pytorch_lightning/utilities/apply_func.py\n",
|
| 68 |
"\n",
|
| 69 |
"from pathlib import Path\n",
|
| 70 |
"os.environ[\"SD_UI_PATH\"] = str(Path(Path.cwd(), \"ui\"))\n",
|
| 71 |
"os.environ[\"INSTALL_ENV_DIR\"] = \"/usr/local\"\n",
|
| 72 |
"print(str(Path(Path.cwd(), \"ui\")))\n",
|
| 73 |
"\n",
|
| 74 |
-
"os.chdir(\"sd-ui-files\")\n",
|
| 75 |
"!python ./scripts/check_modules.py --launch-uvicorn"
|
| 76 |
]
|
| 77 |
}
|
|
|
|
| 31 |
" else:\n",
|
| 32 |
" print(\"git clone failed\")\n",
|
| 33 |
"\n",
|
|
|
|
|
|
|
| 34 |
"def fix_script():\n",
|
| 35 |
" file_path = f\"{current_dir}/sd-ui-files/scripts/check_modules.py\"\n",
|
| 36 |
"\n",
|
|
|
|
| 53 |
" print(\"check_modules.py file has been repaired.\")\n",
|
| 54 |
"\n",
|
| 55 |
"fix_script()\n",
|
| 56 |
+
"os.chdir(\"sd-ui-files\")\n",
|
| 57 |
"!python ./scripts/check_modules.py #安装依赖&环境\n",
|
| 58 |
+
"!pip install --upgrade pytorch-lightning\n",
|
| 59 |
"\n",
|
| 60 |
"!curl -Lo /content/models/stable-diffusion/chilloutmix_NiPrunedFp32Fix-chonghui.safetensors https://huggingface.co/spaces/weo1101/111/resolve/main/chilloutmix_NiPrunedFp32Fix-inpainting.inpainting.safetensors\n",
|
| 61 |
"!curl -Lo /content/models/stable-diffusion/chilloutmix_NiPrunedFp32Fix.safetensors https://huggingface.co/spaces/weo1101/111/resolve/main/chilloutmix_NiPrunedFp32Fix-inpainting.inpainting.safetensors\n",
|
| 62 |
"\n",
|
| 63 |
+
"# !curl -Lo content/apply_func.py https://github.com/Van-wise/sd-colab/raw/main/easydiffusion/apply_func.py\n",
|
| 64 |
+
"# !rm -rf /usr/local/lib/python3.10/dist-packages/pytorch_lightning/utilities/apply_func.py\n",
|
| 65 |
+
"# !cp /content/apply_func.py /usr/local/lib/python3.10/dist-packages/pytorch_lightning/utilities/apply_func.py\n",
|
| 66 |
"\n",
|
| 67 |
"from pathlib import Path\n",
|
| 68 |
"os.environ[\"SD_UI_PATH\"] = str(Path(Path.cwd(), \"ui\"))\n",
|
| 69 |
"os.environ[\"INSTALL_ENV_DIR\"] = \"/usr/local\"\n",
|
| 70 |
"print(str(Path(Path.cwd(), \"ui\")))\n",
|
| 71 |
"\n",
|
|
|
|
| 72 |
"!python ./scripts/check_modules.py --launch-uvicorn"
|
| 73 |
]
|
| 74 |
}
|
easydiffusion/_start.ipynb
CHANGED
|
@@ -11,15 +11,16 @@
|
|
| 11 |
"import os\n",
|
| 12 |
"if not os.path.exists('/content/key/id_rsa'):\n",
|
| 13 |
" !mkdir -p /content/key/id_rsa\n",
|
| 14 |
-
" !
|
| 15 |
-
" !
|
|
|
|
| 16 |
"\n",
|
| 17 |
"def tunnel():\n",
|
| 18 |
" time.sleep(1)\n",
|
| 19 |
" from pyngrok import ngrok\n",
|
| 20 |
" ngrok_tunnel = ngrok.connect(9000, \"http\")\n",
|
| 21 |
" from pycloudflared import try_cloudflare\n",
|
| 22 |
-
" cloudflare_url = try_cloudflare(9000
|
| 23 |
" print(ngrok_tunnel)\n",
|
| 24 |
" print(cloudflare_url)\n",
|
| 25 |
" time.sleep(1)\n",
|
|
@@ -27,7 +28,6 @@
|
|
| 27 |
"\n",
|
| 28 |
"threading.Thread(target=tunnel, daemon=True).start()\n",
|
| 29 |
"\n",
|
| 30 |
-
"os.chdir(\"sd-ui-files\")\n",
|
| 31 |
"!python ./scripts/check_modules.py --launch-uvicorn\n",
|
| 32 |
"#!python ./scripts//ui/main.py"
|
| 33 |
]
|
|
|
|
| 11 |
"import os\n",
|
| 12 |
"if not os.path.exists('/content/key/id_rsa'):\n",
|
| 13 |
" !mkdir -p /content/key/id_rsa\n",
|
| 14 |
+
" !ssh-keygen -t rsa -b 4096 -N \"\" -f /content/key/id_rsa -y\n",
|
| 15 |
+
" !chmod 644 /content/key/id_rsa\n",
|
| 16 |
+
" !chmod 644 /content/key/id_rsa.pub\n",
|
| 17 |
"\n",
|
| 18 |
"def tunnel():\n",
|
| 19 |
" time.sleep(1)\n",
|
| 20 |
" from pyngrok import ngrok\n",
|
| 21 |
" ngrok_tunnel = ngrok.connect(9000, \"http\")\n",
|
| 22 |
" from pycloudflared import try_cloudflare\n",
|
| 23 |
+
" cloudflare_url = try_cloudflare(9000)\n",
|
| 24 |
" print(ngrok_tunnel)\n",
|
| 25 |
" print(cloudflare_url)\n",
|
| 26 |
" time.sleep(1)\n",
|
|
|
|
| 28 |
"\n",
|
| 29 |
"threading.Thread(target=tunnel, daemon=True).start()\n",
|
| 30 |
"\n",
|
|
|
|
| 31 |
"!python ./scripts/check_modules.py --launch-uvicorn\n",
|
| 32 |
"#!python ./scripts//ui/main.py"
|
| 33 |
]
|