huggingface / huggingface/diffusers

universal method or class to load any model locally

Open
#13,683 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request gguf pipelines quantization single-file
Dominant language
Python
Stars
34.5k
Forks
7.3k
Avg merge
3d 3h
Merged PRs (30d)
91

Description

90% of the time custom models including gguf files fail to load due to limited availability ".from single file" in all class or config mismatch issues

please provide any class even if it can be made in community examples, just a default class to load all components

lets just say if we use automodel or xyz class
for safetensors
pipe= automodel.from_single_file(model_path, use_safetensors=True, cache_dir=cache_dir, custom_pipeline="", torch_dtype=TORCH_DTYPE, local_files_only=True,)
or for gguf
pipe=automodel.from_single_file(model_path, quantization_config=GGUFQuantizationConfig(compute_dtype=torch.bfloat16), torch_dtype=torch.float16, low_cpu_mem_usage=True,)
then dump
components=pipe.components

we can at least get a decent loading in case of aio safetensors and gguf along with optimizations
loading sdxl single aio safetensors or gguf
pipe=StableDiffusionXLPipeline(components)
pipe=StableDiffusionXLImg2ImgPipeline(components)
loading wan single aio safetensors or gguf
pipe=WanPipeline(components)
can be used further more for other models as well flux acestep all other .

if the feature is there please give a hint . it can solve 90% of model loading problems
Thanks in advance

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed AutoModel.from_single_file usage, including the safetensors and GGUF examples, and compare it with the named StableDiffusionXLPipeline, WanPipeline, and related pipeline classes. Done would require a clearly defined loading interface that works across the model formats and pipelines described, with the component handoff demonstrated.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.