mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-27 17:22:53 +03:00
[CI] fix nightly model tests (#9483)
* check if default attn procs fix it. * print * print * replace * style./ * replace revision with variant. * replace with stable-diffusion-v1-5/stable-diffusion-inpainting. * replace with stable-diffusion-v1-5/stable-diffusion-v1-5. * fix
This commit is contained in:
@@ -651,12 +651,12 @@ class AutoencoderKLIntegrationTests(unittest.TestCase):
|
||||
# fmt: off
|
||||
[
|
||||
33,
|
||||
[-0.1603, 0.9878, -0.0495, -0.0790, -0.2709, 0.8375, -0.2060, -0.0824],
|
||||
[-0.1556, 0.9848, -0.0410, -0.0642, -0.2685, 0.8381, -0.2004, -0.0700],
|
||||
[-0.2395, 0.0098, 0.0102, -0.0709, -0.2840, -0.0274, -0.0718, -0.1824],
|
||||
],
|
||||
[
|
||||
47,
|
||||
[-0.2376, 0.1168, 0.1332, -0.4840, -0.2508, -0.0791, -0.0493, -0.4089],
|
||||
[-0.2376, 0.1200, 0.1337, -0.4830, -0.2504, -0.0759, -0.0486, -0.4077],
|
||||
[0.0350, 0.0847, 0.0467, 0.0344, -0.0842, -0.0547, -0.0633, -0.1131],
|
||||
],
|
||||
# fmt: on
|
||||
@@ -886,7 +886,7 @@ class AsymmetricAutoencoderKLIntegrationTests(unittest.TestCase):
|
||||
# fmt: off
|
||||
[
|
||||
33,
|
||||
[-0.0344, 0.2912, 0.1687, -0.0137, -0.3462, 0.3552, -0.1337, 0.1078],
|
||||
[-0.0336, 0.3011, 0.1764, 0.0087, -0.3401, 0.3645, -0.1247, 0.1205],
|
||||
[-0.1603, 0.9878, -0.0495, -0.0790, -0.2709, 0.8375, -0.2060, -0.0824],
|
||||
],
|
||||
[
|
||||
|
||||
@@ -1210,11 +1210,11 @@ class UNet2DConditionModelIntegrationTests(unittest.TestCase):
|
||||
return image
|
||||
|
||||
def get_unet_model(self, fp16=False, model_id="CompVis/stable-diffusion-v1-4"):
|
||||
revision = "fp16" if fp16 else None
|
||||
variant = "fp16" if fp16 else None
|
||||
torch_dtype = torch.float16 if fp16 else torch.float32
|
||||
|
||||
model = UNet2DConditionModel.from_pretrained(
|
||||
model_id, subfolder="unet", torch_dtype=torch_dtype, revision=revision
|
||||
model_id, subfolder="unet", torch_dtype=torch_dtype, variant=variant
|
||||
)
|
||||
model.to(torch_device).eval()
|
||||
|
||||
@@ -1376,7 +1376,7 @@ class UNet2DConditionModelIntegrationTests(unittest.TestCase):
|
||||
@require_torch_accelerator
|
||||
@skip_mps
|
||||
def test_compvis_sd_v1_5(self, seed, timestep, expected_slice):
|
||||
model = self.get_unet_model(model_id="Jiali/stable-diffusion-1.5")
|
||||
model = self.get_unet_model(model_id="stable-diffusion-v1-5/stable-diffusion-v1-5")
|
||||
latents = self.get_latents(seed)
|
||||
encoder_hidden_states = self.get_encoder_hidden_states(seed)
|
||||
|
||||
@@ -1404,7 +1404,7 @@ class UNet2DConditionModelIntegrationTests(unittest.TestCase):
|
||||
)
|
||||
@require_torch_accelerator_with_fp16
|
||||
def test_compvis_sd_v1_5_fp16(self, seed, timestep, expected_slice):
|
||||
model = self.get_unet_model(model_id="Jiali/stable-diffusion-1.5", fp16=True)
|
||||
model = self.get_unet_model(model_id="stable-diffusion-v1-5/stable-diffusion-v1-5", fp16=True)
|
||||
latents = self.get_latents(seed, fp16=True)
|
||||
encoder_hidden_states = self.get_encoder_hidden_states(seed, fp16=True)
|
||||
|
||||
@@ -1433,7 +1433,7 @@ class UNet2DConditionModelIntegrationTests(unittest.TestCase):
|
||||
@require_torch_accelerator
|
||||
@skip_mps
|
||||
def test_compvis_sd_inpaint(self, seed, timestep, expected_slice):
|
||||
model = self.get_unet_model(model_id="botp/stable-diffusion-v1-5-inpainting")
|
||||
model = self.get_unet_model(model_id="stable-diffusion-v1-5/stable-diffusion-inpainting")
|
||||
latents = self.get_latents(seed, shape=(4, 9, 64, 64))
|
||||
encoder_hidden_states = self.get_encoder_hidden_states(seed)
|
||||
|
||||
@@ -1461,7 +1461,7 @@ class UNet2DConditionModelIntegrationTests(unittest.TestCase):
|
||||
)
|
||||
@require_torch_accelerator_with_fp16
|
||||
def test_compvis_sd_inpaint_fp16(self, seed, timestep, expected_slice):
|
||||
model = self.get_unet_model(model_id="botp/stable-diffusion-v1-5-inpainting", fp16=True)
|
||||
model = self.get_unet_model(model_id="stable-diffusion-v1-5/stable-diffusion-inpainting", fp16=True)
|
||||
latents = self.get_latents(seed, shape=(4, 9, 64, 64), fp16=True)
|
||||
encoder_hidden_states = self.get_encoder_hidden_states(seed, fp16=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user