mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
dfcf38be91
- Implement new model loader and modify invocations and embeddings - Finish implementation loaders for all models currently supported by InvokeAI. - Move lora, textual_inversion, and model patching support into backend/embeddings. - Restore support for model cache statistics collection (a little ugly, needs work). - Fixed up invocations that load and patch models. - Move seamless and silencewarnings utils into better location
31 lines
1009 B
Python
31 lines
1009 B
Python
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
from invokeai.backend.model_manager import BaseModelType, ModelRepoVariant
|
|
from invokeai.backend.model_manager.probe import VaeFolderProbe
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"vae_path,expected_type",
|
|
[
|
|
("sd-vae-ft-mse", BaseModelType.StableDiffusion1),
|
|
("sdxl-vae", BaseModelType.StableDiffusionXL),
|
|
("taesd", BaseModelType.StableDiffusion1),
|
|
("taesdxl", BaseModelType.StableDiffusionXL),
|
|
],
|
|
)
|
|
def test_get_base_type(vae_path: str, expected_type: BaseModelType, datadir: Path):
|
|
sd1_vae_path = datadir / "vae" / vae_path
|
|
probe = VaeFolderProbe(sd1_vae_path)
|
|
base_type = probe.get_base_type()
|
|
assert base_type == expected_type
|
|
repo_variant = probe.get_repo_variant()
|
|
assert repo_variant == ModelRepoVariant.DEFAULT
|
|
|
|
|
|
def test_repo_variant(datadir: Path):
|
|
probe = VaeFolderProbe(datadir / "vae" / "taesdxl-fp16")
|
|
repo_variant = probe.get_repo_variant()
|
|
assert repo_variant == ModelRepoVariant.FP16
|