colab用,controlNet插件安装
#controlNet
%cd /content/stable-diffusion-webui/extensions
!git clone https://github.com/Mikubill/sd-webui-controlnet.git
!git pull
#安装annotator模型,用于基于真人图,生成骨骼图/深度图等
%cd /content/stable-diffusion-webui/sd-webui-controlnet/annotator
#生成骨骼图
%cd /content/stable-diffusion-webui/sd-webui-controlnet/annotator/openpose
!wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/annotator/ckpts/body_pose_model.pth
!wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/annotator/ckpts/hand_pose_model.pth
#生成深度图(midas)
%cd /content/stable-diffusion-webui/sd-webui-controlnet/annotator/midas
!wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/annotator/ckpts/dpt_hybrid-midas-501f0c75.pt
#生成线段图(MLSD线段图)
%cd /content/stable-diffusion-webui/sd-webui-controlnet/annotator/mlsd
!wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/annotator/ckpts/mlsd_large_512_fp32.pth
!wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/annotator/ckpts/mlsd_tiny_512_fp32.pth
#边缘检测图(canny)
#%cd /content/stable-diffusion-webui/sd-webui-controlnet/annotator/canny
#边缘检测图(hed)
#安装control_net model,基于骨骼图/深度图/线稿/边缘检测(上色),生成图像
%cd /content/stable-diffusion-webui/sd-webui-controlnet/models
!wget https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_openpose-fp16.safetensors #骨骼图模型
!wget https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_canny-fp16.safetensors #边缘检测上色caany
!wget https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_hed-fp16.safetensors #边缘检测上色hed
!wget https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_mlsd-fp16.safetensors #线段图
!wget https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_scribble-fp16.safetensors #手绘图
!wget https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_depth-fp16.safetensors #深度图