Add --precision half cmd option

This commit is contained in:
huchenlei
2024-05-16 19:50:06 -04:00
parent ddb28b33a3
commit 2a8a60c2c5
6 changed files with 71 additions and 19 deletions

View File

@@ -403,6 +403,7 @@ def load_model_weights(model, checkpoint_info: CheckpointInfo, state_dict, timer
model.float()
model.alphas_cumprod_original = model.alphas_cumprod
devices.dtype_unet = torch.float32
assert shared.cmd_opts.precision != "half", "Cannot use --precision half with --no-half"
timer.record("apply float()")
else:
vae = model.first_stage_model