diff --git a/.gitmodules b/.gitmodules index 1784c29..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +0,0 @@ -[submodule "InvokeAI"] - path = InvokeAI - url = ../../invoke-ai/InvokeAI - branch = main -[submodule "stable-diffusion-webui"] - path = stable-diffusion-webui - url = ../../AUTOMATIC1111/stable-diffusion-webui diff --git a/InvokeAI b/InvokeAI deleted file mode 160000 index 93cdb47..0000000 --- a/InvokeAI +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 93cdb476d919b779e32a638aae15e56cc46b7adb diff --git a/README.md b/README.md index 61cfa94..097bb41 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,74 @@ # Table of contents - [nix-stable-diffusion](#nix-stable-diffusion) - - [What's done](#whats-done) + * [What's done](#whats-done) - [How to use it?](#how-to-use-it) - - [InvokeAI](#invokeai) - - [stable-diffusion-webui aka 111AUTOMATIC111 fork](#stable-diffusion-webui-aka-111automatic111-fork) -- [What's needed to be done](#whats-needed-to-be-done) -- [Updates and versioning](#updates-and-versioning) -- [Acknowledgements](#acknowledgements) + * [InvokeAI](#invokeai) + * [stable-diffusion-webui aka 111AUTOMATIC111 fork](#stable-diffusion-webui-aka-111automatic111-fork) + * [Hardware quirks](#hardware-quirks) + + [AMD](#amd) + + [Nvidia](#nvidia) +- [What's (probably) needed to be done](#whats-probably-needed-to-be-done) +- [Current versions](#current-versions) +- [Meta](#meta) + * [Contributions](#contributions) + * [Acknowledgements](#acknowledgements) + * [Similar projects](#similar-projects) # nix-stable-diffusion Flake for running SD on NixOS ## What's done -* Nix devShell capable of running InvokeAI's and stable-diffusion-webui flavors of SD without need to reach for pip or conda (including AMD ROCM support) +* Nix flake capable of running InvokeAI's and stable-diffusion-webui flavors of SD without need to reach for pip or conda (including AMD ROCM support) * ...??? * PROFIT # How to use it? ## InvokeAI 1. Clone repo -1. Clone submodule with InvokeAI -1. Run `nix develop .#invokeai.{default,nvidia,amd}`, wait for shell to build - 1. `.#invokeai.default` builds shell which overrides bare minimum required for SD to run - 1. `.#invokeai.amd` builds shell which overrides torch packages with ROCM-enabled bin versions - 1. `.#invokeai.nvidia` builds shell with overlay explicitly setting `cudaSupport = true` for torch +1. Run `nix run .#invokeai.{default,amd} -- --web --root_dir "folder for configs and models"`, wait for package to build + 1. `.#invokeai.default` builds package with default torch-bin that has CUDA-support by default + 1. `.#invokeai.amd` builds package which overrides torch packages with ROCM-enabled bin versions 1. Weights download - 1. **Built-in way.** Inside InvokeAI's directory, run `python scripts/preload_models.py` to preload main SD weighs and support models. (Downloading Stable Diffusion Weighs will require HugginFace token) - 2. **Manual way.** If you obtained SD weights from somewhere else, you can skip their download with `preload_models.py`. However, you'll have to manually create/edit `InvokeAI/configs/models.yaml` so that your models get loaded. Some example configs for SD 1.4, 1.5, 1.5-inpainting present in `models.example.yaml` . -1. Run CLI with `python scripts/invoke.py` or GUI with `python scripts/invoke.py --web` -1. For more detailed instructions consult https://invoke-ai.github.io/InvokeAI/installation/INSTALLING_MODELS/#community-contributed-models + 1. **Built-in CLI way.** Upon first launch InvokeAI will check its default config dir (~/invokeai) and suggest you to run build-in TUI startup configuration script that help you to download default models or supply existing ones to InvokeAI. Follow the instructions and finish configuration. Note: you can also pass option `--root_dir` to pick another location for configs/models installation. More fine-grained directory setup options also available - run `nix run .#invokeai.amd -- --help` for more info. + 2. **Build-in GUI way.** Recent version of InvokeAI added GUI for model managing. See upstream [docs](https://invoke-ai.github.io/InvokeAI/installation/050_INSTALLING_MODELS/#installation-via-the-webui) on that matter. +1. CLI arguments for invokeai itself can be supplied after `--` part of the nix run command +1. If you need to run additional scripts (like invokeai-merge, invokeai-ti), then you can run `nix build .#invokeai.amd` and call those scripts manually like that: `./result/bin/invokeai-ti`. ## stable-diffusion-webui aka 111AUTOMATIC111 fork 1. Clone repo -1. Clone submodule with stable-diffusion-webui -1. Run `nix develop .#webui.{default,nvidia,amd}`, wait for shell to build - 1. `.#webui.default` builds shell which overrides bare minimum required for SD to run - 1. `.#webui.amd` builds shell which overrides torch packages with ROCM-enabled bin versions - 1. `.#webui.nvidia` builds shell with overlay explicitly setting `cudaSupport = true` for torch -1. Obtain and place SD weights into `stable-diffusion-webui/models/Stable-diffusion/model.ckpt` -1. Inside `stable-diffusion-webui/` directory, run `python launch.py` to start web server. It should preload required models from the start. Additional models, such as CLIP, will be loaded before the first actual usage of them. +1. Run `nix run .#webui.{default,amd} -- --data-dir "runtime folder for webui stuff" --ckpt-dir "folder with pre-downloaded main SD models"`, wait for packages to build + 1. `.#webui.default` builds package with default torch-bin that has CUDA-support by default + 1. `.#webui.amd` builds package which overrides torch packages with ROCM-enabled bin versions +1. Webui is not a proper python package by itself, so I had to make a multi-layered wrapper script which sets required env and args. `bin/flake-launch` is a top-level wrapper, which sets default args and is running by default. `bin/launch.py` is a thin wrapper around original launch.py which only sets PYTHONPATH with required packages. Both wrappers pass additional args further down the pipeline. To list all available args you may run `nix run .#webui.amd -- --help`. -# What's needed to be done +## Hardware quirks +### AMD +If you get an error `"hipErrorNoBinaryForGpu: Unable to find code object for all current devices!"`, then probably your GPU is not fully supported by ROCM (only several gpus are by default) and you have to set env variable to trick ROCM into running - `export HSA_OVERRIDE_GFX_VERSION=10.3.0` -- [x] devShell with CUDA support (should be trivial, but requires volunteer with NVidia GPU) -- [ ] Missing packages definitions should be submitted to Nixpkgs -- [x] Investigate ROCM device warning on startup -- [ ] Apply patches so that all downloaded models would go into one specific folder -- [ ] Should create a PR to pynixify with "skip-errors mode" so that no ugly patches would be necessary -- [ ] Shell hooks for initial setup? -- [ ] May be this devShell should be itself turned into a package? -- [x] Add additional flavors of SD ? +### Nvidia +* **Please note, that I don't have an nvidia gpu and therefore I can't test that CUDA functionality actually work. If something is broken in that department, please open an issue, or even better - submit a PR with a proposed fix.** +* xformers for CUDA hasn't been tested. Python package added to the flake, but it's missing triton compiler. It might partially work, so please test it and report back :) + +# What's (probably) needed to be done -# Updates and versioning +- [ ] Most popular missing packages definitions should be submitted to Nixpkgs +- [ ] Try to make webui to use same paths and filenames for weights, as InvokeAI (through patching/args/symlinks) +- [ ] Should create a PR to pynixify with "skip-errors mode" so that no ugly patches would be necessary +- [ ] Increase reproducibility by replacing models, downloaded in runtime, to proper flake inputs -Current versions: -- InvokeAI 2.1.3p1 -- stable-diffusion-webui 27.10.2022 +# Current versions -I have no intention to keep up with development pace of these apps, especially the Automatic's fork :) . However, I will ocasionally update at least InvokeAI's flake. Considering versioning, I will try to follow semver with respect to submodules as well, which means major version bump for submodule = major version bump for this flake. +- InvokeAI 2.3.1.post2 +- stable-diffusion-webui 12.03.2023 -# Acknowledgements +# Meta +## Contributions +Contributions are welcome. I have no intention to keep up with development pace of these apps, especially the Automatic's fork :) . +However, I will ocasionally update at least InvokeAI's flake. Considering versioning, I will try to follow semver with respect to submodules as well, which means major version bump for submodule = major version bump for this flake. +## Acknowledgements Many many thanks to https://github.com/cript0nauta/pynixify which generated all the boilerplate for missing python packages. Also thanks to https://github.com/colemickens/stable-diffusion-flake and https://github.com/skogsbrus/stable-diffusion-nix-flake for inspiration and some useful code snippets. + +## Similar projects +You may want to check out [Nixified-AI](https://github.com/nixified-ai/flake). It aims to support broader range (e.g. text models) of AI models in NixOS. diff --git a/flake.lock b/flake.lock index 6e96662..8dfae9e 100644 --- a/flake.lock +++ b/flake.lock @@ -1,12 +1,29 @@ { "nodes": { + "invokeai-repo": { + "flake": false, + "locked": { + "lastModified": 1677475057, + "narHash": "sha256-REtyVcyRgspn1yYvB4vIHdOrPRZRNSSraepHik9MfgE=", + "owner": "invoke-ai", + "repo": "InvokeAI", + "rev": "650f4bb58ceca458bff1410f35cd6d6caad399c6", + "type": "github" + }, + "original": { + "owner": "invoke-ai", + "ref": "v2.3.1.post2", + "repo": "InvokeAI", + "type": "github" + } + }, "nixlib": { "locked": { - "lastModified": 1665277441, - "narHash": "sha256-TTuO5F7sStTBL/twYMSnRakrw1l7FqAYulN7+HPYjqc=", + "lastModified": 1677373009, + "narHash": "sha256-kxhz4QUP8tXa/yVSpEzDDZSEp9FvhzRqZzb+SeUaekw=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "76ef73e385f96bb438676cf5f21f220694fd3d73", + "rev": "c9d4f2476046c6a7a2ce3c2118c48455bf0272ea", "type": "github" }, "original": { @@ -17,41 +34,58 @@ }, "nixpkgs": { "locked": { - "lastModified": 1664780719, - "narHash": "sha256-Oxe6la5dSqRfJogjtY4sRzJjDDqvroJIVkcGEOT87MA=", + "lastModified": 1677998232, + "narHash": "sha256-gZj+aQIlLjNlmEBtZDUHsL07VTXZ4haMQuVTc4Zw0y4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fd54651f5ffb4a36e8463e0c327a78442b26cbe7", + "rev": "6360be075539647669cf0a09fbda9f8fdae627d8", "type": "github" }, "original": { "owner": "NixOS", "repo": "nixpkgs", - "rev": "fd54651f5ffb4a36e8463e0c327a78442b26cbe7", "type": "github" } }, "root": { "inputs": { + "invokeai-repo": "invokeai-repo", "nixlib": "nixlib", "nixpkgs": "nixpkgs", - "stable-diffusion-repo": "stable-diffusion-repo" + "stable-diffusion-repo": "stable-diffusion-repo", + "webui-repo": "webui-repo" } }, "stable-diffusion-repo": { "flake": false, "locked": { - "lastModified": 1661187475, - "narHash": "sha256-3YkSUATD/73nJFm4os3ZyNU8koabGB/6iR0XbTUQmVY=", - "owner": "CompVis", - "repo": "stable-diffusion", - "rev": "69ae4b35e0a0f6ee1af8bb9a5d0016ccb27e36dc", + "lastModified": 1669389446, + "narHash": "sha256-F0B6h/+Ji/E821KyylcLQb2e8W4LctByGMa88feADtU=", + "owner": "Stability-AI", + "repo": "stablediffusion", + "rev": "47b6b607fdd31875c9279cd2f4f16b92e4ea958e", + "type": "github" + }, + "original": { + "owner": "Stability-AI", + "repo": "stablediffusion", + "rev": "47b6b607fdd31875c9279cd2f4f16b92e4ea958e", + "type": "github" + } + }, + "webui-repo": { + "flake": false, + "locked": { + "lastModified": 1679138564, + "narHash": "sha256-h7VGcH35Pd3TAVNpNB2scqZAp0NTi7swl+l43GhvcI0=", + "owner": "gbtb", + "repo": "stable-diffusion-webui", + "rev": "bc7e54010c9781ae2d5ceb230a1ab5bfc8ba2ffe", "type": "github" }, "original": { - "owner": "CompVis", - "repo": "stable-diffusion", - "rev": "69ae4b35e0a0f6ee1af8bb9a5d0016ccb27e36dc", + "owner": "gbtb", + "repo": "stable-diffusion-webui", "type": "github" } } diff --git a/flake.nix b/flake.nix index e244a99..6cde521 100644 --- a/flake.nix +++ b/flake.nix @@ -1,38 +1,44 @@ { - description = "A very basic flake"; + description = "Nix Flake for runnig Stable Diffusion on NixOS"; inputs = { nixlib.url = "github:nix-community/nixpkgs.lib"; nixpkgs = { - url = "github:NixOS/nixpkgs?rev=fd54651f5ffb4a36e8463e0c327a78442b26cbe7"; + url = "github:NixOS/nixpkgs"; #?rev=33919d25f0c873b0c73e2f8d0859fab3bd0d1b26"; }; stable-diffusion-repo = { - url = "github:CompVis/stable-diffusion?rev=69ae4b35e0a0f6ee1af8bb9a5d0016ccb27e36dc"; + url = "github:Stability-AI/stablediffusion?rev=47b6b607fdd31875c9279cd2f4f16b92e4ea958e"; + flake = false; + }; + invokeai-repo = { + url = "github:invoke-ai/InvokeAI?ref=v2.3.1.post2"; + flake = false; + }; + webui-repo = { + #url = "github:AUTOMATIC1111/stable-diffusion-webui"; + url = "github:gbtb/stable-diffusion-webui"; #instead of patching in flake, better use a fork. CRLF bullshit makes patching this repo almost impossible flake = false; }; }; - outputs = { self, nixpkgs, nixlib, stable-diffusion-repo }@inputs: + outputs = { self, nixpkgs, nixlib, stable-diffusion-repo, invokeai-repo, webui-repo }@inputs: let nixlib = inputs.nixlib.outputs.lib; - supportedSystems = [ "x86_64-linux" ]; - forAll = nixlib.genAttrs supportedSystems; - requirementsFor = { pkgs, webui ? false }: with pkgs; with pkgs.python3.pkgs; [ + system = "x86_64-linux"; + requirementsFor = { pkgs, webui ? false, nvidia ? false }: with pkgs; with pkgs.python3.pkgs; [ python3 - torch torchvision numpy - albumentations opencv4 pudb imageio imageio-ffmpeg pytorch-lightning - protobuf3_20 omegaconf test-tube streamlit + protobuf einops taming-transformers-rom1504 torch-fidelity @@ -40,23 +46,34 @@ transformers kornia k-diffusion - + diffusers # following packages not needed for vanilla SD but used by both UIs realesrgan pillow + safetensors ] + ++ nixlib.optional (nvidia) [ xformers ] #probably won't fully work ++ nixlib.optional (!webui) [ + npyscreen + huggingface-hub + dnspython + datasets + click + pypatchmatch + torchsde + compel send2trash flask flask-socketio flask-cors - dependency-injector gfpgan eventlet clipseg getpass-asterisk + picklescan ] ++ nixlib.optional webui [ + pip addict future lmdb @@ -76,9 +93,11 @@ fonts font-roboto piexif - websockets codeformer blip + psutil + openclip + blendmodes ]; overlay_default = nixpkgs: pythonPackages: { @@ -86,14 +105,6 @@ nativeBuildInputs = old.nativeBuildInputs ++ [ nixpkgs.python3Packages.pythonRelaxDepsHook ]; pythonRelaxDeps = [ "protobuf" ]; }); - wandb = pythonPackages.wandb.overrideAttrs (old: { - nativeBuildInputs = old.nativeBuildInputs ++ [ nixpkgs.python3Packages.pythonRelaxDepsHook ]; - pythonRelaxDeps = [ "protobuf" ]; - }); - streamlit = nixpkgs.streamlit.overrideAttrs (old: { - nativeBuildInputs = old.nativeBuildInputs ++ [ nixpkgs.python3Packages.pythonRelaxDepsHook ]; - pythonRelaxDeps = [ "protobuf" ]; - }); scikit-image = pythonPackages.scikitimage; }; overlay_webui = nixpkgs: pythonPackages: @@ -115,10 +126,45 @@ }); callPackage = self.callPackage; rmCallPackage = path: args: rm (callPackage path args); + mapCallPackage = pnames: builtins.listToAttrs (builtins.map (pname: { name = pname; value = (callPackage (./packages + "/${pname}") { }); }) pnames); + simplePackages = [ + "filterpy" + "kornia" + "lpips" + "ffmpy" + "shap" + "fonts" + "font-roboto" + "analytics-python" + "markdown-it-py" + "gradio" + "hatch-requirements-txt" + "timm" + "blip" + "fairscale" + "torch-fidelity" + "resize-right" + "torchdiffeq" + "accelerate" + "clip-anytorch" + "jsonmerge" + "clean-fid" + "getpass-asterisk" + "pypatchmatch" + "trampoline" + "torchsde" + "compel" + "diffusers" + "safetensors" + "picklescan" + "openclip" + "blendmodes" + "xformers" + "pyre-extensions" + # "triton" TODO: nixpkgs is missing required llvm parts - mlir. https://github.com/NixOS/nixpkgs/pull/163878 + ]; in - rec { - - + { pydeprecate = callPackage ./packages/pydeprecate { }; taming-transformers-rom1504 = callPackage ./packages/taming-transformers-rom1504 { }; @@ -127,53 +173,30 @@ gfpgan = rmCallPackage ./packages/gfpgan { opencv-python = self.opencv4; }; basicsr = rmCallPackage ./packages/basicsr { opencv-python = self.opencv4; }; facexlib = rmCallPackage ./packages/facexlib { opencv-python = self.opencv4; }; - realesrgan = rmCallPackage ./packages/realesrgan { opencv-python = self.opencv4; }; codeformer = callPackage ./packages/codeformer { opencv-python = self.opencv4; }; + realesrgan = rmCallPackage ./packages/realesrgan { opencv-python = self.opencv4; }; clipseg = rmCallPackage ./packages/clipseg { opencv-python = self.opencv4; }; - filterpy = callPackage ./packages/filterpy { }; - kornia = callPackage ./packages/kornia { }; - lpips = callPackage ./packages/lpips { }; - ffmpy = callPackage ./packages/ffmpy { }; - shap = callPackage ./packages/shap { }; - fonts = callPackage ./packages/fonts { }; - font-roboto = callPackage ./packages/font-roboto { }; - analytics-python = callPackage ./packages/analytics-python { }; - markdown-it-py = callPackage ./packages/markdown-it-py { }; - gradio = callPackage ./packages/gradio { }; - hatch-requirements-txt = callPackage ./packages/hatch-requirements-txt { }; - timm = callPackage ./packages/timm { }; - blip = callPackage ./packages/blip { }; - fairscale = callPackage ./packages/fairscale { }; - torch-fidelity = callPackage ./packages/torch-fidelity { }; - resize-right = callPackage ./packages/resize-right { }; - torchdiffeq = callPackage ./packages/torchdiffeq { }; k-diffusion = callPackage ./packages/k-diffusion { clean-fid = self.clean-fid; }; - accelerate = callPackage ./packages/accelerate { }; - clip-anytorch = callPackage ./packages/clip-anytorch { }; - jsonmerge = callPackage ./packages/jsonmerge { }; - clean-fid = callPackage ./packages/clean-fid { }; - getpass-asterisk = callPackage ./packages/getpass-asterisk { }; - }; + } // mapCallPackage simplePackages; overlay_amd = nixpkgs: pythonPackages: rec { + #IMPORTANT: you can browse available wheels on the server, but only if you add trailing "/" - e.g. https://download.pytorch.org/whl/rocm5.2/ torch-bin = pythonPackages.torch-bin.overrideAttrs (old: { src = nixpkgs.fetchurl { - name = "torch-1.12.1+rocm5.1.1-cp310-cp310-linux_x86_64.whl"; - url = "https://download.pytorch.org/whl/rocm5.1.1/torch-1.12.1%2Brocm5.1.1-cp310-cp310-linux_x86_64.whl"; - hash = "sha256-kNShDx88BZjRQhWgnsaJAT8hXnStVMU1ugPNMEJcgnA="; + name = "torch-1.13.1+rocm5.2-cp310-cp310-linux_x86_64.whl"; + url = "https://download.pytorch.org/whl/rocm5.2/torch-1.13.1%2Brocm5.2-cp310-cp310-linux_x86_64.whl"; + hash = "sha256-82hdCKwNjJUcw2f5vUsskkxdRRdmnEdoB3SKvNlmE28="; }; }); torchvision-bin = pythonPackages.torchvision-bin.overrideAttrs (old: { src = nixpkgs.fetchurl { - name = "torchvision-0.13.1+rocm5.1.1-cp310-cp310-linux_x86_64.whl"; - url = "https://download.pytorch.org/whl/rocm5.1.1/torchvision-0.13.1%2Brocm5.1.1-cp310-cp310-linux_x86_64.whl"; - hash = "sha256-mYk4+XNXU6rjpgWfKUDq+5fH/HNPQ5wkEtAgJUDN/Jg="; + name = "torchvision-0.14.1+rocm5.2-cp310-cp310-linux_x86_64.whl"; + url = "https://download.pytorch.org/whl/rocm5.2/torchvision-0.14.1%2Brocm5.2-cp310-cp310-linux_x86_64.whl"; + hash = "sha256-oBYG/K7bgkxu0UvmyS2U1ud2LkFQ/CarcxpEJ9xzMYQ="; }; }); torch = torch-bin; torchvision = torchvision-bin; - #overriding because of https://github.com/NixOS/nixpkgs/issues/196653 - opencv4 = pythonPackages.opencv4.override { openblas = nixpkgs.blas; }; }; overlay_nvidia = nixpkgs: pythonPackages: { @@ -181,113 +204,152 @@ torchvision = pythonPackages.torchvision-bin; }; in - { - devShells = forAll - (system: - let - mkShell = inputs.nixpkgs.legacyPackages.${system}.mkShell; - nixpkgs_ = { amd ? false, nvidia ? false, webui ? false }: - import inputs.nixpkgs { - inherit system; - config.allowUnfree = nvidia; #CUDA is unfree. - overlays = [ - (final: prev: - let optional = nixlib.optionalAttrs; in - { - python3 = prev.python3.override { - packageOverrides = - python-self: python-super: - (overlay_default prev python-super) // - optional amd (overlay_amd prev python-super) // - optional nvidia (overlay_nvidia prev python-super) // - optional webui (overlay_webui prev python-super) // - (overlay_pynixify python-self); - }; - }) - ]; - }; - in - rec { - invokeai = - let - shellHook = '' - cd InvokeAI - ''; - in - { - default = mkShell - ({ - inherit shellHook; - name = "invokeai"; - propagatedBuildInputs = requirementsFor { pkgs = (nixpkgs_ { }); }; - }); - amd = mkShell - ({ - inherit shellHook; - name = "invokeai.amd"; - propagatedBuildInputs = requirementsFor { pkgs = (nixpkgs_ { amd = true; }); }; - }); - nvidia = mkShell - ({ - inherit shellHook; - name = "invokeai.nvidia"; - propagatedBuildInputs = requirementsFor { pkgs = (nixpkgs_ { nvidia = true; }); }; - }); - }; - webui = + let + nixpkgs_ = { amd ? false, nvidia ? false, webui ? false }: + import inputs.nixpkgs { + inherit system; + config.allowUnfree = nvidia; #CUDA is unfree. + overlays = [ + (final: prev: let - shellHookFor = nixpkgs: - let - submodel = pkg: nixpkgs.pkgs.python3.pkgs.${pkg} + "/lib/python3.10/site-packages"; - taming-transformers = submodel "taming-transformers-rom1504"; - k_diffusion = submodel "k-diffusion"; - codeformer = (submodel "codeformer") + "/codeformer"; - blip = (submodel "blip") + "/blip"; - in - '' - cd stable-diffusion-webui - git reset --hard HEAD - git apply ${./webui.patch} - rm -rf repositories/ - mkdir repositories - ln -s ${inputs.stable-diffusion-repo}/ repositories/stable-diffusion - substituteInPlace modules/paths.py \ - --subst-var-by taming_transformers ${taming-transformers} \ - --subst-var-by k_diffusion ${k_diffusion} \ - --subst-var-by codeformer ${codeformer} \ - --subst-var-by blip ${blip} - ''; + optional = nixlib.optionalAttrs; + sl = (prev.streamlit.override ({ protobuf3 = prev.protobuf; })); + makePythonHook = args: final.makeSetupHook ({ passthru.provides.setupHook = true; } // args); + pythonRelaxDepsHook = prev.callPackage + ({ wheel }: + #upstream hook doesn't work properly with non-standard wheel names + #which means that some packages from pip silently fail to be overriden + #https://github.com/NixOS/nixpkgs/issues/198342 + makePythonHook + { + name = "python-relax-deps-hook"; + propagatedBuildInputs = [ wheel ]; + substitutions = { + pythonInterpreter = nixlib.getExe prev.python3Packages.python; + }; + } ./python-relax-deps-hook.sh) + { wheel = prev.python3.pkgs.wheel; }; in { - default = mkShell - ( - let args = { pkgs = (nixpkgs_ { webui = true; }); webui = true; }; in - { - shellHook = shellHookFor args.pkgs; - name = "webui"; - propagatedBuildInputs = requirementsFor args.pkgs; - } - ); - amd = mkShell - ( - let args = { pkgs = (nixpkgs_ { webui = true; amd = true; }); webui = true; }; in - { - shellHook = shellHookFor args.pkgs; - name = "webui.amd"; - propagatedBuildInputs = requirementsFor args; - } - ); - nvidia = mkShell - ( - let args = { pkgs = (nixpkgs_ { webui = true; nvidia = true; }); webui = true; }; in - { - shellHook = shellHookFor args.pkgs; - name = "webui.nvidia"; - propagatedBuildInputs = requirementsFor args; - } - ); - }; - default = invokeai.amd; - }); + inherit pythonRelaxDepsHook; + streamlit = sl.overrideAttrs (old: { + nativeBuildInputs = old.nativeBuildInputs ++ [ pythonRelaxDepsHook ]; + pythonRemoveDeps = [ "protobuf" ]; + }); + python3 = prev.python3.override { + packageOverrides = + python-self: python-super: + (overlay_default prev python-super) // + optional amd (overlay_amd prev python-super) // + optional nvidia (overlay_nvidia prev python-super) // + optional webui (overlay_webui prev python-super) // + (overlay_pynixify python-self); + }; + }) + ]; + } // { inherit nvidia; }; + in + { + packages.${system} = + let + nixpkgsAmd = (nixpkgs_ { amd = true; }); + nixpkgsNvidia = (nixpkgs_ { nvidia = true; }); + invokeaiF = nixpkgs: nixpkgs.python3.pkgs.buildPythonApplication { + pname = "invokeai"; + version = "2.3.1"; + src = invokeai-repo; + format = "pyproject"; + meta.mainProgram = "invokeai"; + propagatedBuildInputs = requirementsFor { pkgs = nixpkgs; nvidia = nixpkgs.nvidia; }; + nativeBuildInputs = [ nixpkgs.pkgs.pythonRelaxDepsHook ]; + pythonRelaxDeps = [ "torch" "pytorch-lightning" "flask-socketio" "flask" "dnspython" ]; + pythonRemoveDeps = [ "opencv-python" "flaskwebgui" "pyreadline3" ]; + }; + webuiF = nixpkgs: + let + submodel = pkg: nixpkgs.pkgs.python3.pkgs.${pkg} + "/lib/python3.10/site-packages"; + taming-transformers = submodel "taming-transformers-rom1504"; + k_diffusion = submodel "k-diffusion"; + codeformer = (submodel "codeformer") + "/codeformer"; + blip = (submodel "blip") + "/blip"; + in + nixpkgs.python3.pkgs.buildPythonApplication { + pname = "stable-diffusion-webui"; + version = "2023-03-12"; + src = webui-repo; + format = "other"; + propagatedBuildInputs = requirementsFor { pkgs = nixpkgs; webui = true; nvidia = nixpkgs.nvidia; }; + nativeBuildInputs = [ nixpkgs.pkgs.makeWrapper ]; + meta.mainProgram = "flake-launch"; + buildPhase = '' + runHook preBuild + cp -r . $out + chmod -R +w $out + cd $out + + #firstly, we need to make launch.py runnable by adding python shebang + cat <<-EOF > exec_launch.py.unwrapped + $(echo "#!/usr/bin/python") + $(cat launch.py) + EOF + chmod +x exec_launch.py.unwrapped + + #creating wrapper around launch.py with PYTHONPATH correctly set + makeWrapper "$(pwd)/exec_launch.py.unwrapped" exec_launch.py \ + --set-default PYTHONPATH $PYTHONPATH + + mkdir $out/bin + pushd $out/bin + ln -s ../exec_launch.py launch.py + buck='$' #escaping $ inside shell inside shell is tricky + #next is an additional shell wrapper, which sets sensible default args for CLI + #additional arguments will be passed further + cat <<-EOF > flake-launch + #!/usr/bin/env bash + pushd $out #For some reason, fastapi only works when current workdir is set inside the repo + trap "popd" EXIT + + "$out/bin/launch.py" --skip-install "$buck{@}" + EOF + # below lie remnants of my attempt to make webui use similar paths as InvokeAI for models download + # additions of such options in upstream is a welcome sign, however they're mostly ignored and therefore useless + # TODO: check in 6 months, maybe it'll work + # For now, your best bet is to use ZFS dataset with dedup enabled or make symlinks after the fact + + #--codeformer-models-path "\$mp/codeformer" \ + #--gfpgan-models-path "\$mp/gfpgan" --esrgan-models-path "\$mp/esrgan" \ + #--bsrgan-models-path "\$mp/bsrgan" --realesrgan-models-path "\$mp/realesrgan" \ + #--clip-models-path "\$mp/clip" + chmod +x flake-launch + popd + + runHook postBuild + ''; + installPhase = '' + runHook preInstall + + rm -rf repositories/ + mkdir repositories + pushd repositories + ln -s ${inputs.stable-diffusion-repo}/ stable-diffusion-stability-ai + ln -s ${taming-transformers}/ taming-transformers + ln -s ${k_diffusion}/ k-diffusion + ln -s ${codeformer}/ CodeFormer + ln -s ${blip}/ BLIP + popd + runHook postInstall + ''; + }; + in + { + invokeai = { + amd = invokeaiF nixpkgsAmd; + default = invokeaiF nixpkgsNvidia; + }; + webui = { + amd = webuiF nixpkgsAmd; + default = webuiF nixpkgsNvidia; + }; + }; }; } diff --git a/packages/accelerate/default.nix b/packages/accelerate/default.nix index 137b0f0..ac83e01 100644 --- a/packages/accelerate/default.nix +++ b/packages/accelerate/default.nix @@ -6,11 +6,11 @@ buildPythonPackage rec { pname = "accelerate"; - version = "0.13.1"; + version = "0.17.0"; src = fetchPypi { inherit pname version; - sha256 = "1dk82s80rq8xp3v4hr9a27vgj9k3gy9yssp7ww7i3c0vc07gx2cv"; + sha256 = "sha256-FvImuCGswe/obw4NXY8lZT3/VSNzXs4JkP7+p+t2B2o="; }; propagatedBuildInputs = [ numpy packaging psutil pyyaml torch ]; diff --git a/packages/blendmodes/default.nix b/packages/blendmodes/default.nix new file mode 100644 index 0000000..53b6a9e --- /dev/null +++ b/packages/blendmodes/default.nix @@ -0,0 +1,26 @@ +# WARNING: This file was automatically generated. You should avoid editing it. +# If you run pynixify again, the file will be either overwritten or +# deleted, and you will lose the changes you made to it. + +{ aenum, buildPythonPackage, deprecation, fetchPypi, lib, numpy, pillow }: + +buildPythonPackage rec { + pname = "blendmodes"; + version = "2022"; + + src = fetchPypi { + inherit pname version; + sha256 = "00zx3025rlpgdsy78znm9xqml3kfd41sq34gjss391qfx70z2s4k"; + }; + + propagatedBuildInputs = [ pillow aenum deprecation numpy ]; + + # TODO FIXME + doCheck = false; + + meta = with lib; { + description = + "Use this module to apply a number of blending modes to a background and foreground image"; + homepage = "https://github.com/FHPythonUtils/BlendModes"; + }; +} diff --git a/packages/blip/default.nix b/packages/blip/default.nix index 5f43817..e7c5f3b 100644 --- a/packages/blip/default.nix +++ b/packages/blip/default.nix @@ -5,8 +5,8 @@ , transformers , fairscale , lib -}: -stdenv.mkDerivation rec { +, buildPythonPackage}: +buildPythonPackage rec { pname = "blip"; version = "0.1.0"; @@ -25,6 +25,8 @@ stdenv.mkDerivation rec { dontInstall = true; + format="other"; + propagatedBuildInputs = [ timm transformers diff --git a/packages/codeformer/default.nix b/packages/codeformer/default.nix index c0f32eb..e0e8367 100644 --- a/packages/codeformer/default.nix +++ b/packages/codeformer/default.nix @@ -83,7 +83,7 @@ let }; }; in -stdenv.mkDerivation rec { +buildPythonPackage rec { pname = "codeformer"; version = "0.1.2"; @@ -95,6 +95,7 @@ stdenv.mkDerivation rec { }; + format = "other"; buildPhase = '' mkdir -p $out/lib/python3.10/site-packages cp -R ./ $out/lib/python3.10/site-packages/codeformer/ diff --git a/packages/codeformer/root_dir.patch b/packages/codeformer/root_dir.patch index e524223..0017cc3 100644 --- a/packages/codeformer/root_dir.patch +++ b/packages/codeformer/root_dir.patch @@ -7,7 +7,7 @@ index 0240187..0570161 100644 -ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -+ROOT_DIR = f'{os.getcwd()}/models/facelib' ++ROOT_DIR = os.environ.get('CODEFORMER_ROOT_DIR') #f'{os.getcwd()}/models/facelib' def download_pretrained_models(file_ids, save_path_root): diff --git a/packages/compel/default.nix b/packages/compel/default.nix new file mode 100644 index 0000000..65a63fb --- /dev/null +++ b/packages/compel/default.nix @@ -0,0 +1,30 @@ +# WARNING: This file was automatically generated. You should avoid editing it. +# If you run pynixify again, the file will be either overwritten or +# deleted, and you will lose the changes you made to it. + +{ buildPythonPackage, fetchPypi, lib, torch, fetchFromGitHub, pyparsing, transformers, diffusers }: + +buildPythonPackage rec { + pname = "compel"; + version = "0.1.7"; + + src = fetchFromGitHub { + inherit pname version; + owner = "damian0815"; + repo = pname; + rev = "085d657356714fbc972f12273ec7803242d602a0"; + sha256 = "sha256-v6tkyOH0cBQWPPmi9AY9nvYwaT8QxNpJneB/YWSdlYc="; + }; + + propagatedBuildInputs = [ pyparsing torch transformers diffusers ]; + format = "pyproject"; + + # TODO FIXME + doCheck = false; + + meta = with lib; { + description = + "A text prompt weighting and blending library for transformers-type text embedding systems"; + homepage = "https://pypi.org/project/compel/#description"; + }; +} diff --git a/packages/diffusers/default.nix b/packages/diffusers/default.nix new file mode 100644 index 0000000..5994ebd --- /dev/null +++ b/packages/diffusers/default.nix @@ -0,0 +1,27 @@ +# WARNING: This file was automatically generated. You should avoid editing it. +# If you run pynixify again, the file will be either overwritten or +# deleted, and you will lose the changes you made to it. + +{ buildPythonPackage, fetchPypi, filelock, huggingface-hub, importlib-metadata +, lib, numpy, pillow, regex, requests }: + +buildPythonPackage rec { + pname = "diffusers"; + version = "0.13.1"; + + src = fetchPypi { + inherit pname version; + sha256 = "0k4f9zya92jv4msdm66jaab29avxd6ba9c7aqc2mp7sdycg7mdi9"; + }; + + propagatedBuildInputs = + [ importlib-metadata filelock huggingface-hub numpy regex requests pillow ]; + + # TODO FIXME + doCheck = false; + + meta = with lib; { + description = "Diffusers"; + homepage = "https://github.com/huggingface/diffusers"; + }; +} diff --git a/packages/k-diffusion/default.nix b/packages/k-diffusion/default.nix index b90d65d..ee2e378 100644 --- a/packages/k-diffusion/default.nix +++ b/packages/k-diffusion/default.nix @@ -4,15 +4,15 @@ { accelerate, buildPythonPackage, clip-anytorch, einops, fetchPypi, jsonmerge , kornia, lib, pillow, resize-right, scikit-image, scipy, torch, torchdiffeq -, torchvision, tqdm, wandb, clean-fid }: +, torchvision, tqdm, wandb, clean-fid, torchsde }: buildPythonPackage rec { pname = "k-diffusion"; - version = "0.0.9"; + version = "0.0.14"; src = fetchPypi { inherit pname version; - sha256 = "02j7hkhdh57bkvc75xygj50a64dzdi44d1gsw4wjmvp9f7pllpfa"; + sha256 = "sha256-b7mxIA64tClz96s78GCI+kBJf/umi2ClCNjDYlqjTrs="; }; propagatedBuildInputs = [ @@ -28,6 +28,7 @@ buildPythonPackage rec { torch torchdiffeq torchvision + torchsde tqdm wandb clean-fid diff --git a/packages/kornia/default.nix b/packages/kornia/default.nix index 82a79e5..fd5ea3a 100644 --- a/packages/kornia/default.nix +++ b/packages/kornia/default.nix @@ -6,11 +6,11 @@ buildPythonPackage rec { pname = "kornia"; - version = "0.6.8"; + version = "0.6.10"; src = fetchPypi { inherit pname version; - sha256 = "0mlcnpqfd411hzn592lgz8pk3asdanks68ld1q1lzay0acjf1189"; + sha256 = "sha256-ALTomQtczcWJ4+zCYTRGYjsP+y/h21WYqsVVE7QBaQM="; }; buildInputs = [ pytest-runner ]; diff --git a/packages/openclip/default.nix b/packages/openclip/default.nix new file mode 100644 index 0000000..471031f --- /dev/null +++ b/packages/openclip/default.nix @@ -0,0 +1,47 @@ +# WARNING: This file was automatically generated. You should avoid editing it. +# If you run pynixify again, the file will be either overwritten or +# deleted, and you will lose the changes you made to it. + +{ buildPythonPackage +, fetchFromGitHub +, ftfy +, huggingface-hub +, lib +, regex +, sentencepiece +, torch +, torchvision +, tqdm +, protobuf +}: + +buildPythonPackage rec { + pname = "open_clip"; + version = "2.7.0"; + + src = fetchFromGitHub { + owner = "mlfoundations"; + repo = "open_clip"; + rev = "v2.7.0"; + sha256 = "sha256-QzEGSUe2c+LkWb2rwTavQAvcllbrjAtgF/RwbzwOfnU="; + }; + + propagatedBuildInputs = [ + torch + torchvision + regex + ftfy + tqdm + huggingface-hub + sentencepiece + protobuf + ]; + + # TODO FIXME + doCheck = false; + + meta = with lib; { + description = "OpenCLIP"; + homepage = "https://github.com/mlfoundations/open_clip"; + }; +} diff --git a/packages/pyreadline3/default.nix b/packages/picklescan/default.nix similarity index 58% rename from packages/pyreadline3/default.nix rename to packages/picklescan/default.nix index c2dbc1b..8110db2 100644 --- a/packages/pyreadline3/default.nix +++ b/packages/picklescan/default.nix @@ -2,19 +2,22 @@ # If you run pynixify again, the file will be either overwritten or # deleted, and you will lose the changes you made to it. -{ buildPythonPackage, fetchPypi, lib }: +{ buildPythonPackage, fetchPypi, lib, wheel, setuptools }: buildPythonPackage rec { - pname = "pyreadline3"; - version = "3.4.1"; + pname = "picklescan"; + version = "0.0.8"; src = fetchPypi { inherit pname version; - sha256 = "1bkv3zrfzmhbsd38dslsydi0arnc50gzrkhp76vk5fiii9xiygbg"; + sha256 = "1z87dswh1hljgxw2q11zss5vfdi7qj3kfqrj22dlngpq7qa3d3xf"; }; # TODO FIXME doCheck = false; + propagatedBuildInputs = [ setuptools wheel ]; + format = "pyproject"; + meta = with lib; { }; } diff --git a/packages/pypatchmatch/default.nix b/packages/pypatchmatch/default.nix new file mode 100644 index 0000000..4144a56 --- /dev/null +++ b/packages/pypatchmatch/default.nix @@ -0,0 +1,44 @@ +{ buildPythonPackage, lib, numpy, fetchFromGitHub, pillow, tqdm, setuptools, stdenv, pkg-config, opencv4 }: +let + version = "1.0.0"; + src = fetchFromGitHub { + owner = "mauwii"; + repo = "PyPatchMatch"; + rev = "release/v${version}"; + sha256 = "sha256-icxRmmxWvztQvMsYBJatvGa2YzxX05+xxdg+UJuy1SQ="; + }; + libpatchmatch = stdenv.mkDerivation { + name = "libpatchmatch"; + sourceRoot = ["source/patchmatch"]; + nativeBuildInputs = [ + pkg-config + opencv4 + ]; + inherit src version; + + installPhase = '' + mkdir -p $out/lib + cp libpatchmatch.so $out/lib/ + ''; + }; +in +buildPythonPackage { + pname = "pypatchmatch"; + inherit src version; + + format = "pyproject"; + buildInputs = [ setuptools ]; + propagatedBuildInputs = [ numpy pillow tqdm ]; + + # TODO FIXME + doCheck = false; + + postInstall = '' + cp ${libpatchmatch}/lib/libpatchmatch.so $out/lib/*/site-packages/patchmatch/ + ''; + + meta = { + description = "This library implements the PatchMatch based inpainting algorithm"; + homepage = "https://github.com/invoke-ai/PyPatchMatch"; + }; +} diff --git a/packages/pyre-extensions/default.nix b/packages/pyre-extensions/default.nix new file mode 100644 index 0000000..b11baa1 --- /dev/null +++ b/packages/pyre-extensions/default.nix @@ -0,0 +1,25 @@ +# WARNING: This file was automatically generated. You should avoid editing it. +# If you run pynixify again, the file will be either overwritten or +# deleted, and you will lose the changes you made to it. + +{ buildPythonPackage, fetchPypi, lib, typing-extensions, typing-inspect }: + +buildPythonPackage rec { + pname = "pyre-extensions"; + version = "0.0.30"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-unkjxIbgia+zehBiOo9K6C1zz/QkJtcRxIrwcOW8MbI="; + }; + + propagatedBuildInputs = [ typing-inspect typing-extensions ]; + + # TODO FIXME + doCheck = false; + + meta = with lib; { + description = "Type system extensions for use with the pyre type checker"; + homepage = "https://pyre-check.org"; + }; +} diff --git a/packages/safetensors/Cargo.lock b/packages/safetensors/Cargo.lock new file mode 100644 index 0000000..18b535f --- /dev/null +++ b/packages/safetensors/Cargo.lock @@ -0,0 +1,597 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bumpalo" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" + +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "ciborium" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" + +[[package]] +name = "ciborium-ll" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b" +dependencies = [ + "ciborium-io", + "half", +] + +[[package]] +name = "clap" +version = "3.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +dependencies = [ + "bitflags", + "clap_lex", + "indexmap", + "textwrap", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "criterion" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" +dependencies = [ + "anes", + "atty", + "cast", + "ciborium", + "clap", + "criterion-plot", + "itertools", + "lazy_static", + "num-traits", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", +] + +[[package]] +name = "criterion-plot" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" +dependencies = [ + "cast", + "itertools", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf2b3e8478797446514c91ef04bafcb59faba183e621ad488df88983cc14128c" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "indexmap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" + +[[package]] +name = "js-sys" +version = "0.3.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.139" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "oorandom" +version = "11.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" + +[[package]] +name = "os_str_bytes" +version = "6.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" + +[[package]] +name = "plotters" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97" +dependencies = [ + "num-traits", + "plotters-backend", + "plotters-svg", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "plotters-backend" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" + +[[package]] +name = "plotters-svg" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" +dependencies = [ + "plotters-backend", +] + +[[package]] +name = "proc-macro2" +version = "1.0.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rayon" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "regex" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" + +[[package]] +name = "ryu" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" + +[[package]] +name = "safetensors" +version = "0.2.9" +dependencies = [ + "criterion", + "serde", + "serde_json", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "serde" +version = "1.0.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" + +[[package]] +name = "web-sys" +version = "0.3.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/packages/safetensors/cargo-lock.patch b/packages/safetensors/cargo-lock.patch new file mode 100644 index 0000000..5095cec --- /dev/null +++ b/packages/safetensors/cargo-lock.patch @@ -0,0 +1,603 @@ +diff --git a/Cargo.lock b/Cargo.lock +new file mode 100644 +index 0000000..18b535f +--- /dev/null ++++ b/Cargo.lock +@@ -0,0 +1,597 @@ ++# This file is automatically @generated by Cargo. ++# It is not intended for manual editing. ++version = 3 ++ ++[[package]] ++name = "anes" ++version = "0.1.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" ++ ++[[package]] ++name = "atty" ++version = "0.2.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" ++dependencies = [ ++ "hermit-abi 0.1.19", ++ "libc", ++ "winapi", ++] ++ ++[[package]] ++name = "autocfg" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" ++ ++[[package]] ++name = "bitflags" ++version = "1.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" ++ ++[[package]] ++name = "bumpalo" ++version = "3.12.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" ++ ++[[package]] ++name = "cast" ++version = "0.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" ++ ++[[package]] ++name = "cfg-if" ++version = "1.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" ++ ++[[package]] ++name = "ciborium" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f" ++dependencies = [ ++ "ciborium-io", ++ "ciborium-ll", ++ "serde", ++] ++ ++[[package]] ++name = "ciborium-io" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" ++ ++[[package]] ++name = "ciborium-ll" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b" ++dependencies = [ ++ "ciborium-io", ++ "half", ++] ++ ++[[package]] ++name = "clap" ++version = "3.2.23" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" ++dependencies = [ ++ "bitflags", ++ "clap_lex", ++ "indexmap", ++ "textwrap", ++] ++ ++[[package]] ++name = "clap_lex" ++version = "0.2.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" ++dependencies = [ ++ "os_str_bytes", ++] ++ ++[[package]] ++name = "criterion" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" ++dependencies = [ ++ "anes", ++ "atty", ++ "cast", ++ "ciborium", ++ "clap", ++ "criterion-plot", ++ "itertools", ++ "lazy_static", ++ "num-traits", ++ "oorandom", ++ "plotters", ++ "rayon", ++ "regex", ++ "serde", ++ "serde_derive", ++ "serde_json", ++ "tinytemplate", ++ "walkdir", ++] ++ ++[[package]] ++name = "criterion-plot" ++version = "0.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" ++dependencies = [ ++ "cast", ++ "itertools", ++] ++ ++[[package]] ++name = "crossbeam-channel" ++version = "0.5.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cf2b3e8478797446514c91ef04bafcb59faba183e621ad488df88983cc14128c" ++dependencies = [ ++ "cfg-if", ++ "crossbeam-utils", ++] ++ ++[[package]] ++name = "crossbeam-deque" ++version = "0.8.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" ++dependencies = [ ++ "cfg-if", ++ "crossbeam-epoch", ++ "crossbeam-utils", ++] ++ ++[[package]] ++name = "crossbeam-epoch" ++version = "0.9.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" ++dependencies = [ ++ "autocfg", ++ "cfg-if", ++ "crossbeam-utils", ++ "memoffset", ++ "scopeguard", ++] ++ ++[[package]] ++name = "crossbeam-utils" ++version = "0.8.15" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" ++dependencies = [ ++ "cfg-if", ++] ++ ++[[package]] ++name = "either" ++version = "1.8.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" ++ ++[[package]] ++name = "half" ++version = "1.8.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" ++ ++[[package]] ++name = "hashbrown" ++version = "0.12.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" ++ ++[[package]] ++name = "hermit-abi" ++version = "0.1.19" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "hermit-abi" ++version = "0.2.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "indexmap" ++version = "1.9.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" ++dependencies = [ ++ "autocfg", ++ "hashbrown", ++] ++ ++[[package]] ++name = "itertools" ++version = "0.10.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" ++dependencies = [ ++ "either", ++] ++ ++[[package]] ++name = "itoa" ++version = "1.0.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" ++ ++[[package]] ++name = "js-sys" ++version = "0.3.61" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" ++dependencies = [ ++ "wasm-bindgen", ++] ++ ++[[package]] ++name = "lazy_static" ++version = "1.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" ++ ++[[package]] ++name = "libc" ++version = "0.2.139" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" ++ ++[[package]] ++name = "log" ++version = "0.4.17" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" ++dependencies = [ ++ "cfg-if", ++] ++ ++[[package]] ++name = "memoffset" ++version = "0.8.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" ++dependencies = [ ++ "autocfg", ++] ++ ++[[package]] ++name = "num-traits" ++version = "0.2.15" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" ++dependencies = [ ++ "autocfg", ++] ++ ++[[package]] ++name = "num_cpus" ++version = "1.15.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" ++dependencies = [ ++ "hermit-abi 0.2.6", ++ "libc", ++] ++ ++[[package]] ++name = "once_cell" ++version = "1.17.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" ++ ++[[package]] ++name = "oorandom" ++version = "11.1.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" ++ ++[[package]] ++name = "os_str_bytes" ++version = "6.4.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" ++ ++[[package]] ++name = "plotters" ++version = "0.3.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97" ++dependencies = [ ++ "num-traits", ++ "plotters-backend", ++ "plotters-svg", ++ "wasm-bindgen", ++ "web-sys", ++] ++ ++[[package]] ++name = "plotters-backend" ++version = "0.3.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" ++ ++[[package]] ++name = "plotters-svg" ++version = "0.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" ++dependencies = [ ++ "plotters-backend", ++] ++ ++[[package]] ++name = "proc-macro2" ++version = "1.0.51" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" ++dependencies = [ ++ "unicode-ident", ++] ++ ++[[package]] ++name = "quote" ++version = "1.0.23" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" ++dependencies = [ ++ "proc-macro2", ++] ++ ++[[package]] ++name = "rayon" ++version = "1.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" ++dependencies = [ ++ "either", ++ "rayon-core", ++] ++ ++[[package]] ++name = "rayon-core" ++version = "1.10.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" ++dependencies = [ ++ "crossbeam-channel", ++ "crossbeam-deque", ++ "crossbeam-utils", ++ "num_cpus", ++] ++ ++[[package]] ++name = "regex" ++version = "1.7.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" ++dependencies = [ ++ "regex-syntax", ++] ++ ++[[package]] ++name = "regex-syntax" ++version = "0.6.28" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" ++ ++[[package]] ++name = "ryu" ++version = "1.0.12" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" ++ ++[[package]] ++name = "safetensors" ++version = "0.2.9" ++dependencies = [ ++ "criterion", ++ "serde", ++ "serde_json", ++] ++ ++[[package]] ++name = "same-file" ++version = "1.0.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" ++dependencies = [ ++ "winapi-util", ++] ++ ++[[package]] ++name = "scopeguard" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" ++ ++[[package]] ++name = "serde" ++version = "1.0.152" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" ++dependencies = [ ++ "serde_derive", ++] ++ ++[[package]] ++name = "serde_derive" ++version = "1.0.152" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn", ++] ++ ++[[package]] ++name = "serde_json" ++version = "1.0.93" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" ++dependencies = [ ++ "itoa", ++ "ryu", ++ "serde", ++] ++ ++[[package]] ++name = "syn" ++version = "1.0.109" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "unicode-ident", ++] ++ ++[[package]] ++name = "textwrap" ++version = "0.16.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" ++ ++[[package]] ++name = "tinytemplate" ++version = "1.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" ++dependencies = [ ++ "serde", ++ "serde_json", ++] ++ ++[[package]] ++name = "unicode-ident" ++version = "1.0.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" ++ ++[[package]] ++name = "walkdir" ++version = "2.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" ++dependencies = [ ++ "same-file", ++ "winapi", ++ "winapi-util", ++] ++ ++[[package]] ++name = "wasm-bindgen" ++version = "0.2.84" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" ++dependencies = [ ++ "cfg-if", ++ "wasm-bindgen-macro", ++] ++ ++[[package]] ++name = "wasm-bindgen-backend" ++version = "0.2.84" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" ++dependencies = [ ++ "bumpalo", ++ "log", ++ "once_cell", ++ "proc-macro2", ++ "quote", ++ "syn", ++ "wasm-bindgen-shared", ++] ++ ++[[package]] ++name = "wasm-bindgen-macro" ++version = "0.2.84" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" ++dependencies = [ ++ "quote", ++ "wasm-bindgen-macro-support", ++] ++ ++[[package]] ++name = "wasm-bindgen-macro-support" ++version = "0.2.84" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn", ++ "wasm-bindgen-backend", ++ "wasm-bindgen-shared", ++] ++ ++[[package]] ++name = "wasm-bindgen-shared" ++version = "0.2.84" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" ++ ++[[package]] ++name = "web-sys" ++version = "0.3.61" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" ++dependencies = [ ++ "js-sys", ++ "wasm-bindgen", ++] ++ ++[[package]] ++name = "winapi" ++version = "0.3.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" ++dependencies = [ ++ "winapi-i686-pc-windows-gnu", ++ "winapi-x86_64-pc-windows-gnu", ++] ++ ++[[package]] ++name = "winapi-i686-pc-windows-gnu" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" ++ ++[[package]] ++name = "winapi-util" ++version = "0.1.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" ++dependencies = [ ++ "winapi", ++] ++ ++[[package]] ++name = "winapi-x86_64-pc-windows-gnu" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/packages/safetensors/default.nix b/packages/safetensors/default.nix new file mode 100644 index 0000000..85707b9 --- /dev/null +++ b/packages/safetensors/default.nix @@ -0,0 +1,41 @@ +# WARNING: This file was automatically generated. You should avoid editing it. +# If you run pynixify again, the file will be either overwritten or +# deleted, and you will lose the changes you made to it. + +{ buildPythonPackage, fetchPypi, lib, torch, fetchFromGitHub, pyparsing, transformers, diffusers, setuptools-rust, rustPlatform }: + +buildPythonPackage rec { + pname = "safetensors"; + version = "0.2.8"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-JyCyCmo4x5ncp5vXbK7qwvffWFqdT31Z+n4o7/nMsn8="; + }; + + pythonRemoveDeps = [ "setuptools-rust" ]; + nativeBuildInputs = [ setuptools-rust ] ++ (with rustPlatform; [ + cargoSetupHook + rust.cargo + rust.rustc + ]); + propagatedBuildInputs = [ pyparsing torch transformers diffusers setuptools-rust ]; + sourceRoot = "${pname}-${version}"; + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src sourceRoot; + name = sourceRoot; + hash = "sha256-0yE18d+jRs5IodacuBIsmUeZJcZobLz9oLWL+tZKY18="; + patches = [ ./cargo-lock.patch ]; + }; + + patches = [ ./cargo-lock.patch ]; + + # TODO FIXME + doCheck = false; + + meta = with lib; { + description = + "A text prompt weighting and blending library for transformers-type text embedding systems"; + homepage = "https://pypi.org/project/compel/#description"; + }; +} diff --git a/packages/torchsde/default.nix b/packages/torchsde/default.nix new file mode 100644 index 0000000..316a4d4 --- /dev/null +++ b/packages/torchsde/default.nix @@ -0,0 +1,26 @@ +# WARNING: This file was automatically generated. You should avoid editing it. +# If you run pynixify again, the file will be either overwritten or +# deleted, and you will lose the changes you made to it. + +{ boltons, buildPythonPackage, fetchPypi, lib, numpy, scipy, torch, trampoline }: + +buildPythonPackage rec { + pname = "torchsde"; + version = "0.2.5"; + + src = fetchPypi { + inherit pname version; + sha256 = "0swhs2rp1hqi7qm55xh2rbcrz3qp8b2a1kvib95pmlqhavhyjar2"; + }; + + propagatedBuildInputs = [ boltons numpy scipy torch trampoline ]; + + # TODO FIXME + doCheck = false; + + meta = with lib; { + description = + "SDE solvers and stochastic adjoint sensitivity analysis in PyTorch."; + homepage = "https://github.com/google-research/torchsde"; + }; +} diff --git a/packages/trampoline/default.nix b/packages/trampoline/default.nix new file mode 100644 index 0000000..f531409 --- /dev/null +++ b/packages/trampoline/default.nix @@ -0,0 +1,29 @@ +# WARNING: This file was automatically generated. You should avoid editing it. +# If you run pynixify again, the file will be either overwritten or +# deleted, and you will lose the changes you made to it. + +{ boltons, buildPythonPackage, fetchPypi, lib, numpy, scipy, torch, fetchFromGitLab }: + +buildPythonPackage rec { + pname = "trampoline"; + version = "0.1.2"; + + src = fetchFromGitLab { + inherit pname version; + owner = "ferreum"; + repo = pname; + rev = "6ff003ed89abc4b64587227d10a6a8ba48309a83"; + sha256 = "sha256-1GK0MOF1uHhbT8qUQzr32B5HY8x3Nc0SvkjP0C21V6k="; + }; + + propagatedBuildInputs = [ ]; + + # TODO FIXME + doCheck = false; + + meta = with lib; { + description = + "This trampoline allows recursive functions to recurse virtually (or literally) infinitely. Most existing recursive functions can be converted with simple modifications."; + homepage = "https://pypi.org/project/trampoline/#description"; + }; +} diff --git a/packages/triton/default.nix b/packages/triton/default.nix new file mode 100644 index 0000000..9936422 --- /dev/null +++ b/packages/triton/default.nix @@ -0,0 +1,39 @@ +# WARNING: This file was automatically generated. You should avoid editing it. +# If you run pynixify again, the file will be either overwritten or +# deleted, and you will lose the changes you made to it. + +{ buildPythonPackage, fetchFromGitHub, lib, cmake, fetchPypi, llvm }: + +buildPythonPackage rec { + pname = "triton"; + version = "2.0.0"; + + src = fetchFromGitHub { + owner = "openai"; + repo = "triton"; + rev = "v${version}"; + sha256 = "sha256-9GZzugab+Pdt74Dj6zjlEzjj4BcJ69rzMJmqcVMxsKU="; + }; + #sourceRoot = ["source/python"]; + + LLVM_ROOT_DIR="${llvm}"; + nativeBuildInputs = [ cmake llvm ]; #llvm clang git ]; + #propagatedBuildInputs = [ torch filelock ncurses zlib pybind11 cmake-py ]; + + /* postConfigure = '' */ + /* cd .. */ + /* ''; */ + /* */ + + # TODO FIXME + doCheck = false; + + meta = with lib; { + description = "A language and compiler for custom Deep Learning operations"; + homepage = "https://github.com/openai/triton/"; + # there are no mlir support for LLVM in nixpkgs (yet). Don't think it's worth to pull in unfinished PRs and force users recompile half of llvm. After all, triton support is nice to have, not mandatory. + # https://github.com/NixOS/nixpkgs/pull/163878 + # https://github.com/openai/triton/issues/1154#issuecomment-1419455783 + broken = true; + }; +} diff --git a/packages/xformers/default.nix b/packages/xformers/default.nix new file mode 100644 index 0000000..f0a2eae --- /dev/null +++ b/packages/xformers/default.nix @@ -0,0 +1,23 @@ +# WARNING: This file was automatically generated. You should avoid editing it. +# If you run pynixify again, the file will be either overwritten or +# deleted, and you will lose the changes you made to it. + +{ buildPythonPackage, fetchPypi, lib, torch, numpy, pyre-extensions, pythonRelaxDepsHook, which }: + +buildPythonPackage rec { + pname = "xformers"; + version = "0.0.16"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-ksfwVWpo9EhkkmkbP1ZxQO4ZK1Y9kEGFtmabH4u4rlM="; + }; + nativeBuildInputs = [ pythonRelaxDepsHook which ]; + pythonRelaxDeps = [ "pyre-extensions" ]; + propagatedBuildInputs = [ torch numpy pyre-extensions /*triton*/ ]; + + # TODO FIXME + doCheck = false; + + meta = with lib; { }; +} diff --git a/python-relax-deps-hook.sh b/python-relax-deps-hook.sh new file mode 100644 index 0000000..4e201f0 --- /dev/null +++ b/python-relax-deps-hook.sh @@ -0,0 +1,114 @@ +# shellcheck shell=bash + +# Setup hook that modifies Python dependencies versions. +# +# Example usage in a derivation: +# +# { …, pythonPackages, … }: +# +# pythonPackages.buildPythonPackage { +# … +# nativeBuildInputs = [ pythonPackages.pythonRelaxDepsHook ]; +# +# # This will relax the dependency restrictions +# # e.g.: abc>1,<=2 -> abc +# pythonRelaxDeps = [ "abc" ]; +# # This will relax all dependencies restrictions instead +# # pythonRelaxDeps = true; +# # This will remove the dependency +# # e.g.: cde>1,<=2 -> +# pythonRemoveDeps = [ "cde" ]; +# # This will remove all dependencies from the project +# # pythonRemoveDeps = true; +# … +# } +# +# IMPLEMENTATION NOTES: +# +# The "Requires-Dist" dependency specification format is described in PEP 508. +# Examples that the regular expressions in this hook needs to support: +# +# Requires-Dist: foo +# -> foo +# Requires-Dist: foo[optional] +# -> foo[optional] +# Requires-Dist: foo[optional]~=1.2.3 +# -> foo[optional] +# Requires-Dist: foo[optional, xyz] (~=1.2.3) +# -> foo[optional, xyz] +# Requires-Dist: foo[optional]~=1.2.3 ; os_name = "posix" +# -> foo[optional] ; os_name = "posix" +# +# Currently unsupported: URL specs (foo @ https://example.com/a.zip). + +_pythonRelaxDeps() { + local -r metadata_file="$1" + + if [[ -z "${pythonRelaxDeps:-}" ]] || [[ "$pythonRelaxDeps" == 0 ]]; then + return + elif [[ "$pythonRelaxDeps" == 1 ]]; then + sed -i "$metadata_file" -r \ + -e 's/(Requires-Dist: [a-zA-Z0-9_.-]+\s*(\[[^]]+\])?)[^;]*(;.*)?/\1\3/' + else + for dep in $pythonRelaxDeps; do + sed -i "$metadata_file" -r \ + -e "s/(Requires-Dist: $dep\s*(\[[^]]+\])?)[^;]*(;.*)?/\1\3/" + done + fi +} + +_pythonRemoveDeps() { + local -r metadata_file="$1" + + if [[ -z "${pythonRemoveDeps:-}" ]] || [[ "$pythonRemoveDeps" == 0 ]]; then + return + elif [[ "$pythonRemoveDeps" == 1 ]]; then + sed -i "$metadata_file" \ + -e '/Requires-Dist:.*/d' + else + for dep in $pythonRemoveDeps; do + sed -i "$metadata_file" \ + -e "/Requires-Dist: $dep/d" + done + fi + +} + +pythonRelaxDepsHook() { + pushd dist + + # See https://peps.python.org/pep-0491/#escaping-and-unicode + local -r pkg_name="${pname//[^[:alnum:].]/_}-$version" + local -r unpack_dir="unpacked" + local -r metadata_file_pat="$unpack_dir/**/*.dist-info/METADATA" + echo $pkg_name + echo $metadata_file_pat + + # We generally shouldn't have multiple wheel files, but let's be safer here + for wheel in *.whl; do + @pythonInterpreter@ -m wheel unpack --dest "$unpack_dir" "$wheel" + rm -rf "$wheel" + + ls $metadata_file_pat + local -r metadata_file=$(ls $metadata_file_pat) + local -r pkg_dir=$(dirname "$metadata_file")/..; + echo $metadata_file + echo $pkg_dir + _pythonRelaxDeps "$metadata_file" + _pythonRemoveDeps "$metadata_file" + + if (( "${NIX_DEBUG:-0}" >= 1 )); then + echo "pythonRelaxDepsHook: resulting METADATA for '$wheel':" + cat "$metadata_file" + fi + + @pythonInterpreter@ -m wheel pack "$pkg_dir" + done + + # Remove the folder since it will otherwise be in the dist output. + rm -rf "$unpack_dir" + + popd +} + +postBuild+=" pythonRelaxDepsHook" diff --git a/stable-diffusion-webui b/stable-diffusion-webui deleted file mode 160000 index 737eb28..0000000 --- a/stable-diffusion-webui +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 737eb28faca8be2bb996ee0930ec77d1f7ebd939 diff --git a/webui.patch b/webui.patch deleted file mode 100644 index 74cbde5..0000000 --- a/webui.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 13dae9774101c2e8e7c757baf799552599c5b34e Mon Sep 17 00:00:00 2001 -From: William Casarin -Date: Sun, 27 Nov 2022 12:58:22 -0800 -Subject: [PATCH] nix-stable-diffusion hacks - ---- - launch.py | 12 ++++++------ - modules/paths.py | 8 ++++---- - 2 files changed, 10 insertions(+), 10 deletions(-) - -diff --git a/launch.py b/launch.py -index 8affd41..394436e 100644 ---- a/launch.py -+++ b/launch.py -@@ -176,16 +176,16 @@ def prepare_enviroment(): - - os.makedirs(dir_repos, exist_ok=True) - -- git_clone(stable_diffusion_repo, repo_dir('stable-diffusion'), "Stable Diffusion", stable_diffusion_commit_hash) -- git_clone(taming_transformers_repo, repo_dir('taming-transformers'), "Taming Transformers", taming_transformers_commit_hash) -- git_clone(k_diffusion_repo, repo_dir('k-diffusion'), "K-diffusion", k_diffusion_commit_hash) -- git_clone(codeformer_repo, repo_dir('CodeFormer'), "CodeFormer", codeformer_commit_hash) -- git_clone(blip_repo, repo_dir('BLIP'), "BLIP", blip_commit_hash) -+ #git_clone(stable_diffusion_repo, repo_dir('stable-diffusion'), "Stable Diffusion", stable_diffusion_commit_hash) -+ #git_clone(taming_transformers_repo, repo_dir('taming-transformers'), "Taming Transformers", taming_transformers_commit_hash) -+ #git_clone(k_diffusion_repo, repo_dir('k-diffusion'), "K-diffusion", k_diffusion_commit_hash) -+ #git_clone(codeformer_repo, repo_dir('CodeFormer'), "CodeFormer", codeformer_commit_hash) -+ #git_clone(blip_repo, repo_dir('BLIP'), "BLIP", blip_commit_hash) - - if not is_installed("lpips"): - run_pip(f"install -r {os.path.join(repo_dir('CodeFormer'), 'requirements.txt')}", "requirements for CodeFormer") - -- run_pip(f"install -r {requirements_file}", "requirements for Web UI") -+ #run_pip(f"install -r {requirements_file}", "requirements for Web UI") - - if update_check: - version_check(commit) -diff --git a/modules/paths.py b/modules/paths.py -index 1e7a2fb..1298c58 100644 ---- a/modules/paths.py -+++ b/modules/paths.py -@@ -19,10 +19,10 @@ assert sd_path is not None, "Couldn't find Stable Diffusion in any of: " + str(p - - path_dirs = [ - (sd_path, 'ldm', 'Stable Diffusion', []), -- (os.path.join(sd_path, '../taming-transformers'), 'taming', 'Taming Transformers', []), -- (os.path.join(sd_path, '../CodeFormer'), 'inference_codeformer.py', 'CodeFormer', []), -- (os.path.join(sd_path, '../BLIP'), 'models/blip.py', 'BLIP', []), -- (os.path.join(sd_path, '../k-diffusion'), 'k_diffusion/sampling.py', 'k_diffusion', ["atstart"]), -+ ('@taming_transformers@', 'taming', 'Taming Transformers', []), -+ ('@codeformer@', 'inference_codeformer.py', 'CodeFormer', []), -+ ('@blip@', 'models/blip.py', 'BLIP', []), -+ ('@k_diffusion@', 'k_diffusion/sampling.py', 'k_diffusion', ["atstart"]), - ] - - paths = {} --- -2.38.1 -