docs: clarify README

Make the CPU output non-default, so you must specifically choose which
output you actually want.
This commit is contained in:
Vir Chaudhury 2023-11-22 05:31:13 +08:00
parent 32b2517441
commit 5b5c18e45f
No known key found for this signature in database
GPG Key ID: 25B242ED74B61B15
4 changed files with 17 additions and 10 deletions

View File

@ -7,24 +7,29 @@ This supports NVIDIA GPUs (using CUDA), AMD GPUs (using ROCm), and CPU compute (
### Setup
First, run:
```bash
git clone https://github.com/virchau13/automatic1111-webui-nix
cd automatic1111-webui-nix
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
cp automatic1111-webui-nix/*.nix stable-diffusion-webui/
cd stable-diffusion-webui
git add *.nix
```
### Flakes
After that, choose the command according to your platform:
#### Flakes
```bash
nix develop # CPU or Apple silicon
nix develop .#cpu # CPU or Apple silicon
nix develop .#cuda # CUDA
nix develop .#rocm # ROCm
```
### Non-flakes
#### Non-flakes
```bash
nix-shell # CPU
nix-shell --argstr variant CPU # CPU
nix-shell --argstr variant CUDA # CUDA
nix-shell --argstr variant ROCM # ROCm
```
@ -52,5 +57,5 @@ Run `./webui.sh --xformers` to set up xformers. If this command fails, try git p
## Credits
- AUTOMATIC1111 for obvious reasons.
- rprospero for [ROCm support](https://github.com/virchau13/automatic1111-webui-nix/pull/3).
- Cloudef for [CPU compute / Apple Silicon support](https://github.com/virchau13/automatic1111-webui-nix/pull/10)
- Cloudef for [CPU compute / Apple Silicon support](https://github.com/virchau13/automatic1111-webui-nix/pull/10).
- polypoyo for [the original draft of this](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/4736).

View File

@ -13,7 +13,8 @@
config.allowUnfree = true;
};
in {
devShells.default = import ./impl.nix { inherit pkgs; variant = "CPU"; };
devShells.default = throw "You need to specify which output you want: CPU, ROCm, or CUDA.";
devShells.cpu = import ./impl.nix { inherit pkgs; variant = "CPU"; };
devShells.cuda = import ./impl.nix { inherit pkgs; variant = "CUDA"; };
devShells.rocm = import ./impl.nix { inherit pkgs; variant = "ROCM"; };
}

View File

@ -1,4 +1,4 @@
{ pkgs, variant ? "CUDA", ... }:
{ pkgs, variant, ... }:
let
hardware_deps = with pkgs;
@ -19,7 +19,8 @@ let
] else if variant == "ROCM" then [
rocmPackages.rocm-runtime
pciutils
] else [];
] else if variant == "CPU" then [
] else throw "You need to specify which variant you want: CPU, ROCm, or CUDA.";
in
pkgs.mkShell rec {

View File

@ -1,4 +1,4 @@
{ variant ? "CUDA" }:
{ variant ? "NONE" }:
let pkgs = import <nixpkgs> { };
in import ./impl.nix { inherit pkgs variant; }