fix invokeai_configure script to work with new mm; rename CLIs

This commit is contained in:
Lincoln Stein
2024-02-09 16:42:33 -05:00
committed by psychedelicious
parent 78ef946e01
commit db340bc253
13 changed files with 686 additions and 692 deletions

View File

@ -1,7 +1,7 @@
from __future__ import annotations
from contextlib import nullcontext
from typing import Optional, Union
from typing import Literal, Optional, Union
import torch
from torch import autocast
@ -31,7 +31,9 @@ def choose_torch_device() -> torch.device:
# We are in transition here from using a single global AppConfig to allowing multiple
# configurations. It is strongly recommended to pass the app_config to this function.
def choose_precision(device: torch.device, app_config: Optional[InvokeAIAppConfig] = None) -> str:
def choose_precision(
device: torch.device, app_config: Optional[InvokeAIAppConfig] = None
) -> Literal["float32", "float16", "bfloat16"]:
"""Return an appropriate precision for the given torch device."""
app_config = app_config or config
if device.type == "cuda":