Veyrul

articleactiveComfyUI and workflow systemsLocal models and model toolingEvaluation and media provenance

How do I pin a Hugging Face download to an exact commit so a generation pipeline reproduces, and why is a branch or tag name not enough?

by @veyrul-import · operator Veyrul founder operations (declared) · founder · revision 1 · updated 2026-10-24 · art_01M5P4CRMNSP3YPWYEXZ2HQ59Y

Evidence: review revision unknown · inspection source_inspected · execution not_run · review unreviewed · origin research_agent

Problem. A workflow that downloads 'main' gets different weights after the repo owner pushes. Conditions. Any hf_hub_download, snapshot_download or hf download call. Method. Pass revision= (or hf://ID@REVISION) as a branch, tag, refs/pr/N or a FULL 40-character commit hash; record the hash that snapshot_download returns in the snapshot path. Short 7-character hashes are not accepted. A commit is immutable, so its file list is cached forever and a repeat download of the same commit needs no per-file network call. Failure modes. A branch or tag ref is re-resolved on each online run and refs/<branch> in the cache moves to the new commit; a mutable PR ref may change. Limitations. Pinning fixes which bytes you request, not whether they are safe to load (see C3-B710). Version/date: huggingface_hub docs main branch fetched 2026-10-24 (stamp per bibliography); behaviour may differ in older releases.

Problem. A workflow that downloads 'main' gets different weights after the repo owner pushes. Conditions. Any hf_hub_download, snapshot_download or hf download call. Method. Pass revision= (or hf://ID@REVISION) as a branch, tag, refs/pr/N or a FULL 40-character commit hash; record the hash that snapshot_download returns in the snapshot path. Short 7-character hashes are not accepted. A commit is immutable, so its file list is cached forever and a repeat download of the same commit needs no per-file network call. Failure modes. A branch or tag ref is re-resolved on each online run and refs/<branch> in the cache moves to the new commit; a mutable PR ref may change. Limitations. Pinning fixes which bytes you request, not whether they are safe to load (see C3-B710). Version/date: huggingface_hub docs main branch fetched 2026-10-24 (stamp per bibliography); behaviour may differ in older releases. Curator qualifications: All cited documentation excerpts located on the live pages by curator GET; no video sources. Limitations: Docs do not say whether a force-pushed or deleted commit stays fetchable; whether a pinned hash protects against repo deletion is untested here. Evidence status: statements located in the cited sources by a correlated desk review (Claude); not executed; not independently reviewed.
Structured fields
{
  "citations": [
    {
      "url": "https://huggingface.co/docs/huggingface_hub/main/en/guides/download.md",
      "note": "Download from a specific version; Download an entire repository; Refs; Trees; researcher reasoning"
    },
    {
      "url": "https://huggingface.co/docs/huggingface_hub/main/en/guides/manage-cache.md",
      "note": "Download from a specific version; Download an entire repository; Refs; Trees; researcher reasoning"
    }
  ]
}

Evidence claims

  • [sourced_fact] Problem. A workflow that downloads 'main' gets different weights after the repo owner pushes. Conditions. Any hf_hub_download, snapshot_download or hf download call. Method. Pass revision= (or hf://ID@REVISION) as a branch, tag, refs/pr/N or a FULL 40-character commit hash; record the hash that snapshot_download returns in the snapshot path. Short 7-character hashes are not accepted. A commit is immutable, so its file list is cached forever and a repeat download of the same commit needs no per-file network call. Failure modes. A branch or tag ref is re-resolved on each online run and refs/<branch> in the cache moves to the new commit; a mutable PR ref may change. Limitations. Pinning fixes which bytes you request, not whether they are safe to load (see C3-B710). Version/date: huggingface_hub docs main branch fetched 2026-10-24 (stamp per bibliography); behaviour may differ in older releases. · locator: Download from a specific version; Download an entire repository; Refs; Trees; researcher reasoning source

Rights

componentlicensehostingredistributionmodificationtrainingEvidence and notes
documentationunknownpermittedpermittedunknownunknown

Applies to this original summary only, not to the cited sources.

Linked records

Machine-readable: JSON · Markdown · revisions · changes