File size: 2,460 Bytes
7112279 05d1701 7112279 74c5e9a 7112279 74c5e9a 7112279 05d1701 7112279 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | {
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"from IPython.display import clear_output\n",
"%cd /content\n",
"# 克隆 InvokeAI 的 GitHub 仓库\n",
"!git clone -b main https://github.com/Van-wise/IAekovnI\n",
"# 安装所需的 Python 包\n",
"!pip install -q dependency_injector diffusers einops eventlet facexlib flask_cors flask_socketio flaskwebgui getpass_asterisk huggingface-hub\n",
"!pip install -q kornia omegaconf pudb pyreadline3 pytorch-lightning realesrgan streamlit taming-transformers-rom1504 test-tube torch-fidelity\n",
"!pip install -q torchmetrics transformers picklescan\n",
"!pip install -q pillow xformers==0.0.20 triton==2.0.0 -U\n",
"clear_output()\n",
"# 克隆预处理器的GitHub仓库\n",
"!pip install -q git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.2#egg=gfpgan\n",
"!pip install -q git+https://github.com/openai/CLIP.git@main#egg=clip\n",
"!pip install -q git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k-diffusion\n",
"!pip install -q git+https://github.com/invoke-ai/clipseg.git@relaxed-python-requirement#egg=clipseg\n",
"!pip install -q git+https://github.com/invoke-ai/PyPatchMatch@0.1.4#egg=pypatchmatch\n",
"\n",
"%cd /content/IAekovnI/\n",
"!pip install -q -e .\n",
"clear_output()\n",
"print('依赖安装完成!')\n",
"\n",
"# 模型下载\n",
"!wget https://huggingface.co/Vanwise/sd-colab/resolve/main/Invoke/INITIAL_MODELS.yaml -O /content/IAekovnI/invokeai/configs/INITIAL_MODELS.yaml\n",
"!python /content/IAekovnI/scripts/invokeai-model-install.py --root_dir /content/IAekovnI/db --yes\n",
"!curl -Lo /content/IAekovnI/db/models/sd-1/main/chilloutmix_NiPrunedFp32Fix-inpainting.inpainting.safetensors https://huggingface.co/spaces/weo1101/111/resolve/main/chilloutmix_NiPrunedFp32Fix-inpainting.inpainting.safetensors\n",
"\n",
"!wget https://huggingface.co/Vanwise/sd-colab/resolve/main/libtcmalloc_minimal.so.4\n",
"os.environ['LD_PRELOAD'] = '/content/IAekovnI/libtcmalloc_minimal.so.4'\n",
"\n",
"!wget https://huggingface.co/Vanwise/sd-colab/resolve/main/Invoke/_start.ipynb\n",
"\n",
"clear_output()\n",
"print('模型下载完成!')"
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
|