mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-23 04:40:15 +08:00
Further fixes to unit tests when running in GitHub
This commit is contained in:
parent
cb45b86b63
commit
acd98ceef3
@ -31,18 +31,30 @@ _latent = {"samples": torch.randn((1, 4, 64, 64))}
|
|||||||
|
|
||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(scope="module")
|
||||||
def vae():
|
def vae():
|
||||||
vae, = VAELoader().load_vae("vae-ft-mse-840000-ema-pruned.safetensors")
|
vae_file = "vae-ft-mse-840000-ema-pruned.safetensors"
|
||||||
|
try:
|
||||||
|
vae, = VAELoader().load_vae(vae_file)
|
||||||
|
except FileNotFoundError:
|
||||||
|
pytest.skip(f"{vae_file} not present on machine")
|
||||||
return vae
|
return vae
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(scope="module")
|
||||||
def clip(vae):
|
def clip():
|
||||||
return CheckpointLoaderSimple().load_checkpoint("v1-5-pruned-emaonly.safetensors")[1]
|
checkpoint = "v1-5-pruned-emaonly.safetensors"
|
||||||
|
try:
|
||||||
|
return CheckpointLoaderSimple().load_checkpoint(checkpoint)[1]
|
||||||
|
except FileNotFoundError:
|
||||||
|
pytest.skip(f"{checkpoint} not present on machine")
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(scope="module")
|
||||||
def model(clip, vae):
|
def model(clip):
|
||||||
return CheckpointLoaderSimple().load_checkpoint("v1-5-pruned-emaonly.safetensors")[0]
|
checkpoint = "v1-5-pruned-emaonly.safetensors"
|
||||||
|
try:
|
||||||
|
return CheckpointLoaderSimple().load_checkpoint(checkpoint)[0]
|
||||||
|
except FileNotFoundError:
|
||||||
|
pytest.skip(f"{checkpoint} not present on machine")
|
||||||
|
|
||||||
|
|
||||||
def test_clip_text_encode(clip):
|
def test_clip_text_encode(clip):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user