Pin GitHub Actions to commit SHAs
Replace mutable tags and branch refs in workflow files with full commit SHAs,
keeping the original version as a trailing comment.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Bump doc-builder pin to 9fc8a41 in build_documentation.yml
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Bump doc-builder pin to 9fc8a41 in build_pr_documentation.yml
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Bump doc-builder pin to 9fc8a41 in upload_pr_documentation.yml
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
A tag is mutable: whoever controls the action's repository can move
`v4` to different code, and the next run picks it up with no diff to
review. Pinning to the commit SHA freezes the code that runs today.
Co-authored-by: hf-security-analysis[bot] <265538906+hf-security-analysis[bot]@users.noreply.github.com>
A job with no `permissions:` block inherits whatever the repository
hands out. Each block added here grants what that job's own steps
need and nothing more.
Co-authored-by: hf-security-analysis[bot] <265538906+hf-security-analysis[bot]@users.noreply.github.com>
* feat: improve issue reminder workflow and introduce conditional auto-close
* up
* filter the comments coming from the bot.
* include older PRs.
* implement point 1 of Yiyi's feedback
* clarify reminder message
* report each at-risk PR to Slack once, widen the rescue window
The Slack rescue branch fired on every daily run between SLACK_RESCUE_DAYS and
AUTOCLOSE_DAYS, so a PR the team decided not to rescue came back three times.
Append a hidden marker to the warning comment once a PR has been reported, and
skip PRs that already carry it.
Also move the Slack ping from 7 to 5 days after the warning, leaving 5 days
(instead of 3) between the message and the auto-close, so a Friday message
still gets a reply.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* clarify reminder message
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* restructure guides as skill references
* reorganize AGENTS.md and references
* clean up
* clean up
* clean up
* fix AGENTS.md references and add check_ai to Makefile
* clean up
* update paths
* clean up
* fix(torchao): route root-level tensors around safetensors reconstruction
Models with parameters at the root of the module tree (e.g. Wan's
`scale_shift_table`) crashed torchao's `unflatten_tensor_state_dict`
when loading serialized checkpoints, since flattened tensor names are
assumed to carry a module prefix. Filter such tensors and their
metadata entries out of the reconstruction and merge them back
unchanged.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(bnb): defer 8-bit weights split from their SCB stats across shards
Sharded serialization can place an 8-bit weight and its `SCB`
statistics in different shard files, in which case the shard-by-shard
loader failed with "Missing quantization component `SCB`". Hold the
incomplete half of the pair back until its counterpart arrives with a
later shard, mirroring the torchao pending mechanism, and disable
parallel shard loading for prequantized 8-bit checkpoints.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* [tests] extend model-level quantization tester mixins
Migrate remaining model-level coverage from tests/quantization into the
tester mixins so it runs for every wired model:
- base: buffer-placement assertions in the device-map test, and an
opt-in sharded-serialization test enabled by setting
`sharded_serialization_config`
- bnb: serialization across all configs (sharded included), dtype
assignment and adapter training for 8-bit, device moves preserving
the memory footprint, corrupted-state-dict loading error, and a fixed
modules-to-not-convert test (BitsAndBytesConfig only exposes
llm_int8_skip_modules; the old test passed an unsupported kwarg and
only survived by being skipped)
- torchao: custom device maps with cpu/disk offload, generalized from
the Flux-specific test
- gguf: the diffusers-format single-file loading path, wired into the
Flux model tests
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* [tests] fix model-level quantization test wiring
- SD3.5: the quantized testers reused the random-init dummy inputs
(4 latent channels, fp32) while the tiny Hub checkpoint has
in_channels=8 and the quantizers load the model in half precision;
give them matching inputs and relax the 4-bit memory expectation for
the tiny checkpoint.
- QwenImage / Flux2: the quantized testers had no Hub checkpoint wired
at all, so every test errored; point them at
hf-internal-testing/tiny-qwenimage-pipe and tiny-flux2 with matching
inputs.
- NucleusMoE: no tiny checkpoint exists on the Hub yet; comment the
testers out like the LTX ones.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* [tests] split tests/quantization into pipeline-level and backend-level tiers
Pipeline-level quantization tests (pipeline quality slices, cpu offload,
LoRA loading, compile, PipelineQuantizationConfig) move to
tests/pipelines/testing_utils/quantization.py, marked per backend so the
nightly CI can select them with `pytest -m`. tests/quantization keeps
only backend-level tests that fit neither tier: config validation,
utility warnings, and GGUF CUDA kernel correctness. Tests already
covered by the model-level mixins are dropped.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* [ci] select nightly quantization tests by marker across test tiers
Each backend job now runs `pytest -m <marker>` over tests/models,
tests/quantization, and tests/pipelines/testing_utils/quantization.py,
giving the model-level mixin tests a nightly home with the backend
dependencies installed. The torchao job additionally installs mslk.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: sayak@huggingface.co <sayak@ip-10-53-90-45.ec2.internal>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
transformers now hard-requires tokenizers>=0.23.1,<0.24.0 at import time,
so the override from #13767 breaks every job at the environment step
(ImportError: tokenizers>=0.23.1,<0.24.0 is required ... found 0.22.2).
The originally-problematic 0.23.0 is already excluded by transformers'
own lower bound, so the override can go entirely.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* Auto-reply to new model requests with Modular Diffusers guidance
Points new model/pipeline/scheduler requests at building a Hub-hosted
modular pipeline instead of waiting on a core PR, and asks requesters to
tag @asomoza when they have something to share.
Gates on the `### Model/Pipeline/Scheduler description` heading the issue
form renders rather than on a label: the label the template declares does
not exist in this repo, so GitHub never applies it, and template labels
land after issue creation anyway.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Apply suggestion from @yiyixuxu
* Tighten the new model request reply
Lead with starting on the Hub and frame what follows as a support
decision (work with the authors, upstream a community version, or point
people at the Hub one) rather than a soft no to PRs. Trims the message
by collapsing the author section and the resource list.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Link the Modular Pipelines collection in the reply
Community-built model pipelines belong in the Modular Pipelines
collection rather than Custom Blocks, so point the "we'll add the ones we
like" line there and keep both collections in the resource list.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Recommend starting on the Hub for new models
Adds a callout to the contribution guide asking model authors to get in
touch on a feature request, and community contributors to coordinate
there and start with a Hub repo at the same time.
Points agents the same way: default to publishing a modular pipeline as
remote code rather than opening a PR against src/diffusers.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Apply suggestion from @yiyixuxu
* Apply suggestion from @yiyixuxu
* Update .github/workflows/new_model_request_reply.yml
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
* Consolidate the Hub-first guidance into one place
stevhliu noted the new callout in "Adding pipelines, models, schedulers"
overlapped the last two paragraphs of the AI-assisted contributions
section. Drop the community-contributor paragraph there — it is general
contribution policy rather than agent-specific guidance — and point the
model-author paragraph at the callout instead. Carry the custom models
link over so the non-modular Hub path stays covered.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
* Regenerate stale modular auto docstrings
Mechanical output of `python utils/modular_auto_docstring.py
src/diffusers/modular_pipelines --fix_and_overwrite` on current main.
These docstrings drifted because the CI check only verifies a docstring
exists, not that its content matches the current block declarations.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Make auto docstring check detect stale content, not just missing docstrings
Check mode now regenerates each # auto_docstring docstring the same way
--fix_and_overwrite does (generate -> insert -> ruff/doc-builder format,
on a temp copy) and compares with the checked-in file, reporting the
stale classes. Works like check_copies: forgetting to run the fixer now
fails CI on the PR that caused the drift, including when the causing
change is in another file (leaf block declarations, templates, specs).
The check now imports diffusers to evaluate doc properties, so the
check_auto_docs CI job moves to the torch container with the test job's
dependency install.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
* Remove JAX/Flax support
Deletes all Flax models, schedulers, pipelines, and loading utilities,
the from_flax loading path, flax/jax packaging extras, Flax CI filters,
Flax training examples, and Flax content in translated docs.
Hub compatibility is preserved: Flax class names in old model_index.json
files are still stripped to their PyTorch equivalents, and *.msgpack
files in repos are still ignored during download.
* Drop Flax class-name remapping from model_index.json loading
Flax-saved checkpoint metadata is no longer recognized: class names like
FlaxStableDiffusionPipeline in model_index.json now fail to resolve
instead of being remapped to their PyTorch equivalents. *.msgpack files
in hub repos are still ignored during download.
* Restore Flax training examples
The example scripts are standalone and still work with diffusers<=0.39.x.
A warning note is added to each Flax README section pointing out the
version requirement now that the library itself no longer ships Flax.
* update
* Repoint scheduler default-config tests off the Flax fixture
* Repoint example training tests off the Flax fixture
* Add agent-doc gotcha: build pipeline test components from real classes, not mocks
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Document modular pipeline tests; soften tiny-repo policy; move mock rule to skill only
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Split testing conventions into .ai/testing.md; include tests/ in review scope
Move the Testing section out of the model-integration skill into a
standalone .ai/testing.md so it loads in both the authoring and review
flows, add it to review-rules' reading list and the reference guides,
extend the mock rule to call-level doubles (monkeypatched component
methods), and widen the @claude CI reviewer's review scope to tests/
(edit/commit scope unchanged).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Document how to run modular pipelines/blocks; add callback_kwargs gotcha
- modular.md: new 'Running a modular pipeline' section — init_pipeline()/
load_components()/output= usage, from_blocks_dict composition,
update_components() for config values, and the anti-pattern of calling
blocks directly with a hand-built PipelineState
- testing.md: modular block tests run through the pipeline API and assert
on outputs; tiny repos must mirror the real checkpoint's shape (per-variant
repos when configs differ); bespoke tests live on the tester class
- pipelines.md: callback_kwargs must be built with a loop — locals() inside
a dict comprehension sees the comprehension's scope and always KeyErrors
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Apply suggestions from code review
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
* Require sharing self-review notes on PRs
The PR template's self-review checkbox is unverifiable on its own — make the
notes a required, shareable artifact:
- self-review skill: new step to save each round's report and post all rounds
on the PR (description or comment)
- contribution guide: sharing the notes is part of the AI-assisted
contribution workflow; a checked box without notes counts as not done
- PR template: checkbox for having shared the notes
- .ai/AGENTS.md: mention the notes-sharing step in the self-review section
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Share only the final self-review round, not all rounds
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Mention self-review notes in the PR template intro comment
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Soften notes-sharing ask; skill iterates until ready then reminds to share
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Apply suggestion from @yiyixuxu
* Point checkbox and guide at the self-review skill directly
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Note human review comments as a source for agent doc gaps
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* Commit root AGENTS.md/CLAUDE.md symlinks so agents auto-load conventions
Track the root AGENTS.md/CLAUDE.md symlinks (-> .ai/AGENTS.md) instead of
generating them via `make claude`/`make codex`, so a fresh clone auto-loads
the agent guide with no setup step (matching transformers). The make targets
now only wire up skills; .ai/AGENTS.md, the contribution doc, and the PR
template are updated to match.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Add documentation-impact check to PR review rules
During review, scan related usage docs and agent docs and flag (advisory)
any that should be updated based on the PR — outdated/missing usage docs, or
a rule/pattern/gotcha worth recording in the agent guides.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Make root PHILOSOPHY.md a symlink to the docs philosophy page
The root PHILOSOPHY.md had drifted into a stale duplicate of
docs/source/en/conceptual/philosophy.md (which was rewritten in #13808 to
cover the single-file model policy and Modular Diffusers). Replace it with a
symlink to the docs file, mirroring CONTRIBUTING.md -> contribution.md, so
there's a single source of truth.
A symlink renders as a path stub (not content) on GitHub, so repoint the
links that pointed at blob/main/PHILOSOPHY.md to the rendered docs site:
the PR template and the English contribution guide.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Point contributor-guide links at the rendered docs site
CONTRIBUTING.md is a symlink, so blob/main/CONTRIBUTING.md renders as a path
stub on GitHub rather than the guide. Repoint the PR template and README
links to the rendered docs page, matching the philosophy/AI-agents links.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Repoint remaining symlink-stub doc links to the rendered docs site
The stale-bot comment and the ko/zh contribution guides still linked to
blob/main/{CONTRIBUTING,PHILOSOPHY}.md, which render as path stubs because
those root files are symlinks. Point them at the rendered docs pages
(localized /ko/ and /zh/ for the translations).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
CONTRIBUTING.md is a symlink to docs/source/en/conceptual/contribution.md.
GitHub renders a symlink blob as a path stub, not the target's content, so
the `#coding-with-ai-agents` anchor in the PR template and README landed on
an empty-looking page. Point those two anchored links at the rendered docs
site instead (the same URL the PR-issue-reminder bot already uses).
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* implement a bot to remind prs to link issues if not.
* up
* remove auto-close and add contribution guide.
* restrict to one comment
* Apply suggestions from code review
Co-authored-by: sergereview[bot] <283583894+sergereview[bot]@users.noreply.github.com>
* put dodgy stuff in try-except
* limit to 2 days
* style.
---------
Co-authored-by: sergereview[bot] <283583894+sergereview[bot]@users.noreply.github.com>
* docs: surface AI-agent setup for contributors
Most code contributions now involve a coding agent, but the agent setup
(`make claude`/`make codex`, the conventions in `.ai/`) is opt-in and easy
to miss, so agents run without project context and produce PRs that ignore
conventions. Surface it where contributors will see it:
- README: pointer to `.ai/` / `make claude` in the contribution section
- PR template: an AI-agent setup + self-review checkbox (now the first item),
folding the typo/docs exception into the philosophy-doc check, and dropping
the deprecated JAX reviewer routing (Flax is slated for removal in v0.40.0;
MPS kept)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* docs: nest the AI-agent checklist into a parent + sub-items
Make the AI-agent item a parent checkbox ("Did you use an AI agent?") with
two sub-checkboxes (point it at .ai/ conventions; self-review against
.ai/review-rules.md).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* [CI] claude_review: target source PR's branch for follow-up PRs
The follow-up PR was always cut from main, so once main moved on from the
PR's base the cherry-pick conflicted and the run failed (see run
26191835696). For non-fork PRs we now target the PR's own head branch
instead — Claude's edits apply cleanly regardless of how main has diverged,
and merging the follow-up folds them into the original PR. Fork PRs still
target the default branch since we can't push to a fork.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* [CI] claude_review: skip COMMIT THIS on fork PRs
Falling back to main as the base for fork PRs hits the same cherry-pick
conflict pattern the previous commit fixed for source PRs, and we can't
push to the fork's branch anyway. Bail early with a friendly comment
pointing users to apply Claude's suggestions manually or open an issue.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>