import os def ControlnetDownloads(): def aria2(url, filename, directory): os.system(f'aria2c --console-log-level=error -c -x 16 -s 16 {url} -o {filename} -d {directory}') print("\n\n\n\033[35m正在下载controlnet模型\033[0m") url = '"https://hf-mirror.com/dong625/ControlNet/resolve/main/ControlNet.zip"' aria2(url, "ControlNet.zip", "/mnt/workspace/stable-diffusion-webui/models") os.system('7z x -pQQ917724495 /mnt/workspace/stable-diffusion-webui/models/ControlNet.zip -o/mnt/workspace/stable-diffusion-webui/models -y') os.system('rm -rf /mnt/workspace/stable-diffusion-webui/models/ControlNet.zip') print("\n\n\n\033[35m正在下载controlnet预处理器\033[0m") url = '"https://hf-mirror.com/dong625/downloads/resolve/main/downloads.zip"' aria2(url, "downloads.zip", "/mnt/workspace/stable-diffusion-webui/extensions") os.system('7z x -pQQ917724495 /mnt/workspace/stable-diffusion-webui/extensions/downloads.zip -o/mnt/workspace/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator -y') os.system('rm -rf /mnt/workspace/stable-diffusion-webui/extensions/downloads.zip') def main(): ControlnetDownloads() print("success") if __name__ == "__main__": main()