Automatically reusing components
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- huggingface, python
调研方向
Read the ComponentsManager guide and the Pika H3 Flex example linked in the issue to understand how components are currently shared. The proposal is to discuss opt-in reuse based on checkpoint weight hashes; this issue explicitly asks for feedback and use cases rather than a code change. Share a concrete concern, alternative, or experience with manual component reuse.
由索引模型根据 Issue 内容生成。
描述
Diffusers pipelines often share components: the same text encoder or VAE across model families, a finetune reusing its base model's components, a LoRA-based model reusing the base transformer entirely. Loading each of them twice wastes time, and worse, it keeps two copies of the same model in memory. So we want to reuse the same components as much as possible.
What we have today
In Modular Diffusers, ComponentsManager manages components across pipelines. Load one pipeline through it, and a second pipeline can pick up what it needs from the manager instead of loading its own copy:
pika.update_components(transformer=manager.get_one(name="transformer", collection="minimax-h3"))
See the ComponentsManager guide and the Pika H3 Flex example, where a second pipeline is assembled from a loaded MiniMax-H3.
The reuse itself is still manual: you decide which components are shared and pass them over. What the manager gives you is bookkeeping so you can keep track of it. Each component is listed once with the pipelines that use it (when you register under a collection), offloading works across all of them, and the manager warns when two components were loaded from the same repo and subfolder. That warning is as far as duplicate detection goes today, and it comes after the second copy is already loaded.
The Hub now dedups on disk
With huggingface_hub>=1.32.0, identical Xet-backed files share one cached payload across repositories, shard by shard. Download the same text encoder from two repos and it lands on disk once. We could take advantage of that and go one step further: dedup the models we load into memory too.
Proposal
An opt-in setting on the manager. When a pipeline is about to load a component, the manager checks whether the same weights are already loaded, using the same idea the Hub uses to dedup: a content hash of the weights, stored with the checkpoint and compared before loading. If there is a match, the pipeline reuses the loaded component instead of loading again. No download, no second copy.
How to contribute
This issue carries the new idea-contribution-welcome label. For issues with this label we are not looking for a PR. We are looking for discussion: feedback on the proposal, alternatives, use cases we have not thought of, problems you ran into with the current manual way. We will write the PR ourselves, and anyone whose feedback shaped it will be added as a co-author.
Posted by Claude on behalf of @yiyixuxu. The text was drafted together and approved by yiyixuxu.
- 主要语言
- Python
- 星标
- 34.9k
- 派生
- 7.5k
- 平均合并
- 3 天 16 小时
- 30 天内合并 PR
- 65
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
huggingface/diffusers 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
huggingface/diffusers#15363 ·
维护者通常 1 天内回复
-
`ZImageImg2ImgPipeline` / `ZImageInpaintPipeline`: explicit height/width different from the input image raises RuntimeError可能已有人在做 @chessing234 于 1 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 70/100
huggingface/diffusers#15337 · 2 条评论 ·
维护者通常 1 天内回复
-
Multi-vector textual inversion uses only the first vector when the token has uppercase letters (transformers v5)可能已有人在做 @sunhouy 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
huggingface/diffusers#15313 ·
维护者通常 1 天内回复
-
TCDScheduler advances the generator on the final step of a strength-truncated custom schedule可能已有人在做 @SIDDARTHAREDDY8 于 5 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 74/100
huggingface/diffusers#15288 · 2 条评论 ·
维护者通常 1 天内回复
-
unload_textual_inversion(token) leaves the extra tokens of a multi-vector embedding behind, so it can't be loaded again可能已有人在做 @sohailshk 于 11 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
huggingface/diffusers#15211 · 3 条评论 ·
维护者通常 1 天内回复
查看 huggingface/diffusers 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 73/100
维护者通常 1 天内回复
-
Unused loot bag group names left in dreamcraft en_US.lang可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭Status: Triage Suggestion
难度 1/5 1 小时以内 新手友好度 90/100
GTNewHorizons/GT-New-Horizons-Modpack#27789 ·
维护者通常 1 天内回复
-
bug frontend sev-5
难度 2/5 1-3 小时 新手友好度 83/100
-
core good first issue
难度 2/5 1-3 小时 新手友好度 65/100
-
b4b code health next
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复