Use torch by default

This commit is contained in:
Gadersd
2023-08-24 17:12:53 -04:00
committed by Ben_Kosytorz
parent d4afd71fda
commit 167e45fc30
2 changed files with 7 additions and 7 deletions

View File

@@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features] [features]
default = ["wgpu-backend"] default = ["torch-backend"]
torch-backend = ["burn-tch"] torch-backend = ["burn-tch"]
wgpu-backend = ["burn-wgpu"] wgpu-backend = ["burn-wgpu"]

View File

@@ -22,17 +22,17 @@ wget https://huggingface.co/Gadersd/Stable-Diffusion-Burn/resolve/main/V1/SDv1-4
### Step 2: Run the Sample Binary ### Step 2: Run the Sample Binary
Invoke the sample binary provided in the rust code. By default, wgpu is used which requires a gpu with at least 10 GB of VRAM (will be lower in the future), but torch can be used with the `torch-backend` feature and can run on a 6 GB gpu. Invoke the sample binary provided in the rust code. By default, torch is used. The WGPU backend is unstable for SD but may work well in the future as burn-wpu is optimized.
```bash ```bash
# wgpu (NEEDS >= 10 GB VRAM)
# Arguments: <model_type(burn or dump)> <model> <unconditional_guidance_scale> <n_diffusion_steps> <prompt> <output_image>
cargo run --release --bin sample burn SDv1-4 7.5 20 "An ancient mossy stone." img
# torch (at least 6 GB VRAM, possibly less) # torch (at least 6 GB VRAM, possibly less)
export TORCH_CUDA_VERSION=cu113 export TORCH_CUDA_VERSION=cu113
# Arguments: <model_type(burn or dump)> <model> <unconditional_guidance_scale> <n_diffusion_steps> <prompt> <output_image> # Arguments: <model_type(burn or dump)> <model> <unconditional_guidance_scale> <n_diffusion_steps> <prompt> <output_image>
cargo run --release --features torch-backend --bin sample burn SDv1-4 7.5 20 "An ancient mossy stone." img cargo run --release --bin sample burn SDv1-4 7.5 20 "An ancient mossy stone." img
# wgpu (UNSTABLE)
# Arguments: <model_type(burn or dump)> <model> <unconditional_guidance_scale> <n_diffusion_steps> <prompt> <output_image>
cargo run --release --features wgpu-backend --bin sample burn SDv1-4 7.5 20 "An ancient mossy stone." img
``` ```
This command will generate an image according to the provided prompt, which will be saved as 'img0.png'. This command will generate an image according to the provided prompt, which will be saved as 'img0.png'.