Skip to content

fix Mellon custom block required input handling - #13888

Merged
yiyixuxu merged 3 commits into
huggingface:mainfrom
wunianze666-netizen:fix/mellon-required-inputs
Jul 31, 2026
Merged

yiyixuxu merged 3 commits into
huggingface:mainfrom
wunianze666-netizen:fix/mellon-required-inputs

Conversation

@wunianze666-netizen

Copy link
Copy Markdown
Contributor

Summary

This PR preserves required custom block inputs when generating a Mellon config.

Motivation

While reviewing the Mellon custom block flow, I noticed that MellonPipelineConfig.from_custom_block() always emitted an empty
equired_inputs list, even when a block input was declared with
equired=True. The same code path also printed a debug line for every input.

This makes the generated Mellon schema less accurate for custom blocks and can leak noisy stdout from a library API. This came up while reading through the modular Mellon findings in #13650.

Changes

  • track required custom block inputs in rom_custom_block()
  • stop printing a debug line for each processed input
  • add a regression test covering the generated
    equired_inputs metadata

Testing

  • python -m py_compile src/diffusers/modular_pipelines/mellon_node_utils.py tests/modular_pipelines/test_modular_pipelines_custom_blocks.py

Notes

I could not run the pytest target in this local environment because pytest and the repo's development dependencies are not installed here, so I limited verification to a syntax check and a focused regression test addition.

@yiyixuxu yiyixuxu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thanks

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

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.

@wunianze666-netizen

Copy link
Copy Markdown
Contributor Author

Fixed the modular CI regression in 6ab3e4d: required_inputs is retained in the internal node spec and consumed when building node_params, but it is not part of the public node_params output. The regression test now checks the spec-level metadata and the resulting required label separately. After updating the branch to current main, the focused test passes locally on Windows (1 passed in 3.91s).

@yiyixuxu
yiyixuxu merged commit 31d400a into huggingface:main Jul 31, 2026
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants