From a3fc01ccca90fd855e6bb7e6d93d53d981801ce4 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Wed, 11 Feb 2026 09:28:44 +0530 Subject: [PATCH] up with skyreelsv2 fixes. --- .../pipelines/skyreels_v2/test_skyreels_v2.py | 20 +++++-------------- .../skyreels_v2/test_skyreels_v2_df.py | 13 ++++-------- .../test_skyreels_v2_df_image_to_video.py | 12 +++-------- .../test_skyreels_v2_df_video_to_video.py | 14 ++++--------- .../test_skyreels_v2_image_to_video.py | 4 +--- 5 files changed, 17 insertions(+), 46 deletions(-) diff --git a/tests/pipelines/skyreels_v2/test_skyreels_v2.py b/tests/pipelines/skyreels_v2/test_skyreels_v2.py index b3f4e28493..b6adb3cc1f 100644 --- a/tests/pipelines/skyreels_v2/test_skyreels_v2.py +++ b/tests/pipelines/skyreels_v2/test_skyreels_v2.py @@ -16,22 +16,13 @@ import unittest import numpy as np import torch -from transformers import AutoConfig, AutoTokenizer, T5EncoderModel +from transformers import AutoTokenizer, T5EncoderModel -from diffusers import ( - AutoencoderKLWan, - SkyReelsV2Pipeline, - SkyReelsV2Transformer3DModel, - UniPCMultistepScheduler, -) +from diffusers import AutoencoderKLWan, SkyReelsV2Pipeline, SkyReelsV2Transformer3DModel, UniPCMultistepScheduler -from ...testing_utils import ( - enable_full_determinism, -) +from ...testing_utils import enable_full_determinism from ..pipeline_params import TEXT_TO_IMAGE_BATCH_PARAMS, TEXT_TO_IMAGE_IMAGE_PARAMS, TEXT_TO_IMAGE_PARAMS -from ..test_pipelines_common import ( - PipelineTesterMixin, -) +from ..test_pipelines_common import PipelineTesterMixin enable_full_determinism() @@ -68,8 +59,7 @@ class SkyReelsV2PipelineFastTests(PipelineTesterMixin, unittest.TestCase): torch.manual_seed(0) scheduler = UniPCMultistepScheduler(flow_shift=8.0, use_flow_sigmas=True) - config = AutoConfig.from_pretrained("hf-internal-testing/tiny-random-t5") - text_encoder = T5EncoderModel(config) + text_encoder = T5EncoderModel.from_pretrained("hf-internal-testing/tiny-random-t5") tokenizer = AutoTokenizer.from_pretrained("hf-internal-testing/tiny-random-t5") torch.manual_seed(0) diff --git a/tests/pipelines/skyreels_v2/test_skyreels_v2_df.py b/tests/pipelines/skyreels_v2/test_skyreels_v2_df.py index 35d9852815..213d085a6d 100644 --- a/tests/pipelines/skyreels_v2/test_skyreels_v2_df.py +++ b/tests/pipelines/skyreels_v2/test_skyreels_v2_df.py @@ -16,7 +16,7 @@ import unittest import numpy as np import torch -from transformers import AutoConfig, AutoTokenizer, T5EncoderModel +from transformers import AutoTokenizer, T5EncoderModel from diffusers import ( AutoencoderKLWan, @@ -25,13 +25,9 @@ from diffusers import ( UniPCMultistepScheduler, ) -from ...testing_utils import ( - enable_full_determinism, -) +from ...testing_utils import enable_full_determinism from ..pipeline_params import TEXT_TO_IMAGE_BATCH_PARAMS, TEXT_TO_IMAGE_IMAGE_PARAMS, TEXT_TO_IMAGE_PARAMS -from ..test_pipelines_common import ( - PipelineTesterMixin, -) +from ..test_pipelines_common import PipelineTesterMixin enable_full_determinism() @@ -68,8 +64,7 @@ class SkyReelsV2DiffusionForcingPipelineFastTests(PipelineTesterMixin, unittest. torch.manual_seed(0) scheduler = UniPCMultistepScheduler(flow_shift=8.0, use_flow_sigmas=True) - config = AutoConfig.from_pretrained("hf-internal-testing/tiny-random-t5") - text_encoder = T5EncoderModel(config) + text_encoder = T5EncoderModel.from_pretrained("hf-internal-testing/tiny-random-t5") tokenizer = AutoTokenizer.from_pretrained("hf-internal-testing/tiny-random-t5") torch.manual_seed(0) diff --git a/tests/pipelines/skyreels_v2/test_skyreels_v2_df_image_to_video.py b/tests/pipelines/skyreels_v2/test_skyreels_v2_df_image_to_video.py index 2764bb6dd8..02daa61395 100644 --- a/tests/pipelines/skyreels_v2/test_skyreels_v2_df_image_to_video.py +++ b/tests/pipelines/skyreels_v2/test_skyreels_v2_df_image_to_video.py @@ -17,11 +17,7 @@ import unittest import numpy as np import torch from PIL import Image -from transformers import ( - AutoConfig, - AutoTokenizer, - T5EncoderModel, -) +from transformers import AutoTokenizer, T5EncoderModel from diffusers import ( AutoencoderKLWan, @@ -69,8 +65,7 @@ class SkyReelsV2DiffusionForcingImageToVideoPipelineFastTests(PipelineTesterMixi torch.manual_seed(0) scheduler = UniPCMultistepScheduler(flow_shift=5.0, use_flow_sigmas=True) - config = AutoConfig.from_pretrained("hf-internal-testing/tiny-random-t5") - text_encoder = T5EncoderModel(config) + text_encoder = T5EncoderModel.from_pretrained("hf-internal-testing/tiny-random-t5") tokenizer = AutoTokenizer.from_pretrained("hf-internal-testing/tiny-random-t5") torch.manual_seed(0) @@ -161,8 +156,7 @@ class SkyReelsV2DiffusionForcingImageToVideoPipelineFastTests(SkyReelsV2Diffusio torch.manual_seed(0) scheduler = UniPCMultistepScheduler(flow_shift=5.0, use_flow_sigmas=True) - config = AutoConfig.from_pretrained("hf-internal-testing/tiny-random-t5") - text_encoder = T5EncoderModel(config) + text_encoder = T5EncoderModel.from_pretrained("hf-internal-testing/tiny-random-t5") tokenizer = AutoTokenizer.from_pretrained("hf-internal-testing/tiny-random-t5") torch.manual_seed(0) diff --git a/tests/pipelines/skyreels_v2/test_skyreels_v2_df_video_to_video.py b/tests/pipelines/skyreels_v2/test_skyreels_v2_df_video_to_video.py index b0f384f5a4..cbfb86f769 100644 --- a/tests/pipelines/skyreels_v2/test_skyreels_v2_df_video_to_video.py +++ b/tests/pipelines/skyreels_v2/test_skyreels_v2_df_video_to_video.py @@ -18,7 +18,7 @@ import unittest import numpy as np import torch from PIL import Image -from transformers import AutoConfig, AutoTokenizer, T5EncoderModel +from transformers import AutoTokenizer, T5EncoderModel from diffusers import ( AutoencoderKLWan, @@ -27,14 +27,9 @@ from diffusers import ( UniPCMultistepScheduler, ) -from ...testing_utils import ( - enable_full_determinism, - torch_device, -) +from ...testing_utils import enable_full_determinism, torch_device from ..pipeline_params import TEXT_TO_IMAGE_IMAGE_PARAMS, TEXT_TO_IMAGE_PARAMS -from ..test_pipelines_common import ( - PipelineTesterMixin, -) +from ..test_pipelines_common import PipelineTesterMixin enable_full_determinism() @@ -70,8 +65,7 @@ class SkyReelsV2DiffusionForcingVideoToVideoPipelineFastTests(PipelineTesterMixi torch.manual_seed(0) scheduler = UniPCMultistepScheduler(flow_shift=5.0, use_flow_sigmas=True) - config = AutoConfig.from_pretrained("hf-internal-testing/tiny-random-t5") - text_encoder = T5EncoderModel(config) + text_encoder = T5EncoderModel.from_pretrained("hf-internal-testing/tiny-random-t5") tokenizer = AutoTokenizer.from_pretrained("hf-internal-testing/tiny-random-t5") torch.manual_seed(0) diff --git a/tests/pipelines/skyreels_v2/test_skyreels_v2_image_to_video.py b/tests/pipelines/skyreels_v2/test_skyreels_v2_image_to_video.py index 77b6706db1..784f701a29 100644 --- a/tests/pipelines/skyreels_v2/test_skyreels_v2_image_to_video.py +++ b/tests/pipelines/skyreels_v2/test_skyreels_v2_image_to_video.py @@ -18,7 +18,6 @@ import numpy as np import torch from PIL import Image from transformers import ( - AutoConfig, AutoTokenizer, CLIPImageProcessor, CLIPVisionConfig, @@ -72,8 +71,7 @@ class SkyReelsV2ImageToVideoPipelineFastTests(PipelineTesterMixin, unittest.Test torch.manual_seed(0) scheduler = UniPCMultistepScheduler(flow_shift=5.0, use_flow_sigmas=True) - config = AutoConfig.from_pretrained("hf-internal-testing/tiny-random-t5") - text_encoder = T5EncoderModel(config) + text_encoder = T5EncoderModel.from_pretrained("hf-internal-testing/tiny-random-t5") tokenizer = AutoTokenizer.from_pretrained("hf-internal-testing/tiny-random-t5") torch.manual_seed(0)