Skip to content

Conversation

@sayakpaul
Copy link
Member

What does this PR do?

As the title suggests, this PR adds a test suite for the custom blocks in modular diffusers.

  • TestModularCustomBlocks tests for basic checks, e.g., properties, configs, components, inputs, etc. It also has a test that checks for Hub loading and its correctness.
  • TestKreaCustomBlocksIntegration checks for correct loading and also the forward pass to ensure nothing is broken as we continue to improve modular diffusers.

Notes:

  • I took the liberty to simplify the .github/workflows/pr_modular_tests.yml, getting rid of the matrix as it wasn't really needed.
  • The tests were implemented in pytest because we want to slowly move to it from unittest. pytest makes things easier to maintain long term.
  • The TestKreaCustomBlocksIntegration test suite was checked in an H100 because it is a bit heavy.

@sayakpaul sayakpaul requested review from DN6 and yiyixuxu October 29, 2025 12:55
Comment on lines +140 to +141
num_frames_per_block = 2
num_blocks = 2
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small numbers to keep the runtime small. Rest of the codebase is from
https://huggingface.co/krea/krea-realtime-video#use-it-with-%F0%9F%A7%A8-diffusers

for block in pipe.transformer.blocks:
block.self_attn.fuse_projections()

for block_idx in range(num_blocks):
Copy link
Collaborator

@yiyixuxu yiyixuxu Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so a little bit related to the idea you had here https://huggingface.slack.com/archives/C065E480NN9/p1761726088454629?thread_ts=1761713343.592699&cid=C065E480NN9

in addition to being a docstring example, I think If remote custom pipelines include an executable example string, we can also programmatically discover it and create slow tests for them in our test suite.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed over Slack, we will do it after a few days.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants