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
6 changes: 0 additions & 6 deletions docs/source/en/api/pipelines/minimax_h3.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ specific language governing permissions and limitations under the License. -->

# MiniMax-H3

<!-- Remove this note once MiniMax-H3 is part of a diffusers release. -->
> [!TIP]
> MiniMax-H3 is not part of a diffusers release yet. Install diffusers from source to use it:
> `pip install git+https://github.com/huggingface/diffusers.git`


MiniMax-H3 generates video and its soundtrack together. A single transformer denoises one packed sequence containing the text conditioning, conditioning media, and target video and audio latents. There is no separate vocoder and no audio post-hoc pass: video and audio come out of the same denoising loop.

You can find the original MiniMax-H3 checkpoints under the [MiniMaxAI](https://huggingface.co/MiniMaxAI) organization.
Expand Down
118 changes: 0 additions & 118 deletions tests/modular_pipelines/anima/test_modular_pipeline_anima.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,13 @@

import numpy as np
import PIL.Image
import pytest
import torch
from transformers import Qwen2Tokenizer, Qwen3Config, Qwen3Model, T5TokenizerFast

from diffusers import (
AnimaAutoBlocks,
AnimaModularPipeline,
AnimaTextConditioner,
AutoencoderKLQwenImage,
CosmosTransformer3DModel,
FlowMatchEulerDiscreteScheduler,
)

from ...testing_utils import enable_full_determinism, require_peft_backend
Expand All @@ -37,12 +33,6 @@
enable_full_determinism()


# TODO: `hf-internal-testing/tiny-anima-modular-pipe` carries no `modular_model_index.json`, so the three tests that
# build a pipeline from it cannot run. Anima assembles its dummy components in `get_pipeline` instead, which is why
# nothing noticed until those tests arrived. Publish the tiny repository and drop the overrides below.
_NO_MODULAR_REPO = "TODO: no tiny Anima modular repository to load from yet."


ANIMA_TEXT2IMAGE_WORKFLOWS = {
"text2image": [
("text_encoder", "AnimaTextEncoderStep"),
Expand Down Expand Up @@ -72,76 +62,6 @@
}


def get_dummy_components():
torch.manual_seed(0)
transformer = CosmosTransformer3DModel(
in_channels=4,
out_channels=4,
num_attention_heads=2,
attention_head_dim=16,
num_layers=2,
mlp_ratio=2,
text_embed_dim=16,
adaln_lora_dim=4,
max_size=(4, 32, 32),
patch_size=(1, 2, 2),
rope_scale=(1.0, 4.0, 4.0),
concat_padding_mask=True,
extra_pos_embed_type=None,
)

torch.manual_seed(0)
vae = AutoencoderKLQwenImage(
base_dim=24,
z_dim=4,
dim_mult=[1, 2, 4],
num_res_blocks=1,
temperal_downsample=[False, True],
latents_mean=[0.0] * 4,
latents_std=[1.0] * 4,
)

torch.manual_seed(0)
text_conditioner = AnimaTextConditioner(
source_dim=16,
target_dim=16,
model_dim=16,
num_layers=2,
num_attention_heads=4,
target_vocab_size=32128,
min_sequence_length=16,
)

torch.manual_seed(0)
text_encoder_config = Qwen3Config(
vocab_size=152064,
hidden_size=16,
intermediate_size=32,
num_hidden_layers=2,
num_attention_heads=4,
num_key_value_heads=2,
max_position_embeddings=128,
rms_norm_eps=1e-6,
rope_theta=1000000.0,
head_dim=4,
attention_bias=False,
)
text_encoder = Qwen3Model(text_encoder_config).eval()
tokenizer = Qwen2Tokenizer.from_pretrained("hf-internal-testing/tiny-random-Qwen2VLForConditionalGeneration")
t5_tokenizer = T5TokenizerFast.from_pretrained("hf-internal-testing/tiny-random-t5")
scheduler = FlowMatchEulerDiscreteScheduler(shift=3.0)

return {
"transformer": transformer,
"vae": vae,
"scheduler": scheduler,
"text_encoder": text_encoder,
"tokenizer": tokenizer,
"t5_tokenizer": t5_tokenizer,
"text_conditioner": text_conditioner,
}


def get_dummy_image(height=32, width=32):
image_array = np.random.randint(0, 256, (height, width, 3), dtype=np.uint8)
return PIL.Image.fromarray(image_array)
Expand Down Expand Up @@ -184,25 +104,6 @@ class TestAnimaModularPipelineFast(ModularPipelineTesterMixin, ModularGuiderTest
batch_params = frozenset(["prompt", "negative_prompt"])
expected_workflow_blocks = ANIMA_TEXT2IMAGE_WORKFLOWS

@pytest.mark.skip(reason=_NO_MODULAR_REPO)
def test_from_pretrained_workflow(self):
pass

@pytest.mark.skip(reason=_NO_MODULAR_REPO)
def test_load_components_workflow(self):
pass

@pytest.mark.skip(reason=_NO_MODULAR_REPO)
def test_unload_components(self):
pass

def get_pipeline(self, components_manager=None, dtype=torch.float32):
pipe = self.pipeline_blocks_class().init_pipeline(components_manager=components_manager)
pipe.update_components(**get_dummy_components())
pipe.to(dtype=dtype)
pipe.set_progress_bar_config(disable=None)
return pipe

def get_dummy_inputs(self, seed=0):
generator = torch.Generator(device="cpu").manual_seed(seed)
return {
Expand Down Expand Up @@ -280,25 +181,6 @@ class TestAnimaImg2ImgModularPipelineFast(ModularPipelineTesterMixin):
batch_params = frozenset(["prompt", "negative_prompt"])
expected_workflow_blocks = ANIMA_IMG2IMG_WORKFLOWS

@pytest.mark.skip(reason=_NO_MODULAR_REPO)
def test_from_pretrained_workflow(self):
pass

@pytest.mark.skip(reason=_NO_MODULAR_REPO)
def test_load_components_workflow(self):
pass

@pytest.mark.skip(reason=_NO_MODULAR_REPO)
def test_unload_components(self):
pass

def get_pipeline(self, components_manager=None, torch_dtype=torch.float32):
pipe = self.pipeline_blocks_class().init_pipeline(components_manager=components_manager)
pipe.update_components(**get_dummy_components())
pipe.to(dtype=torch_dtype)
pipe.set_progress_bar_config(disable=None)
return pipe

def get_dummy_inputs(self, seed=0):
generator = torch.Generator(device="cpu").manual_seed(seed)
return {
Expand Down
16 changes: 0 additions & 16 deletions tests/modular_pipelines/flux2/test_modular_pipeline_flux2_klein.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@
from ..test_modular_pipelines_common import ModularPipelineTesterMixin


# TODO: `hf-internal-testing/tiny-flux2-klein-modular` contradicts itself — `_class_name` is
# `Flux2KleinModularPipeline` and `is_distilled` is `true`, but `_blocks_class_name` is
# `Flux2KleinBaseAutoBlocks`. `from_pretrained` honours the latter and builds the base blocks, which declare a
# `guider` the distilled ones do not, so the pipeline it returns has one component more than these blocks expect.
# Fix `_blocks_class_name` on the Hub and drop the overrides below.
_FIXTURE_NAMES_BASE_BLOCKS = "TODO: the tiny repository records `Flux2KleinBaseAutoBlocks` for a distilled checkpoint."


FLUX2_KLEIN_WORKFLOWS = {
"text2image": [
("text_encoder", "Flux2KleinTextEncoderStep"),
Expand All @@ -60,10 +52,6 @@ class TestFlux2KleinModularPipelineFast(ModularPipelineTesterMixin):
not_params = frozenset(["negative_prompt"])
expected_workflow_blocks = FLUX2_KLEIN_WORKFLOWS

@pytest.mark.skip(reason=_FIXTURE_NAMES_BASE_BLOCKS)
def test_from_pretrained_workflow(self):
pass

def get_dummy_inputs(self, seed=0):
generator = self.get_generator(seed)
inputs = {
Expand Down Expand Up @@ -110,10 +98,6 @@ class TestFlux2KleinImageConditionedModularPipelineFast(ModularPipelineTesterMix
not_params = frozenset(["negative_prompt"])
expected_workflow_blocks = FLUX2_KLEIN_IMAGE_CONDITIONED_WORKFLOWS

@pytest.mark.skip(reason=_FIXTURE_NAMES_BASE_BLOCKS)
def test_from_pretrained_workflow(self):
pass

def get_dummy_inputs(self, seed=0):
generator = self.get_generator(seed)
inputs = {
Expand Down
14 changes: 0 additions & 14 deletions tests/modular_pipelines/qwen/test_modular_pipeline_qwenimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,6 @@ def test_inference_batch_single_identical(self):
super().test_inference_batch_single_identical(expected_max_diff=5e-4)


# TODO: `hf-internal-testing/tiny-qwenimage-edit-modular` records `_class_name: QwenImageModularPipeline` and
# `_blocks_class_name: SequentialPipelineBlocks`, so `from_pretrained` falls back to `QwenImageAutoBlocks`, which
# declares no `image_conditioned` workflow. Point the repository at the Edit classes and drop the overrides below.
_FIXTURE_NAMES_BASE_PIPELINE = "TODO: the tiny repository records `QwenImageModularPipeline` for an Edit checkpoint."


QWEN_IMAGE_EDIT_WORKFLOWS = {
"image_conditioned": [
("text_encoder.resize", "QwenImageEditResizeStep"),
Expand Down Expand Up @@ -207,14 +201,6 @@ class TestQwenImageEditModularPipelineFast(ModularPipelineTesterMixin, ModularGu
batch_params = frozenset(["prompt", "negative_prompt", "image", "mask_image"])
expected_workflow_blocks = QWEN_IMAGE_EDIT_WORKFLOWS

@pytest.mark.skip(reason=_FIXTURE_NAMES_BASE_PIPELINE)
def test_from_pretrained_workflow(self):
pass

@pytest.mark.skip(reason=_FIXTURE_NAMES_BASE_PIPELINE)
def test_load_components_workflow(self):
pass

def get_dummy_inputs(self):
generator = self.get_generator()
inputs = {
Expand Down
Loading