Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/pipelines/sana/test_sana_controlnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
enable_full_determinism,
torch_device,
)
from diffusers.utils.torch_utils import randn_tensor

from ..pipeline_params import TEXT_TO_IMAGE_BATCH_PARAMS, TEXT_TO_IMAGE_IMAGE_PARAMS, TEXT_TO_IMAGE_PARAMS
from ..test_pipelines_common import PipelineTesterMixin, to_np
Expand Down Expand Up @@ -151,7 +152,7 @@ def get_dummy_inputs(self, device, seed=0):
else:
generator = torch.Generator(device=device).manual_seed(seed)

control_image = torch.randn(1, 3, 32, 32, generator=generator)
control_image = randn_tensor((1, 3, 32, 32), generator=generator, device=device)
inputs = {
"prompt": "",
"negative_prompt": "",
Expand Down
3 changes: 2 additions & 1 deletion tests/pipelines/sana/test_sana_sprint_img2img.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
enable_full_determinism,
torch_device,
)
from diffusers.utils.torch_utils import randn_tensor

from ..pipeline_params import (
IMAGE_TO_IMAGE_IMAGE_PARAMS,
Expand Down Expand Up @@ -137,7 +138,7 @@ def get_dummy_inputs(self, device, seed=0):
generator = torch.manual_seed(seed)
else:
generator = torch.Generator(device=device).manual_seed(seed)
image = torch.randn(1, 3, 32, 32, generator=generator)
image = randn_tensor((1, 3, 32, 32), generator=generator, device=device)
inputs = {
"prompt": "",
"image": image,
Expand Down