Upload lite-start.ipynb
Browse files- lite-start.ipynb +1 -1
lite-start.ipynb
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"cells":[{"cell_type":"markdown","metadata":{},"source":["# NovelAi stable-diffusion-webui+api+sdxl\n","---\n","**version: 1.6.0 • python: 3.10.6 • torch: 2.0.1+cu118 • xformers: 0.0.21 • gradio: 3.41.2**\n","- 发布地址 [kaggle stable-diffusion-webui-novelai](https://www.kaggle.com/code/yiyiooo/stable-diffusion-webui-novelai)\n","- 这是一个用于快速体验ai绘画项目 [stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) 的笔记本,你可以直接启动就能在线体验ai绘图的乐趣。 \n","- kaggle和colab都是AI学习平台,请勿浪费计算资源,如果有需求,可以考虑AutoDL这类租用显卡的平台或者colab付费使用。\n","- 在保持可以免配置直接启动的情况下也提供了很多可自定义的配置,在下方的配置项里,请自行查看。 \n","- 同时也为新人提供了一份基础的帮助文档,包含了一些使用中可能遇到的问题,如果使用过程中有什么疑问,不妨先看看帮助文档。\n","- 如果你需要在此脚本上修改再发布,请随意,但请遵守相关法律法规,文明使用。\n","- 使用时如果遇到问题,尽可能通过帮助文档或者参考已有内容尝试自己解决。\n","- Q群 [816545732](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=OGQydingTPku9M_myV_cscWv6MVaCSde&authKey=RFadQ18FgReFkx7CRs8SNk4vHpxHz%2FD2ojHL3433MehuQOBlnG0hhWFIo8AX%2BFRU&noverify=0&group_code=816545732) ,这是我建的新群,如果有需要,可以进群,其实这个笔记已经非常简洁了,进群大概也不会有啥帮助。\n","- 使用前可以看一下最后的更新日志,可能有功能更新需要注意"]},{"cell_type":"markdown","metadata":{},"source":["## 重要文件列表\n","\n","- **这个列表仅加载一次 且会等待加载完成再开始安装sd**\n","- ```[]```内的是下载文件的目标目录,可以是相对目录也可以是觉得路径\n","- ```[]```的下一行就是文件列表,可以是下载地址、git仓库、文件路径、文件夹路径,且支持通配符\n","- 如果需要对下载的文件重命名,可以在下载链接前面写上文件名后加一个```:```分开文件名和下载地址\n","- 如果需要下载到其他目录,可以使用同样的格式写其他目录"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["before_downloading = '''# 这个列表仅加载一次 且会等待加载完成再开始安装sd\n","[extensions] # 插件\n","https://github.com/dtlnor/stable-diffusion-webui-localization-zh_CN.git\n","https://github.com/AlUlkesh/stable-diffusion-webui-images-browser.git\n","https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git\n","https://github.com/Mikubill/sd-webui-controlnet.git\n","https://github.com/LianZiZhou/sd-webui-pixink-console.git\n","https://github.com/ilian6806/stable-diffusion-webui-state.git\n","https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111.git\n","https://github.com/Bing-su/adetailer.git\n","https://github.com/civitai/sd_civitai_extension.git\n","https://github.com/zanllp/sd-webui-infinite-image-browsing.git\n","https://github.com/viyiviyi/stable-diffusion-webui-zoomimage.git\n","https://github.com/viyiviyi/prompts-filter.git\n","https://github.com/viyiviyi/sd-encrypt-image.git # 图片加密插件,解决涩图封号问题,需要在参数里设置你的密码开启\n","\n","# 如果你有模型文件需要在启动前加载,可以写在这个下面对应位置\n","\n","[models/Stable-diffusion] # 大模型列表\n","\n","[models/hypernetworks] # hypernetworks文件列表\n","\n","[models/embeddings] # embeddings文件列表\n","\n","[models/Lora] # Lora文件列表\n","\n","[models/VAE] # VAE文件列表\n","\n","[extensions/sd-webui-controlnet/models] # controlnet插件的模型列表\n","\n","'''"]},{"cell_type":"markdown","metadata":{},"source":["## 普通文件列表\n","\n","- **这个列表仅加载一次 且不会等待加载完成**\n","- ```[]```内的是下载文件的目标目录,可以是相对目录也可以是觉得路径\n","- ```[]```的下一行就是文件列表,可以是下载地址、git仓库、文件路径、文件夹路径,且支持通配符\n","- 如果需要对下载的文件重命名,可以在下载链接前面写上文件名后加一个```:```分开文件名和下载地址\n","- 如果需要下载到其他目录,可以使用同样的格式写其他目录"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["async_downloading='''# 这个列表仅加载一次 且不会等待加载完成\n","[extensions] # 插件 如果你没有使用ngrok或者frpc,请不要把插件放在这里加载,因为这里的文件可能在webui启动后才加载完成\n","\n","[models/Stable-diffusion] # 大模型列表\n","https://huggingface.co/viyi/testing_models/resolve/main/mg-LBG.safetensors\n","容华_国风_SDXL.safetensors:https://civitai.com/api/download/models/151978\n","\n","[models/hypernetworks] # hypernetworks文件列表\n","\n","[models/embeddings] # embeddings文件列表\n","\n","[models/Lora] # Lora文件列表\n","Genshin_Impact_all-in-one.safetensors:https://civitai.com/api/download/models/116970\n","https://civitai.com/api/download/models/117151 # Clothing +/- Adjuster 衣物增/减 LoRA\n","https://civitai.com/api/download/models/62833 # Detail Tweaker LoRA (细节调整LoRA)\n","https://civitai.com/api/download/models/127786 # Crop top collection - Sexy Clothing\n","https://civitai.com/api/download/models/120452 # anxiang | 暗香\n","https://civitai.com/api/download/models/121410 # Crop Shirt + Underboob (anime+realistic) | Goofy Ai\n","https://civitai.com/api/download/models/109412 # Micro Slingshot Swimsuit + Pubic Hair / Outfit 细绳比基尼\n","https://civitai.com/api/download/models/118273 # Bukkake / excessive cum\n","https://civitai.com/api/download/models/120242 # Microskirt 迷你裙\n","https://civitai.com/api/download/models/108698 # Projectile cum\n","https://civitai.com/api/download/models/126732 # Naked towel\n","https://civitai.com/api/download/models/124181 # POV Group Sex | Sex with multiple girls\n","https://civitai.com/api/download/models/106979 # Cuddling handjob :1girl, cuddling handjob, 1boy, penis\n","https://civitai.com/api/download/models/119559 # Undressing panties:undressing, panty pull\n","https://civitai.com/api/download/models/122473 # Slingshot swimsuit (Wedgie+Pubic hair)\n","https://civitai.com/api/download/models/124402 # clear swimsuit:nsfw, see-through, swimsuit, clearswimsuit\n","https://civitai.com/api/download/models/123250 # transparent bunny suit:nsfw, see-through leotard, playboy bunny, see-through, transpbunny\n","https://civitai.com/api/download/models/111550 # 【Concept】Pillory 概念-枷具jiaju\n","https://civitai.com/api/download/models/126627 # Wooden horse / bdsm :wooden horse, crotch rub\n","https://civitai.com/api/download/models/124749 # Cropped Hoodie Underboob (Anime +Realistic) | Goofy Ai\n","https://civitai.com/api/download/models/112969 # LEOSAM's FilmGirl 胶片风 Film Grain LoRA & LoHA\n","https://civitai.com/api/download/models/116611 # Modern victorian fashion dress | 洛丽塔裙子\n","https://civitai.com/api/download/models/94254 # Muggle Lora】落地窗_法式大窗户 :largewindow\n","\n","[models/VAE] # VAE文件列表\n","{input_path}/vae-ft-ema-prunedsafetensors/vae-ft-ema-560000-ema-pruned.safetensors\n","{input_path}/vae-ft-ema-prunedsafetensors/vae-ft-mse-840000-ema-pruned.safetensors\n","https://huggingface.co/stabilityai/sd-vae-ft-ema-original/resolve/main/vae-ft-ema-560000-ema-pruned.safetensors\n","https://huggingface.co/WarriorMama777/OrangeMixs/resolve/main/VAEs/orangemix.vae.pt\n","sdxl_vae.safetensors:https://civitai.com/api/download/models/130720?type=VAE # sdxl模型需要sdxl的vae\n","\n","[extensions/sd-webui-controlnet/models] # controlnet插件的模型列表\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11e_sd15_ip2p_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11e_sd15_shuffle_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11f1e_sd15_tile_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11f1p_sd15_depth_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_canny_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_inpaint_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_lineart_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_mlsd_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_normalbae_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_openpose_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_scribble_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_seg_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_softedge_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15s2_lineart_anime_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11u_sd15_tile_fp16.safetensors\n","'''\n"]},{"cell_type":"markdown","metadata":{},"source":["## 按顺序加载的重要文件列表\n","\n","- **这个列表每次 run all 启动都会加载一次,且一定按照顺序加载后才启动webui**\n","- ```[]```内的是下载文件的目标目录,可以是相对目录也可以是觉得路径\n","- ```[]```的下一行就是文件列表,可以是下载地址、git仓库、文件路径、文件夹路径,且支持通配符\n","- 如果需要对下载的文件重命名,可以在下载链接前面写上文件名后加一个```:```分开文件名和下载地址\n","- 如果需要下载到其他目录,可以使用同样的格式写其他目录"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["before_start_sync_downloading = ''' # 这个列表每次 run all 启动都会加载一次,且一定按照顺序加载\n","\n","# 如果你需要每次启动都加载一下文件,可以写在这。(比如测试路径是否正确的时候)\n","\n","[models/Stable-diffusion] # 大模型列表\n","\n","[models/hypernetworks] # hypernetworks文件列表\n","\n","[models/embeddings] # embeddings文件列表\n","\n","[models/Lora] # Lora文件列表\n","\n","[models/VAE] # VAE文件列表\n","\n","[extensions/sd-webui-controlnet/models] # controlnet插件的模型列表\n","\n","'''"]},{"cell_type":"markdown","metadata":{},"source":["## webui 启动参数\n","- 所有的参数都会在启动时传入\n","- 可以在前面加```#```来屏蔽某个参数\n","- 端口参数需要在下一个代码块的```webuiPort```处修改"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["sd_start_args='''\n","# --ckpt=mg-Tender.safetensors # 默认模型名称,路径不能包含空格\n","--disable-safe-unpickle \n","--deepdanbooru \n","--no-hashing \n","--no-download-sd-model \n","--administrator\n","--skip-torch-cuda-test \n","--skip-version-check \n","--disable-nan-check\n","# --opt-sdp-attention \n","--opt-sdp-no-mem-attention \n","--xformers-flash-attention\n","--xformers\n","--api \n","--listen\n","--lowram\n","#--no-gradio-queue\n","--encrypt-pass=123qwe # 图片加密插件的密码,如果要启用图片加密插件,删除这一行前面的#和将123qwe改成你的密码,也可以不改\n","# --share # 默认的内网穿透在kaggle和colab都已经不可用,请考虑其他方案\n","--disable-console-progressbars\n","--no-half-vae \n","# --no-half #关闭半精度\n","# --enable-console-prompts\n","# --nowebui # 如果只需要api服务,可以开启这个\n","# --api-auth=2333:6666 # api密码\n","# --gradio-auth=2333:6666 # webui密码\n","'''"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["useGooglrDrive = True # 连接到谷歌云盘 在google colab环境才会生效\n","#Ngrok\n","useNgrok=True # 非必填 是否使用ngrok作为公网访问地址\n","#Frpc\n","useFrpc=True # 开启frp将不能启动\n","\n","#可以填写文件路径 或 直接填 token 内容\n","ngrok_config_or_file = '''\n","{input_path}/configs/ngrok_token.txt\n","'''\n","frp_config_or_file = '''\n","{input_path}/configs/frpc_koishi.ini\n","'''\n","frp_ssl_dir = '''\n","{input_path}/configs/koishi_ssl\n","'''\n","\n","# 配置启动参数\n","server_port=7860 # webui 默认端口\n","\n","# 仓库地址 这是修改过界面布局顺序的webui,不定期同步到官方版本\n","# 如果要使用官方版本,改成这个: https://github.com/AUTOMATIC1111/stable-diffusion-webui\n","sd_git_repo='https://github.com/viyiviyi/stable-diffusion-webui.git -b local' \n","# 配置文件,包括webui的设置和UI默认值,如果要自定义,fork这个仓库后修改并把地址替换这个地址\n","sd_config_git_repu = 'https://github.com/viyiviyi/sd-configs.git'\n","# 设置文件保存路径 当使用谷歌云盘时非常有用\n","setting_file = '{output_path}/configs/config.json'\n","ui_config_file = '{output_path}/configs/ui-config.json'\n","\n","# 这是配置文件夹同步的相关配置\n","# 需要在huggingface创建一个数据集(datasets) 然后把数据集的名称(在页面上有复制的按钮)填到 huggingface_repo \n","# 需要获取 token 填到 huggingface_token 获取的地址是: https://huggingface.co/settings/tokens\n","huggingface_token = '{input_path}/configs/huggingface_token.txt'\n","huggingface_repo = 'viyi/sdwui-log'\n","\n","multi_case = True"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["link_instead_of_copy = True # 下载或加载Input的文件时是使用链接还是复制的方式加载到目标目录\n","hidden_console_info = True # 是否隐藏大部分的控制台内容"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["# 保存当前目录和启动时cd到之前保存的目录,可以减少sdwui-start-new.ipynb文件下载次数\n","import os\n","INIT_WORK_PATH = os.environ['HOME']\n","if os.getenv('INIT_WORK_PATH',''):\n"," INIT_WORK_PATH = os.getenv('INIT_WORK_PATH','')\n","else:\n"," os.environ['INIT_WORK_PATH'] = os.getcwd()\n","%cd {INIT_WORK_PATH}"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["reLoad = True\n","# 如果需要重新安装,请注释下面这一行\n","reLoad = False"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["if not os.path.exists('sdwui-start-util.ipynb'):\n"," !wget https://huggingface.co/viyi/sdwui/resolve/main/sdwui-start-util.ipynb -o log.log\n","%run sdwui-start-util.ipynb"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["try:\n"," check_gpu() # 检查是否存在gpu\n"," main()\n","except KeyboardInterrupt:\n"," stop_solo_threads() # 中断后自动停止后台线程 (有部分功能在后台线程中运行)"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["# 打包收藏文件夹 如果需要可以取消下面两行的注释\n","# zipPath('$install_path/sd_main_dir/log','log')\n","# !mv {output_path}/log.tar {output_path}/log.tar.bak\n","# createOrUpdateDataSet(f'{output_path}/log.tar.bak','sd-webui-log-bak')\n","\n","# 打包 这一行的结果是 压缩一个目录,并放在 output_path: /kaggle/working/ 目录下 名字是训练输出.tar\n","# zipPath('$install_path/sd_main_dir/textual_inversion','训练输出') \n","# zipPath('$install_path/sd_main_dir/outputs','outputs')\n","\n","# 打包venv并上传到数据集\n","# zipPath('$install_path/sd_main_dir/venv','venv')\n","# !mv {output_path}/venv.tar /kaggle/working/venv.tar.bak\n","# createOrUpdateDataSet('/kaggle/working/venv.tar.bak','sd-webui-venv')\n","\n","# 打包命令参考,--exclude 可以排除不需要打包的目录\n","# !tar -cf $output_path/webui.tar.bak --exclude=venv --exclude=extensions -C /sd_main_dir/ ."]}],"metadata":{"kernelspec":{"display_name":"Python 3","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.10.7"}},"nbformat":4,"nbformat_minor":4}
|
|
|
1 |
+
{"cells":[{"cell_type":"markdown","metadata":{},"source":["# NovelAi stable-diffusion-webui+api+sdxl\n","---\n","**version: 1.6.0 • python: 3.10.6 • torch: 2.0.1+cu118 • xformers: 0.0.21 • gradio: 3.41.2**\n","- 发布地址 [kaggle stable-diffusion-webui-novelai](https://www.kaggle.com/code/yiyiooo/stable-diffusion-webui-novelai)\n","- 这是一个用于快速体验ai绘画项目 [stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) 的笔记本,你可以直接启动就能在线体验ai绘图的乐趣。 \n","- kaggle和colab都是AI学习平台,请勿浪费计算资源,如果有需求,可以考虑AutoDL这类租用显卡的平台或者colab付费使用。\n","- 在保持可以免配置直接启动的情况下也提供了很多可自定义的配置,在下方的配置项里,请自行查看。 \n","- 同时也为新人提供了一份基础的帮助文档,包含了一些使用中可能遇到的问题,如果使用过程中有什么疑问,不妨先看看帮助文档。\n","- 如果你需要在此脚本上修改再发布,请随意,但请遵守相关法律法规,文明使用。\n","- 使用时如果遇到问题,尽可能通过帮助文档或者参考已有内容尝试自己解决。\n","- Q群 [816545732](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=OGQydingTPku9M_myV_cscWv6MVaCSde&authKey=RFadQ18FgReFkx7CRs8SNk4vHpxHz%2FD2ojHL3433MehuQOBlnG0hhWFIo8AX%2BFRU&noverify=0&group_code=816545732) ,这是我建的新群,如果有需要,可以进群,其实这个笔记已经非常简洁了,进群大概也不会有啥帮助。\n","- 使用前可以看一下最后的更新日志,可能有功能更新需要注意"]},{"cell_type":"markdown","metadata":{},"source":["## 重要文件列表\n","\n","- **这个列表仅加载一次 且会等待加载完成再开始安装sd**\n","- ```[]```内的是下载文件的目标目录,可以是相对目录也可以是觉得路径\n","- ```[]```的下一行就是文件列表,可以是下载地址、git仓库、文件路径、文件夹路径,且支持通配符\n","- 如果需要对下载的文件重命名,可以在下载链接前面写上文件名后加一个```:```分开文件名和下载地址\n","- 如果需要下载到其他目录,可以使用同样的格式写其他目录"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["before_downloading = '''# 这个列表仅加载一次 且会等待加载完成再开始安装sd\n","[extensions] # 插件\n","https://github.com/dtlnor/stable-diffusion-webui-localization-zh_CN.git\n","https://github.com/AlUlkesh/stable-diffusion-webui-images-browser.git\n","https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git\n","https://github.com/Mikubill/sd-webui-controlnet.git\n","https://github.com/ilian6806/stable-diffusion-webui-state.git\n","https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111.git\n","https://github.com/Bing-su/adetailer.git\n","https://github.com/zanllp/sd-webui-infinite-image-browsing.git\n","https://github.com/viyiviyi/stable-diffusion-webui-zoomimage.git\n","https://github.com/viyiviyi/prompts-filter.git\n","https://github.com/viyiviyi/sd-encrypt-image.git # 图片加密插件,解决涩图封号问题,需要在参数里设置你的密码开启\n","\n","# 如果你有模型文件需要在启动前加载,可以写在这个下面对应位置\n","\n","[models/Stable-diffusion] # 大模型列表\n","\n","[models/hypernetworks] # hypernetworks文件列表\n","\n","[models/embeddings] # embeddings文件列表\n","\n","[models/Lora] # Lora文件列表\n","\n","[models/VAE] # VAE文件列表\n","\n","[extensions/sd-webui-controlnet/models] # controlnet插件的模型列表\n","\n","'''"]},{"cell_type":"markdown","metadata":{},"source":["## 普通文件列表\n","\n","- **这个列表仅加载一次 且不会等待加载完成**\n","- ```[]```内的是下载文件的目标目录,可以是相对目录也可以是觉得路径\n","- ```[]```的下一行就是文件列表,可以是下载地址、git仓库、文件路径、文件夹路径,且支持通配符\n","- 如果需要对下载的文件重命名,可以在下载链接前面写上文件名后加一个```:```分开文件名和下载地址\n","- 如果需要下载到其他目录,可以使用同样的格式写其他目录"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["async_downloading='''# 这个列表仅加载一次 且不会等待加载完成\n","[extensions] # 插件 如果你没有使用ngrok或者frpc,请不要把插件放在这里加载,因为这里的文件可能在webui启动后才加载完成\n","\n","[models/Stable-diffusion] # 大模型列表\n","https://huggingface.co/viyi/testing_models/resolve/main/mg-LBG.safetensors\n","容华_国风_SDXL.safetensors:https://civitai.com/api/download/models/151978\n","\n","[models/hypernetworks] # hypernetworks文件列表\n","\n","[models/embeddings] # embeddings文件列表\n","\n","[models/Lora] # Lora文件列表\n","Genshin_Impact_all-in-one.safetensors:https://civitai.com/api/download/models/116970\n","https://civitai.com/api/download/models/117151 # Clothing +/- Adjuster 衣物增/减 LoRA\n","https://civitai.com/api/download/models/62833 # Detail Tweaker LoRA (细节调整LoRA)\n","https://civitai.com/api/download/models/127786 # Crop top collection - Sexy Clothing\n","https://civitai.com/api/download/models/120452 # anxiang | 暗香\n","https://civitai.com/api/download/models/121410 # Crop Shirt + Underboob (anime+realistic) | Goofy Ai\n","https://civitai.com/api/download/models/109412 # Micro Slingshot Swimsuit + Pubic Hair / Outfit 细绳比基尼\n","https://civitai.com/api/download/models/118273 # Bukkake / excessive cum\n","https://civitai.com/api/download/models/120242 # Microskirt 迷你裙\n","https://civitai.com/api/download/models/108698 # Projectile cum\n","https://civitai.com/api/download/models/126732 # Naked towel\n","https://civitai.com/api/download/models/124181 # POV Group Sex | Sex with multiple girls\n","https://civitai.com/api/download/models/106979 # Cuddling handjob :1girl, cuddling handjob, 1boy, penis\n","https://civitai.com/api/download/models/119559 # Undressing panties:undressing, panty pull\n","https://civitai.com/api/download/models/122473 # Slingshot swimsuit (Wedgie+Pubic hair)\n","https://civitai.com/api/download/models/124402 # clear swimsuit:nsfw, see-through, swimsuit, clearswimsuit\n","https://civitai.com/api/download/models/123250 # transparent bunny suit:nsfw, see-through leotard, playboy bunny, see-through, transpbunny\n","https://civitai.com/api/download/models/111550 # 【Concept】Pillory 概念-枷具jiaju\n","https://civitai.com/api/download/models/126627 # Wooden horse / bdsm :wooden horse, crotch rub\n","https://civitai.com/api/download/models/124749 # Cropped Hoodie Underboob (Anime +Realistic) | Goofy Ai\n","https://civitai.com/api/download/models/112969 # LEOSAM's FilmGirl 胶片风 Film Grain LoRA & LoHA\n","https://civitai.com/api/download/models/116611 # Modern victorian fashion dress | 洛丽塔裙子\n","https://civitai.com/api/download/models/94254 # Muggle Lora】落地窗_法式大窗户 :largewindow\n","\n","[models/VAE] # VAE文件列表\n","{input_path}/vae-ft-ema-prunedsafetensors/vae-ft-ema-560000-ema-pruned.safetensors\n","{input_path}/vae-ft-ema-prunedsafetensors/vae-ft-mse-840000-ema-pruned.safetensors\n","https://huggingface.co/stabilityai/sd-vae-ft-ema-original/resolve/main/vae-ft-ema-560000-ema-pruned.safetensors\n","https://huggingface.co/WarriorMama777/OrangeMixs/resolve/main/VAEs/orangemix.vae.pt\n","sdxl_vae.safetensors:https://civitai.com/api/download/models/130720?type=VAE # sdxl模型需要sdxl的vae\n","\n","[extensions/sd-webui-controlnet/models] # controlnet插件的模型列表\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11e_sd15_ip2p_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11e_sd15_shuffle_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11f1e_sd15_tile_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11f1p_sd15_depth_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_canny_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_inpaint_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_lineart_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_mlsd_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_normalbae_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_openpose_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_scribble_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_seg_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_softedge_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15s2_lineart_anime_fp16.safetensors\n","https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11u_sd15_tile_fp16.safetensors\n","'''\n"]},{"cell_type":"markdown","metadata":{},"source":["## 按顺序加载的重要文件列表\n","\n","- **这个列表每次 run all 启动都会加载一次,且一定按照顺序加载后才启动webui**\n","- ```[]```内的是下载文件的目标目录,可以是相对目录也可以是觉得路径\n","- ```[]```的下一行就是文件列表,可以是下载地址、git仓库、文件路径、文件夹路径,且支持通配符\n","- 如果需要对下载的文件重命名,可以在下载链接前面写上文件名后加一个```:```分开文件名和下载地址\n","- 如果需要下载到其他目录,可以使用同样的格式写其他目录"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["before_start_sync_downloading = ''' # 这个列表每次 run all 启动都会加载一次,且一定按照顺序加载\n","\n","# 如果你需要每次启动都加载一下文件,可以写在这。(比如测试路径是否正确的时候)\n","\n","[models/Stable-diffusion] # 大模型列表\n","\n","[models/hypernetworks] # hypernetworks文件列表\n","\n","[models/embeddings] # embeddings文件列表\n","\n","[models/Lora] # Lora文件列表\n","\n","[models/VAE] # VAE文件列表\n","\n","[extensions/sd-webui-controlnet/models] # controlnet插件的模型列表\n","\n","'''"]},{"cell_type":"markdown","metadata":{},"source":["## webui 启动参数\n","- 所有的参数都会在启动时传入\n","- 可以在前面加```#```来屏蔽某个参数\n","- 端口参数需要在下一个代码块的```webuiPort```处修改"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["sd_start_args='''\n","# --ckpt=mg-Tender.safetensors # 默认模型名称,路径不能包含空格\n","--disable-safe-unpickle \n","--deepdanbooru \n","--no-hashing \n","--no-download-sd-model \n","--administrator\n","--skip-torch-cuda-test \n","--skip-version-check \n","--disable-nan-check\n","# --opt-sdp-attention \n","--opt-sdp-no-mem-attention \n","--xformers-flash-attention\n","--xformers\n","--api \n","--listen\n","--lowram\n","#--no-gradio-queue\n","--encrypt-pass=123qwe # 图片加密插件的密码,如果要启用图片加密插件,删除这一行前面的#和将123qwe改成你的密码,也可以不改\n","# --share # 默认的内网穿透在kaggle和colab都已经不可用,请考虑其他方案\n","--disable-console-progressbars\n","--no-half-vae \n","# --no-half #关闭半精度\n","# --enable-console-prompts\n","# --nowebui # 如果只需要api服务,可以开启这个\n","# --api-auth=2333:6666 # api密码\n","# --gradio-auth=2333:6666 # webui密码\n","'''"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["useGooglrDrive = True # 连接到谷歌云盘 在google colab环境才会生效\n","#Ngrok\n","useNgrok=True # 非必填 是否使用ngrok作为公网访问地址\n","#Frpc\n","useFrpc=True # 开启frp将不能启动\n","\n","#可以填写文件路径 或 直接填 token 内容\n","ngrok_config_or_file = '''\n","{input_path}/configs/ngrok_token.txt\n","'''\n","frp_config_or_file = '''\n","{input_path}/configs/frpc_koishi.ini\n","'''\n","frp_ssl_dir = '''\n","{input_path}/configs/koishi_ssl\n","'''\n","\n","# 配置启动参数\n","server_port=7860 # webui 默认端口\n","\n","# 仓库地址 这是修改过界面布局顺序的webui,不定期同步到官方版本\n","# 如果要使用官方版本,改成这个: https://github.com/AUTOMATIC1111/stable-diffusion-webui\n","sd_git_repo='https://github.com/viyiviyi/stable-diffusion-webui.git -b local' \n","# 配置文件,包括webui的设置和UI默认值,如果要自定义,fork这个仓库后修改并把地址替换这个地址\n","sd_config_git_repu = 'https://github.com/viyiviyi/sd-configs.git'\n","# 设置文件保存路径 当使用谷歌云盘时非常有用\n","setting_file = '{output_path}/configs/config.json'\n","ui_config_file = '{output_path}/configs/ui-config.json'\n","\n","# 这是配置文件夹同步的相关配置\n","# 需要在huggingface创建一个数据集(datasets) 然后把数据集的名称(在页面上有复制的按钮)填到 huggingface_repo \n","# 需要获取 token 填到 huggingface_token 获取的地址是: https://huggingface.co/settings/tokens\n","huggingface_token = '{input_path}/configs/huggingface_token.txt'\n","huggingface_repo = 'viyi/sdwui-log'\n","\n","multi_case = True"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["link_instead_of_copy = True # 下载或加载Input的文件时是使用链接还是复制的方式加载到目标目录\n","hidden_console_info = True # 是否隐藏大部分的控制台内容"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["# 保存当前目录和启动时cd到之前保存的目录,可以减少sdwui-start-new.ipynb文件下载次数\n","import os\n","INIT_WORK_PATH = os.environ['HOME']\n","if os.getenv('INIT_WORK_PATH',''):\n"," INIT_WORK_PATH = os.getenv('INIT_WORK_PATH','')\n","else:\n"," os.environ['INIT_WORK_PATH'] = os.getcwd()\n","%cd {INIT_WORK_PATH}"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["reLoad = True\n","# 如果需要重新安装,请注释下面这一行\n","reLoad = False"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["if not os.path.exists('sdwui-start-util.ipynb'):\n"," !wget https://huggingface.co/viyi/sdwui/resolve/main/sdwui-start-util.ipynb -o log.log\n","%run sdwui-start-util.ipynb"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["try:\n"," check_gpu() # 检查是否存在gpu\n"," main()\n","except KeyboardInterrupt:\n"," stop_solo_threads() # 中断后自动停止后台线程 (有部分功能在后台线程中运行)"]},{"cell_type":"code","execution_count":null,"metadata":{"trusted":true},"outputs":[],"source":["# 打包收藏文件夹 如果需要可以取消下面两行的注释\n","# zipPath('$install_path/sd_main_dir/log','log')\n","# !mv {output_path}/log.tar {output_path}/log.tar.bak\n","# createOrUpdateDataSet(f'{output_path}/log.tar.bak','sd-webui-log-bak')\n","\n","# 打包 这一行的结果是 压缩一个目录,并放在 output_path: /kaggle/working/ 目录下 名字是训练输出.tar\n","# zipPath('$install_path/sd_main_dir/textual_inversion','训练输出') \n","# zipPath('$install_path/sd_main_dir/outputs','outputs')\n","\n","# 打包venv并上传到数据集\n","# zipPath('$install_path/sd_main_dir/venv','venv')\n","# !mv {output_path}/venv.tar /kaggle/working/venv.tar.bak\n","# createOrUpdateDataSet('/kaggle/working/venv.tar.bak','sd-webui-venv')\n","\n","# 打包命令参考,--exclude 可以排除不需要打包的目录\n","# !tar -cf $output_path/webui.tar.bak --exclude=venv --exclude=extensions -C /sd_main_dir/ ."]}],"metadata":{"kernelspec":{"display_name":"Python 3","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.10.7"}},"nbformat":4,"nbformat_minor":4}
|