1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-10-24 20:59:27 +03:00
Files
diffusers/tests/modular_pipelines/echo/testing_utils.py
Sayak Paul cff9dafbbf [modular] Echo team joy future academy jd echo by @Gelercatty (#14941)
* Add Echo modular pipeline

* Address Echo modular pipeline review feedback

* Inline Echo input list normalization

* Align Echo latent boundaries and batch expansion

* Polish Echo documentation per review

* Load official Echo checkpoint and separate block tests

* consolidate testing.

* formatting

---------

Co-authored-by: Yanwen Ma <gelercat117@gmail.com>
2026-10-05 14:04:27 +05:30

65 lines
2.2 KiB
Python

# coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import torch
from diffusers.modular_pipelines import EchoBlocks, EchoModularPipeline
from ..testing_utils import BaseModularPipelineTesterConfig
class EchoModularPipelineTesterConfig(BaseModularPipelineTesterConfig):
pipeline_class = EchoModularPipeline
pipeline_blocks_class = EchoBlocks
pretrained_model_name_or_path = "Echo-Team/tiny-echo-modular-pipe"
params = frozenset(
[
"prompt",
"image",
"memory_images",
"memory_audio_waveforms",
"height",
"width",
"num_frames",
"frame_rate",
"model_frame_rate",
"sigmas",
]
)
batch_params = frozenset(["prompt"])
optional_params = frozenset(["num_videos_per_prompt", "latents", "audio_latents", "output_type"])
not_params = frozenset(["negative_prompt", "guidance_scale", "num_inference_steps"])
expected_workflow_blocks = {}
output_name = "videos"
def get_dummy_inputs(self, seed=0):
generator = self.get_generator(seed)
return {
"prompt": "a robot dancing",
"image": torch.rand((1, 3, 32, 32), generator=generator),
"memory_images": [
torch.rand((1, 3, 32, 32), generator=generator),
torch.rand((1, 3, 32, 32), generator=generator),
],
"generator": self.get_generator(seed),
"sigmas": [1.0, 0.0],
"height": 32,
"width": 32,
"num_frames": 5,
"frame_rate": 25.0,
"max_sequence_length": 16,
"output_type": "pt",
}