from shlex import quote if node.os != "debian": raise BundleError(f"{node.name}: OS {node.os} is not supported.") files = { "/workspace/storage/stable_diffusion/models/ckpt/v1-5-pruned-emaonly.ckpt": { "delete": True, }, } # ranbooru_dir = "/workspace/stable-diffusion-webui/extensions/sd-webui-ranbooru" # ranbooru_url = "https://github.com/Inzaniak/sd-webui-ranbooru/archive/master.tar.gz" # # actions = { # "download_ranbooru": { # "command": f"aria2c -o /workspace/master.tgz {quote(ranbooru_url)} && tar xf /workspace/master.tgz --strip-components=1 {quote(ranbooru_dir)}; rm -rf /workspace/master.tgz;", # "needs": {"pkg_apt:aria2"}, # "unless": f"test -d {ranbooru_dir}/README.md", # }, # } # modeldir = node.metadata.get("vast/model-dir", "/tmp/") for url, opts in node.metadata.get("vast/models", {}).items(): print('???', opts) actions["download_" + opts["filename"]] = { "command": f"aria2c -d {quote(modeldir)} {quote(url)}{f"?token={repo.vault.cmd("rbw get civitai/apikey")}" if "civitai.com" in url else ""}", "needs": {"pkg_apt:aria2"}, "unless": f"printf '{opts["sha256"]} {modeldir}/{opts["filename"]}' | sha256sum -c -", }