|  | 
| 13 | 13 | # limitations under the License. | 
| 14 | 14 | 
 | 
| 15 | 15 | import inspect | 
| 16 |  | -import random | 
| 17 | 16 | import unittest | 
| 18 | 17 | 
 | 
| 19 | 18 | import numpy as np | 
|  | 
| 23 | 22 | from diffusers import AutoencoderDC, SanaSprintImg2ImgPipeline, SanaTransformer2DModel, SCMScheduler | 
| 24 | 23 | from diffusers.utils.testing_utils import ( | 
| 25 | 24 |     enable_full_determinism, | 
| 26 |  | -    floats_tensor, | 
| 27 | 25 |     torch_device, | 
| 28 | 26 | ) | 
| 29 | 27 | 
 | 
|  | 
| 41 | 39 | class SanaSprintImg2ImgPipelineFastTests(PipelineTesterMixin, unittest.TestCase): | 
| 42 | 40 |     pipeline_class = SanaSprintImg2ImgPipeline | 
| 43 | 41 |     params = TEXT_GUIDED_IMAGE_VARIATION_PARAMS - { | 
| 44 |  | -        "cross_attention_kwargs", | 
| 45 | 42 |         "negative_prompt", | 
| 46 | 43 |         "negative_prompt_embeds", | 
| 47 | 44 |     } | 
| 48 | 45 |     batch_params = TEXT_GUIDED_IMAGE_VARIATION_BATCH_PARAMS - {"negative_prompt"} | 
| 49 |  | -    image_params = IMAGE_TO_IMAGE_IMAGE_PARAMS - {"negative_prompt"} | 
|  | 46 | +    image_params = IMAGE_TO_IMAGE_IMAGE_PARAMS | 
| 50 | 47 |     image_latents_params = IMAGE_TO_IMAGE_IMAGE_PARAMS | 
| 51 | 48 |     required_optional_params = frozenset( | 
| 52 | 49 |         [ | 
| @@ -136,7 +133,7 @@ def get_dummy_components(self): | 
| 136 | 133 |         return components | 
| 137 | 134 | 
 | 
| 138 | 135 |     def get_dummy_inputs(self, device, seed=0): | 
| 139 |  | -        image = floats_tensor((1, 3, 32, 32), rng=random.Random(seed)).to(device) | 
|  | 136 | +        image = torch.randn(1, 3, 32, 32, generator=generator) | 
| 140 | 137 |         if str(device).startswith("mps"): | 
| 141 | 138 |             generator = torch.manual_seed(seed) | 
| 142 | 139 |         else: | 
|  | 
0 commit comments