Skip to content

Conversation

@DN6
Copy link
Collaborator

@DN6 DN6 commented Sep 24, 2025

What does this PR do?

This PR

  1. Adds support for single file loading in ComponentSpec

  2. Renames the repo argument to pretrained_model_name_or_path. IMO this makes more sense if the same argument supports both filepath and repo_ids. Saw that there was a comment in there considering this chase, so I added it here. Alternatively, we can introduce a filename argument, but I this is cleaner.

Snippet to test

import torch
from diffusers.modular_pipelines.modular_pipeline_utils import ComponentSpec
from diffusers import FluxTransformer2DModel

component = ComponentSpec(
    "transformer",
    pretrained_model_name_or_path="https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/flux1-dev.safetensors",
    type_hint=FluxTransformer2DModel
)
model = component.load(torch_dtype=torch.bfloat16)

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.

@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
Copy link
Collaborator Author

DN6 commented Oct 20, 2025

@bot /style

@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 2025

Style bot fixed some files and pushed the changes.

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

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

thanks!

@DN6 DN6 requested a review from yiyixuxu October 30, 2025 18:44
@DN6
Copy link
Collaborator Author

DN6 commented Oct 30, 2025

@yiyixuxu Since there are some public models using modular thought it would be better to deprecate repo. Would you mind taking another look here please 🙏🏽

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

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

thanks! change looks good to me
I will run more slow tests later, but good to merge as long as you test out the public repo (krea) and make sure it works there

@DN6 DN6 merged commit b010a8c into main Nov 28, 2025
18 checks passed
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