Skip to content

_get_checkpoint_shard_files offline mode fix #12132

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 and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Teriks
Copy link
Contributor

@Teriks Teriks commented Aug 12, 2025

What does this PR do?

_get_checkpoint_shard_files makes a network call with hf_api.model_info when local_files_only is True or when offline mode envvars are present.

This call is used to pre-validate shard files exist before downloading additional files.

This can be delayed until after snapshot_download when in offline mode, in the case that snapshot_download is going to pull from the hub cache.

This fixes issues with using SD3 / Flux checkpoints in offline mode, as they rely on models that are sharded and hit this code path.

Before submitting

Who can review?

@sayakpaul @yiyixuxu @DN6

Teriks added a commit to Teriks/dgenerate that referenced this pull request Aug 12, 2025
Create vendored configs and other generated assets in refactored assetgen build
system which handles generated assets for the project.

Redirect to dgenerate.pipelinewrapper.hub_configs when possible in
--offline-mode

This allows loading single file checkpoints for SD1.5, SD2, SD3, and
Flux without ever connecting to the hub even once.

You must download and specify a VAE on disk manually for Flux and SD3
for single file loads.

This behavior is patched into huggingface_hub and diffusers dynamically
and active when --offline-mode is enabled.

Patch in fix for diffusers not honoring offline mode for sharded
checkpoints: huggingface/diffusers#12132
@sayakpaul
Copy link
Member

#12005

@Teriks
Copy link
Contributor Author

Teriks commented Aug 13, 2025

#12005

Hmm, I should have went looking

@Teriks Teriks closed this Aug 13, 2025
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.

2 participants