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.

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