Skip to content

Commit

Permalink
use a PIL image
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Jan 10, 2025
1 parent 764087c commit a3b2608
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/onnxruntime/test_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
DiffusionPipeline,
)
from diffusers.pipelines.stable_diffusion import StableDiffusionSafetyChecker
from diffusers.utils import load_image
from parameterized import parameterized
from PIL import Image
from transformers.testing_utils import require_torch_gpu
from utils_onnxruntime_tests import MODEL_NAMES, SEED, ORTModelTestMixin

Expand Down Expand Up @@ -60,7 +60,10 @@ def _generate_prompts(batch_size=1):

def _generate_images(height=128, width=128, batch_size=1, channel=3, input_type="pil"):
if input_type == "pil":
image = Image.new("RGB", (width, height))
image = load_image(
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main"
"/in_paint/overture-creations-5sI6fQgYIuo.png"
).resize((width, height))
elif input_type == "np":
image = np.random.rand(height, width, channel)
elif input_type == "pt":
Expand Down

0 comments on commit a3b2608

Please sign in to comment.