Commit 0dc74545 authored by AUTOMATIC1111's avatar AUTOMATIC1111
Browse files

resolve the issue with loading fp16 checkpoints while using --no-half

parent eaba3d73
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -343,7 +343,10 @@ def load_model_weights(model, checkpoint_info: CheckpointInfo, state_dict, timer
        model.to(memory_format=torch.channels_last)
        timer.record("apply channels_last")

    if not shared.cmd_opts.no_half:
    if shared.cmd_opts.no_half:
        model.float()
        timer.record("apply float()")
    else:
        vae = model.first_stage_model
        depth_model = getattr(model, 'depth_model', None)