This commit is contained in:
Dmitriy Kholkin 2023-04-23 00:26:21 +03:00
commit abae1c7fe3
Signed by: AtaraxiaDev
GPG Key ID: FD266B810DF48DF2
5 changed files with 152 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
.direnv
venv
state
automatic

64
flake.lock generated Normal file
View File

@ -0,0 +1,64 @@
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1680392223,
"narHash": "sha256-n3g7QFr85lDODKt250rkZj2IFS3i4/8HBU2yKHO3tqw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "dcc36e45d054d7bb554c9cdab69093debd91a0b5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1681920287,
"narHash": "sha256-+/d6XQQfhhXVfqfLROJoqj3TuG38CAeoT6jO1g9r1k0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "645bc49f34fa8eff95479f0345ff57e55b53437e",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1680213900,
"narHash": "sha256-cIDr5WZIj3EkKyCgj/6j3HBH4Jj1W296z7HTcWj1aMA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e3652e0735fbec227f342712f180f4f21f0594f2",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

37
flake.nix Normal file
View File

@ -0,0 +1,37 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
perSystem = { config, system, ... }:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
python3 = pkgs.python310;
python3Packages = pkgs.python310Packages;
in rec {
devShells.default = pkgs.mkShell rec {
packages = with pkgs; [
rocm-runtime
pciutils
git
python3
python3Packages.virtualenv
stdenv.cc.cc.lib
stdenv.cc
ncurses5
binutils
gitRepo gnupg autoconf curl
procps gnumake util-linux m4 gperf unzip
libGLU libGL
glib
];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath packages;
};
};
};
}

1
negative.txt Normal file
View File

@ -0,0 +1 @@
lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, out of focus, censorship, (multiple boys, multiple characters, multiple girls, multiple views:1.2), boobplate, NEGS Bad Artist Anime by nick-x-hacker, NEGS Bad Artist OG by nick-x-hacker, NEGS Bad Hands, NEGS Bad Image v4 Xynon, NEGS Bad Prompt v2 by Nerfgun3, NEGS Easy Negative, nsfw

46
start-webui.sh Executable file
View File

@ -0,0 +1,46 @@
#!/usr/bin/env bash
STATE_DIR=$(pwd)/state
export TRANSFORMERS_CACHE="${STATE_DIR}/cache/transformers_cache"
# export TORCH_COMMAND="pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/rocm5.4.2"
export TORCH_COMMAND="torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.4.2"
export XFORMERS_PACKAGE="none"
export HSA_OVERRIDE_GFX_VERSION=10.3.0
export HCC_AMDGPU_TARGET=gfx1030
# cmdline_options="--ui-settings-file=${STATE_DIR}/configs/config.json"
# cmdline_options="${cmdline_options} --ui-config-file=${STATE_DIR}/configs/ui-config.json"
# cmdline_options="${cmdline_options} --styles-file=${STATE_DIR}/configs/styles.csv"
# cmdline_options="${cmdline_options} --ckpt-dir=${STATE_DIR}/stable-diffusion"
# cmdline_options="${cmdline_options} --vae-dir=${STATE_DIR}/vae"
# cmdline_options="${cmdline_options} --hypernetwork-dir=${STATE_DIR}/hypernetworks"
# cmdline_options="${cmdline_options} --embeddings-dir=${STATE_DIR}/embeddings"
# cmdline_options="${cmdline_options} --bsrgan-models-path=${STATE_DIR}/models/BSRGAN"
# cmdline_options="${cmdline_options} --clip-models-path=${STATE_DIR}/models/clip"
# cmdline_options="${cmdline_options} --codeformer-models-path=${STATE_DIR}/models/Codeformer"
# # cmdline_options="${cmdline_options} --codeformer-models-path=${STATE_DIR}/models/ControlNet"
# cmdline_options="${cmdline_options} --esrgan-models-path=${STATE_DIR}/models/ESRGAN"
# cmdline_options="${cmdline_options} --gfpgan-models-path=${STATE_DIR}/models/GFPGAN"
# # cmdline_options="${cmdline_options} --gfpgan-models-path=${STATE_DIR}/models/karlo"
# cmdline_options="${cmdline_options} --ldsr-models-path=${STATE_DIR}/models/LDSR"
# cmdline_options="${cmdline_options} --realesrgan-models-path=${STATE_DIR}/models/REALESRGAN"
# cmdline_options="${cmdline_options} --scunet-models-path=${STATE_DIR}/models/ScuNET"
# cmdline_options="${cmdline_options} --swinir-models-path=${STATE_DIR}/models/SwinIR"
# cmdline_options="--data-dir=${STATE_DIR}/data"
# cmdline_options="${cmdline_options} --models-dir=${STATE_DIR}/models"
cmdline_options="--theme dark --medvram --token-merging"
# cmdline_options="--autolaunch --no-download-sd-model --deepdanbooru"
ln -sf "$(pwd)/automatic/models/Stable-diffusion" "${STATE_DIR}/stable-diffusion"
ln -sf "$(pwd)/automatic/outputs" "${STATE_DIR}/outputs"
if [ ! -d "venv" ]; then
# python -m venv --system-site-packages venv
python -m venv venv
fi
source venv/bin/activate
cd automatic
python launch.py $cmdline_options "$@"
cd ..