def get_lora_type(filename: str) -> int:
    """Get the type of the Lora given the path `filename`.

    Args:
        filename (str): the Lora file path.

    Returns:
        An integer representing the Lora type (1 means SD1; 2 means SD2; 3 means SDXL).
    """
    metadata = read_lora_metadata(filename)
    if str(metadata.get("ss_base_model_version", "")).startswith("sdxl_"):
        return 3
    elif str(metadata.get("ss_v2", "")) == "True":
        return 2
    return 1
Get the type of the Lora given the path `filename`.

    Args:
        filename (str): the Lora file path.

    Returns:
        An integer representing the Lora type (1 means SD1; 2 means SD2; 3 means SDXL).
    
scripts/sdwebui.py