[Modular] Allow custom blocks to be saved to local_dir by DN6 · Pull Request #12381 · huggingface/diffusers (original) (raw)

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation7 Commits2 Checks18 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

@DN6

What does this PR do?

Make it so that custom blocks can be saved to local_dir so that they are easy to edit.

Fixes # (issue)

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@DN6

DN6

module_file=module_file,
class_name=class_name,
**hub_kwargs,
**kwargs,

Choose a reason for hiding this comment

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

Removing this since it's not used anywhere downstream.

@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.

@DN6

@yiyixuxu

@yiyixuxu

ohh but i thought you have a pretrained_model_name_or_path that's local, it would work already?

florence-2-custom-block is a local directory i have here

from diffusers import ModularPipelineBlocks Modular Diffusers is currently an experimental feature under active development. The API is subject to breaking changes in future releases. blocks = ModularPipelineBlocks.from_pretrained("florence-2-custom-block", trust_remote_code=True) trust_remote_code is enabled. Downloading code from florence-2-custom-block. Please ensure you trust the contents of this repository blocks Florence2ImageAnnotatorBlock { "_class_name": "Florence2ImageAnnotatorBlock", "_diffusers_version": "0.36.0.dev0" }

@DN6

@yiyixuxu This is for saving to a local dir from the Hub. Loading from local works currently.

@yiyixuxu

ohh so when you do from_pretrained() it will also save to a local directory, got it

yiyixuxu

Choose a reason for hiding this comment

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

thanks

@DN6 DN6 added the roadmap

Add to current release roadmap

label

Nov 10, 2025

Labels

roadmap

Add to current release roadmap