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?#深度圖