Correct a few trivial bugs

This commit is contained in:
Gadersd
2023-08-05 13:46:14 -04:00
committed by Ben_Kosytorz
parent 6f9f4f1f61
commit bb80c045e0
2 changed files with 6 additions and 4 deletions

View File

@@ -19,11 +19,13 @@ export TORCH_CUDA_VERSION=cu113
``` ```
### Step 2: Run the Sample Binary ### Step 2: Run the Sample Binary
Invoke the sample binary provided in the rust code, as shown below: Invoke the sample binary provided in the rust code, as shown below. Loading the burn model file
is currently very slow, but hopefully that will be rectified soon. You can also dump a torch model's weights and load that
which is currently much faster.
```bash ```bash
# Arguments: 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 --bin sample SDv1-4 7.5 20 "A half-eaten apple sitting on a desk." apple.png cargo run --release --bin sample burn SDv1-4 7.5 20 "A half-eaten apple sitting on a desk." apple
``` ```
This command will generate an image according to the provided prompt, which will be saved as 'apple.png'. This command will generate an image according to the provided prompt, which will be saved as 'apple.png'.

View File

@@ -29,7 +29,7 @@ fn main() {
let device = TchDevice::Cuda(0); let device = TchDevice::Cuda(0);
let args: Vec<String> = std::env::args().collect(); let args: Vec<String> = std::env::args().collect();
if args.len() != 6 { if args.len() != 7 {
eprintln!("Usage: {} <model_type(burn or dump)> <model_name> <unconditional_guidance_scale> <n_diffusion_steps> <prompt> <output_image_name>", args[0]); eprintln!("Usage: {} <model_type(burn or dump)> <model_name> <unconditional_guidance_scale> <n_diffusion_steps> <prompt> <output_image_name>", args[0]);
process::exit(1); process::exit(1);
} }