{ "cells": [ { "cell_type": "markdown", "id": "6247c454-ae5d-4fa2-80e5-1918ccd4d094", "metadata": {}, "source": [ "# 启智云云端部署Stable Diffusion WebUI\n", "## 永久免费白嫖A100 24G/40G/80G显卡!\n", "### 唯一项目地址:https://openi.pcl.ac.cn/2575044704/stable-diffusion-webui-v1.6.1\n", "### 唯一项目地址:https://openi.pcl.ac.cn/2575044704/stable-diffusion-webui-v1.6.1\n", "### 唯一项目地址:https://openi.pcl.ac.cn/2575044704/stable-diffusion-webui-v1.6.1\n", "### 其它项目都是盗版!坚决不要相信此云端的显卡要给租金才能用!" ] }, { "cell_type": "markdown", "id": "091be464", "metadata": {}, "source": [ "## By Nyan9 BiliBili。QQ2575044704\n", "此为20元付费脚本,未经同意禁止公开此脚本。\n", "如果要公开,请删除所有全部关键代码" ] }, { "cell_type": "markdown", "id": "48852a6e", "metadata": {}, "source": [ "# 首次使用先复制镜像(左侧目录有sd就不用按这个):" ] }, { "cell_type": "code", "execution_count": 2, "id": "0da5ecae", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "你的GPU运行状态:\n", "Tue Mar 26 21:33:25 2024 \n", "+---------------------------------------------------------------------------------------+\n", "| NVIDIA-SMI 535.54.03 Driver Version: 535.54.03 CUDA Version: 12.2 |\n", "|-----------------------------------------+----------------------+----------------------+\n", "| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |\n", "| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |\n", "| | | MIG M. |\n", "|=========================================+======================+======================|\n", "| 0 NVIDIA A100-SXM4-80GB On | 00000000:89:00.0 Off | 0 |\n", "| N/A 32C P0 64W / 400W | 4MiB / 81920MiB | 0% Default |\n", "| | | Disabled |\n", "+-----------------------------------------+----------------------+----------------------+\n", " \n", "+---------------------------------------------------------------------------------------+\n", "| Processes: |\n", "| GPU GI CI PID Type Process name GPU Memory |\n", "| ID ID Usage |\n", "|=======================================================================================|\n", "| No running processes found |\n", "+---------------------------------------------------------------------------------------+\n" ] } ], "source": [ "。" ] }, { "cell_type": "markdown", "id": "932a01c4", "metadata": {}, "source": [ "# SD启动:\n", "## 出现http//:127.0.0.1:7860后从内网穿透连接进入SD-WebUI!不是本地地址" ] }, { "cell_type": "code", "execution_count": 4, "id": "929ee5ea-15e7-48cd-8c8a-09316b75ad18", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "everyone.safetensors openi_resource.version\t模型1.3.safetensors\n", "niji.safetensors xuanliduocai.safetensors\t漫画模型.safetensors\n" ] } ], "source": [ "#先复制模型\n", "。。。。。" ] }, { "cell_type": "code", "execution_count": null, "id": "a52ebf7d", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Errno 2] No such file or directory: '/tmp/code/sd'\n", "/sd\n", "Python 3.10.9 (main, May 15 2023, 07:38:08) [GCC 11.3.0]\n", "Version: v1.7.0-1-g167206da\n", "Commit hash: 167206dafd7ea357ec3824e853f6dab024b6a338\n", "Installing requirements\n", "ControlNet init warning: Unable to install insightface automatically. Please try run `pip install insightface` manually.\n", "Launching Web UI with arguments: --ckpt-dir=/tmp/pretrainmodel --ngrok=2douOsr61tUyYwMVF3lfj9uZGoa_6FPJ2x1xhKPbL6z4euKkM --ngrok-region=ap --ad-no-huggingface --no-download-sd-model --opt-channelslast --xformers --api --no-hashing --skip-torch-cuda-test --api-auth=123:123\n", "ngrok authtoken detected, trying to connect...\n", "ngrok connected to localhost:7860! URL: https://81fc-218-17-115-213.ngrok-free.app\n", "\n", "Tag Autocomplete: Could not locate model-keyword extension, Lora trigger word completion will be limited to those added through the extra networks menu.\n", "\u001b[1m[\u001b[0m-\u001b[1m]\u001b[0m ADetailer initialized. version: \u001b[1;36m24.1\u001b[0m.\u001b[1;36m2\u001b[0m, num models: \u001b[1;36m4\u001b[0m\n", "ControlNet preprocessor location: /sd/extensions/sd-webui-controlnet/annotator/downloads\n", "2024-03-24 23:37:37,861 - ControlNet - \u001b[0;32mINFO\u001b[0m - ControlNet v1.1.441\n", "2024-03-24 23:37:38,007 - ControlNet - \u001b[0;32mINFO\u001b[0m - ControlNet v1.1.441\n", "sd-webui-prompt-all-in-one background API service started successfully.\n", "Checkpoint 131-half.safetensors [870fa2e24c] not found; loading fallback stable_diffusion_model_01/everyone.safetensors\n", "Loading weights [None] from /tmp/pretrainmodel/stable_diffusion_model_01/everyone.safetensors\n", "2024-03-24 23:37:39,868 - ControlNet - \u001b[0;32mINFO\u001b[0m - ControlNet UI callback registered.\n", "Creating model from config: /sd/configs/v1-inference.yaml\n", "Running on local URL: http://127.0.0.1:7860\n", "\n", "To create a public link, set `share=True` in `launch()`.\n", "Startup time: 28.6s (prepare environment: 12.7s, import torch: 2.9s, import gradio: 1.3s, setup paths: 1.4s, initialize shared: 0.3s, other imports: 2.0s, setup codeformer: 0.1s, load scripts: 2.7s, create ui: 2.0s, gradio launch: 2.8s, add APIs: 0.2s).\n", "Couldn't find VAE named pastel-waifu-diffusion.vae.pt; using None instead\n", "Applying attention optimization: xformers... done.\n", "Model loaded in 34.5s (load weights from disk: 1.6s, create model: 1.3s, apply weights to model: 31.1s, calculate empty prompt: 0.2s).\n" ] } ], "source": [ "# 点击这个启动SD\n", "。。。。。。。。。。。。。。。。。。。。。。。" ] }, { "cell_type": "markdown", "id": "0e0dc739", "metadata": {}, "source": [ "-------" ] }, { "cell_type": "markdown", "id": "54a6b833", "metadata": {}, "source": [ "# 下载模型,直接把模型下载地址粘贴进去\n", "# 支持的模型下载站:liblib.ai, tusiart.com, Huggingface镜像站\n", "# 不支持的:Civitai,\n", "## HUggingface镜像站:huggingface.sukaka.top\n", "## 必须先把SD停下来再执行代码!" ] }, { "cell_type": "code", "execution_count": 8, "id": "e1d736de", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/tmp/code/sd/models/Lora\n", "\u001b[35m[\u001b[0m#36562e 153MiB/162MiB\u001b[36m(94%)\u001b[0m CN:9 DL:\u001b[32m62MiB\u001b[0m\u001b[35m]\u001b[0m\u001b[0mm\n", "Download Results:\n", "gid |stat|avg speed |path/URI\n", "======+====+===========+=======================================================\n", "36562e|\u001b[1;32mOK\u001b[0m | 47MiB/s|/tmp/code/sd/models/Lora/Baiyu.safetensors\n", "\n", "Status Legend:\n", "(OK):download completed.\n", "/tmp/code\n" ] } ], "source": [ "代码呢?" ] }, { "cell_type": "code", "execution_count": 9, "id": "741c1a0c", "metadata": {}, "outputs": [], "source": [ "。。" ] }, { "cell_type": "code", "execution_count": 3, "id": "4097b906", "metadata": { "tags": [] }, "outputs": [ { "ename": "SyntaxError", "evalue": "EOL while scanning string literal (680814184.py, line 13)", "output_type": "error", "traceback": [ "\u001b[0;36m Cell \u001b[0;32mIn[3], line 13\u001b[0;36m\u001b[0m\n\u001b[0;31m \"https://gidsgdsmncvknsnkdvsnkdvsknd\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m EOL while scanning string literal\n" ] } ], "source": [ "## 安装常用插件,github如果连不上就多执行几次\n", "extensions = [\n", "\"https://github.com/Mikubill/sd-webui-controlnet\",\n", "代码被砂糖酱吃掉了!\n", " asfknaskfnf\n", " asfasv\n", "\n", "\n", "sfhkahsffhaksfa\n", "sf\n", "asf\n", "\n", "sf\n", "as\n", "f\n", "asffas\n", "saf\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "草草草草草草草草草草草草草草草草草草草" ] }, { "cell_type": "markdown", "id": "a28903ba", "metadata": {}, "source": [ "------------------" ] }, { "cell_type": "markdown", "id": "902e6634", "metadata": {}, "source": [ "# 下面代码是启动秋叶的Lora训练器:" ] }, { "cell_type": "markdown", "id": "13585ce5", "metadata": {}, "source": [ "# 1.拉取lora训练文件(首次启动)(左侧有lora文件夹就不用拉取)" ] }, { "cell_type": "code", "execution_count": 11, "id": "dcf2eeb6", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Object `(空)` not found.\n" ] }, { "ename": "NameError", "evalue": "name 'aa' is not defined", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", "Cell \u001b[0;32mIn[11], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m get_ipython()\u001b[38;5;241m.\u001b[39mrun_line_magic(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mpinfo\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m(空)\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 2\u001b[0m get_ipython()\u001b[38;5;241m.\u001b[39mshow_usage()\n\u001b[0;32m----> 3\u001b[0m \u001b[43maa\u001b[49m\n", "\u001b[0;31mNameError\u001b[0m: name 'aa' is not defined" ] } ], "source": [ "\n", "?(空)\n", "??\n", "aa" ] }, { "cell_type": "markdown", "id": "0ec71212", "metadata": {}, "source": [ "# 2. 启动Lora训练器" ] }, { "cell_type": "code", "execution_count": 5, "id": "a2b0612a", "metadata": { "tags": [] }, "outputs": [ { "ename": "SyntaxError", "evalue": "invalid character in identifier (2822435047.py, line 4)", "output_type": "error", "traceback": [ "\u001b[0;36m Cell \u001b[0;32mIn[5], line 4\u001b[0;36m\u001b[0m\n\u001b[0;31m 忘记了原来代码怎么写的??\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid character in identifier\n" ] } ], "source": [ "代码被砂糖酱吃掉了!\n" ] }, { "cell_type": "code", "execution_count": 13, "id": "db459d42-54b2-4f32-9a5a-fb9b6b681ba9", "metadata": {}, "outputs": [ { "ename": "SyntaxError", "evalue": "invalid syntax (3528668389.py, line 2)", "output_type": "error", "traceback": [ "\u001b[0;36m Cell \u001b[0;32mIn[13], line 2\u001b[0;36m\u001b[0m\n\u001b[0;31m 先从打印hello world开始\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n" ] } ], "source": [ "自学python区\n", "先从打印hello world开始" ] }, { "cell_type": "code", "execution_count": 12, "id": "5968dbc3-1a87-425e-8de6-e7c2517d66d2", "metadata": {}, "outputs": [ { "ename": "SyntaxError", "evalue": "invalid character in identifier (816423590.py, line 1)", "output_type": "error", "traceback": [ "\u001b[0;36m Cell \u001b[0;32mIn[12], line 1\u001b[0;36m\u001b[0m\n\u001b[0;31m print(hello world)\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid character in identifier\n" ] } ], "source": [ "print(hello world)" ] } ], "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.8.10" } }, "nbformat": 4, "nbformat_minor": 5 }