Skip to content

Commit 2ed7e05

Browse files
authored
Improve performance of fast test by reducing down blocks (#5290)
* Reduce number of down block channels * Remove debug code * Set new excepted image slice values for sdxl euler test
1 parent cc2c4ae commit 2ed7e05

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class StableDiffusionXLPipelineFastTests(PipelineLatentTesterMixin, PipelineTest
5151
def get_dummy_components(self):
5252
torch.manual_seed(0)
5353
unet = UNet2DConditionModel(
54-
block_out_channels=(32, 64),
54+
block_out_channels=(2, 4),
5555
layers_per_block=2,
5656
sample_size=32,
5757
in_channels=4,
@@ -66,6 +66,7 @@ def get_dummy_components(self):
6666
transformer_layers_per_block=(1, 2),
6767
projection_class_embeddings_input_dim=80, # 6 * 8 + 32
6868
cross_attention_dim=64,
69+
norm_num_groups=1,
6970
)
7071
scheduler = EulerDiscreteScheduler(
7172
beta_start=0.00085,
@@ -144,7 +145,7 @@ def test_stable_diffusion_xl_euler(self):
144145
image_slice = image[0, -3:, -3:, -1]
145146

146147
assert image.shape == (1, 64, 64, 3)
147-
expected_slice = np.array([0.5873, 0.6128, 0.4797, 0.5122, 0.5674, 0.4639, 0.5227, 0.5149, 0.4747])
148+
expected_slice = np.array([0.5552, 0.5569, 0.4725, 0.4348, 0.4994, 0.4632, 0.5142, 0.5012, 0.47])
148149

149150
assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-2
150151

0 commit comments

Comments
 (0)