copied flake files

This commit is contained in:
gbtb 2022-10-17 22:06:24 +10:00
commit c5ea6436d8
4 changed files with 160 additions and 0 deletions

4
.gitmodules vendored Normal file
View File

@ -0,0 +1,4 @@
[submodule "InvokeAI"]
path = InvokeAI
url = https://github.com/invoke-ai/InvokeAI
branch = main

1
InvokeAI Submodule

@ -0,0 +1 @@
Subproject commit ca6385e6fa3e2b53239bc68f19762ce566b60de6

43
flake.lock Normal file
View File

@ -0,0 +1,43 @@
{
"nodes": {
"nixlib": {
"locked": {
"lastModified": 1665277441,
"narHash": "sha256-TTuO5F7sStTBL/twYMSnRakrw1l7FqAYulN7+HPYjqc=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "76ef73e385f96bb438676cf5f21f220694fd3d73",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1664780719,
"narHash": "sha256-Oxe6la5dSqRfJogjtY4sRzJjDDqvroJIVkcGEOT87MA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fd54651f5ffb4a36e8463e0c327a78442b26cbe7",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fd54651f5ffb4a36e8463e0c327a78442b26cbe7",
"type": "github"
}
},
"root": {
"inputs": {
"nixlib": "nixlib",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

112
flake.nix Normal file
View File

@ -0,0 +1,112 @@
{
description = "A very basic flake";
inputs = {
nixlib.url = "github:nix-community/nixpkgs.lib";
nixpkgs = {
url = "github:NixOS/nixpkgs?rev=fd54651f5ffb4a36e8463e0c327a78442b26cbe7";
};
};
outputs = { self, nixpkgs, nixlib }@inputs:
let
nixlib = inputs.nixlib.outputs.lib;
supportedSystems = [ "x86_64-linux" ];
forAll = nixlib.genAttrs supportedSystems;
in
{
devShells = forAll
(system:
let
nixpkgs_ = import inputs.nixpkgs {
inherit system;
overlays = [
(final: prev: {
#blas = prev.blas.override {
# blasProvider = final.mkl;
#};
#lapack = prev.lapack.override {
# lapackProvider = final.mkl;
#};
python3 = prev.python3.override {
packageOverrides =
python-self: python-super: {
pytorch-lightning = python-super.pytorch-lightning.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [ prev.python3Packages.pythonRelaxDepsHook ];
pythonRelaxDeps = [ "protobuf" ];
});
#numpy = python-super.numpy.override { blas = prev.mkl; };
wandb = python-super.wandb.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [ prev.python3Packages.pythonRelaxDepsHook ];
pythonRelaxDeps = [ "protobuf" ];
});
torch-bin = python-super.torch-bin.overrideAttrs (old: {
src = prev.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=";
};
});
torchvision-bin = python-super.torchvision-bin.overrideAttrs (old: {
src = prev.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=";
};
});
streamlit = prev.streamlit.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [ prev.python3Packages.pythonRelaxDepsHook ];
pythonRelaxDeps = [ "protobuf" ];
});
} //
((import ./pynixify/overlay.nix) python-self python-super);
};
})
];
};
in
{
default = nixpkgs_.mkShell
{
name = "stable-diffusion-flake";
propagatedBuildInputs = with nixpkgs_; with nixpkgs_.python3.pkgs; [
python3
pip
virtualenv
torch-bin
torchvision
numpy
albumentations
opencv4
pudb
imageio
imageio-ffmpeg
pytorch-lightning
protobuf3_20
omegaconf
realesrgan
test-tube
streamlit
send2trash
pillow
einops
taming-transformers-rom1504
torch-fidelity
transformers
torchmetrics
flask
flask-socketio
flask-cors
dependency-injector
eventlet
kornia
clip #?
k-diffusion
gfpgan
];
};
});
};
}