Instructions to use nvidia/RFD4-Proteina-prep with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use nvidia/RFD4-Proteina-prep with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("nvidia/RFD4-Proteina-prep", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Commit History
2 days ago
-
Install Diffusers from main, pin the current Diffusers weights, add wordmark and project page link
Verified signaturec99a272 -
docs: public install instructions and public Diffusers revision
Verified signature23ba93d -
Point maintainer instructions at the public RosettaCommons/RFD4-Proteina repository
Verified signature7a3e236 -
Make run_examples.py run again against current Diffusers
`run_examples.py` takes a `--checkpoint` and runs against whatever Diffusers is installed, so it has to track the current pipeline API. It had stopped: * `pipe(features, ...)` passed the whole feature mapping positionally, where the first parameter is `padding_mask`. The same mistake was fixed in the README earlier; these scripts were missed. * `partial_t={"bb_ca": ..., "local_latents": ...}` is now two arguments, `partial_t_bb_ca` and `partial_t_local_latents`. * `coords_nm` is read by name, so it belongs with the arguments rather than in `conditioning_features`. Without it, partial diffusion and inverse folding raise "partial and inverse generation require clean coords_nm". A full run ignores it, so passing it always is correct for every task. The README's own `required` list had the same hole, and is corrected with it. * `TASKS` listed `antibody_design` and `nanobody`, whose inputs this repository does not ship -- the manifest lists them under `excluded` -- so the d…0a34f04 -
Compare --check against what regeneration would actually write
`vendor_from_main.py --check` compared the shipped `_cif/` tree against the raw module closure. The write path does not write that closure: it skips the three SHIM_ONLY modules, whose logging is substituted rather than vendored, and writes its own `__init__.py`. So every single run reported three modules as pending and two as unexpected, on a tree that was exactly right. A check that cries wolf on a clean tree is worse than no check, because the one run that has something real to say looks like all the others. It now compares against the set `--out` would write, names `cath_mapping.py` as built from packaged data rather than from a source module, says so when there is nothing to report, and exits non-zero when there is. It is still a file-set check: a module whose contents moved upstream looks clean to it. MAINTAINING.md now says that, and keeps `--out` plus `diff -r` as the check that reads contents. Verified both ways: clean against main at f5db9617f, and exit 1 with both lists po…4f0ab1e -
Start the release runbook from the inputs this package ships
The input set in MAINTAINING.md pointed only at paths in the RFD4 repository, which means taking a release needed that checkout before the first snapshot could be taken, and it had a hole: not one of those inputs carries a UNK residue, so the UNK vocabulary fix two releases ago produced no snapshot difference at all. examples/inputs/ now ships seven inputs, four of which carry UNK, and they are the ones the README and the Diffusers docs tell users to run. The runbook leads with those and keeps the RFD4 ones for the branches they do not reach -- glycan, non-canonical amino acid, covalent modification, centroid and RASA conditioning. It also notes which two of them encode the input, since that is the path the NaN-under-mask issue affects. Checked rather than asserted: tools/feature_snapshot.py runs on all seven, 145 to 180 quantities each. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>c9959ef -
Call the pipeline the way its signature actually reads
Every example in this README passed the whole feature mapping as the first positional argument, `pipe(features, ...)`. That argument is `padding_mask`. `RFD4ProteinaPipeline.__call__` takes the masks and molecule tensors as arguments and the annotations separately as `conditioning_features`, so the examples would bind a dict where a tensor belongs and fail. Three call sites, all now matching the pipeline's own documentation: split the features into the five the pipeline takes by name and pass the rest as conditioning. Two of the three predate the batching example added alongside this; that one inherited the mistake from them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>fda521e
3 days ago
-
Document and test RFD4's batching contract for several designs
No change to how write_cif indexes anything. RFD4 replicates at collate time -- datapipes/collate.py does `[sample for sample in samples for _ in range(num_replicates)]` -- so every per-row quantity already has one row per design by the time anything reads it, and the export loop in proteina.py reads row i of each. write_cif already did the same thing, and keeping it that way is the point: this package indexes the way RFD4 indexes. What was missing was saying so, and testing it. The README example replicated with `repeat`, which tiles; an input's designs sit together, so it must be `repeat_interleave`, and the difference is invisible for one input and wrong for more than one. It now also shows `num_designs_per_prompt` alongside the replication, since a pipeline repeating its input internally still leaves the caller to replicate the features it passes back in. Tests cover one and three designs with replicated features, that unreplicated features raise IndexError on the second design r…33517d4 -
Skip the custom-block test when diffusers is absent
`pytest` failed at collection for anyone who installed this package and its documented test extra and nothing else: tests/test_custom_block.py imports `diffusers` at module scope, and `diffusers` is not a dependency here -- the `test` extra is pytest alone. The failure is a collection error, so it took the whole suite down with it rather than just that file. `pytest.importorskip("diffusers")` before the import, which is what test_prepare.py already does for `atomworks`. Behaviour is unchanged wherever diffusers is installed; where it is not, the module skips and the rest of the suite runs. Verified against a wheel built from this repository and installed without diffusers: 2 passed, 1 skipped, where it was previously 1 error. Declaring diffusers in the test extra would also work, but it would make the package's own tests pull the library that depends on it, so skipping is the lighter answer. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>040b0b2 -
Correct the UNK claim: the row is unreachable on this package's path
82eed95's message said a UNK residue "was being featurized with no atom37 slots at all". That is not demonstrated and appears to be false. UNK does not survive this package's parse: motif_scaffolding, enzyme_design and protein_binder all carry UNK in the file and all come back with zero UNK atoms and zero tokens encoded as UNK, the residue having been masked for design on the way through. Features are identical either side of the fix on those three, 538 quantities, as they were on the original ten. The upstream commit that changed the row filters backbone-capable UNK before refolding, which is not a path this package walks. The drift was real and the fix stands -- this package should ship what RFD4 ships, and the next change to that row may not be inert. What was wrong was the claim about its consequence, made before checking whether the residue reaches featurization at all. MAINTAINING.md now carries the accurate version and says to establish reachability before claiming an effect e…8d54ce4 -
Restore the README sections the previous commit overwrote
82eed95 copied a local working tree over the repository and reverted 105 lines of README that had landed in 5ab5b72 in between: the Hub metadata header, the install and authenticate section, the custom-block walkthrough and the downloadable example catalog. That was a clobber, not a decision. This restores 5ab5b72's README and re-applies the only change 82eed95 meant to make to it, the AtomWorks 3.0.4 note. No other file was affected: block.py, LICENSE-APACHE, examples/manifest.json and examples/inputs/ were never copied over and survived. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>2a6de75 -
Take RFD4 5248e9a1, fix a stale vocabulary, require AtomWorks 3.0.4
The vendored modules are re-stamped to RFD4 5248e9a15a18. Across those ten upstream commits not one vendored module changed, so the only thing in the copy that moved is its provenance header. What did move is package data nothing was checking. RFD4 gave the `UNK` row of the checkpoint vocabulary a backbone -- "N CA C - O" where this package still shipped an empty row -- in "filter backbone-capable UNK before refolding" (#740). `resources/aa_rna_dna_glycan_ncaa.yaml` is copied verbatim from the RFD4 repository but is not a module, so it carries no provenance commit and the coverage guard could not see it. check_vendored.py now compares it byte for byte through a VERBATIM_DATA table, which a tamper test exercises. That gap is worth stating plainly: a UNK residue was being featurized with no atom37 slots at all, where upstream gives it four. None of the ten snapshot inputs contains a UNK residue, so the feature snapshot reported no change -- the one real change in this release was invis…82eed95 -
Add modular CIF helper and non-antibody Studio input catalog
Verified signatureAdditive helper, pinned example runner and CPU tests. Existing preprocessing source, model weights and repository visibility are unchanged.5ab5b72
4 days ago
-
Drop "independently" from the loud-refusal note; it is not true
The note said both integrations landed on the refusal independently. They did not. One tested the over-broad wording in the previous note and added the guard; the other had read that wording and stopped on the strength of it, and only added its own once the correction was relayed. Calling that independent convergence dresses up a correction propagating as two teams agreeing, and overstates how much the agreement is worth as evidence. What stands, and is the part worth keeping, is what they had in common: each already had an input-validation list that refused mismatched generator counts and missing masks, and coordinates that cannot be encoded belong in that list. Documentation only. No code, and no change to what prepare_cif produces. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>199dfd7 -
Generalise the loud-refusal note from both consumers, not one
The note cited the diffusers pipeline as the worked example. Both integrations have now landed on the same answer independently, and the more useful fact is what they had in common: each already had an input-validation list that refused mismatched generator counts and missing masks, and refusing coordinates that cannot be encoded belongs in that list. That is why it reads as idiomatic in both rather than as a guard bolted on, and it is better guidance than "one of them did this". Both refuse only when encoding is actually requested, both refuse before any RNG is drawn, and both leave encode() untouched -- so the bit-identity argument holds by construction rather than by assertion. Documentation only. No code, and no change to what prepare_cif produces. This is the last of the three documentation commits that followed 73d658a. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>74fb45f -
Tell maintainers to ask downstream about fixture provenance
A fixture or expected-output value derived from this package's output goes stale the moment the package legitimately changes, and it goes stale quietly: the test passes against the recorded number until it doesn't, and then it reads as a regression in the consumer's own code rather than as a bump here. Both integrations were checked at this release and neither had any such value -- one builds its feature dicts from literals, the other asserts shapes, finiteness, self-consistency and invariants read from the checkpoint's own tables. That is the property to re-establish at each release rather than assume, so the runbook now says to ask. Documentation only. No code, and no change to what prepare_cif produces. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>3be8bdb -
Separate silent repair from loud refusal in the NaN-mask note
The note said the NaN-under-mask behaviour "should not be patched in either" port, which is too broad. It was written to rule out a consumer quietly masking on is_resolved_mask and so drifting from the native runtime, but read literally it also rules out refusing an input that can only produce garbage, which is a different thing and a reasonable one. Rejecting such an input changes nothing on any path that previously worked, so bit-identity is untouched. The diffusers pipeline now does this in check_inputs for partial diffusion and inverse folding; without it, it returned 12765/12765 and 27084/27084 non-finite output coordinates on 5o45_cropped and 1a1e and raised nothing. Documentation only. No code, and no change to what prepare_cif produces. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>3cbbf27 -
Vendor the whole RFD4 datapipe instead of an inference-only fork
The `_cif` modules were a hand-curated inference subset of the RFD4 datapipe, which meant every release turned into archaeology: decide which differences were deliberate, which were drift, and which were someone re-wrapping a docstring. Upstream never had two pipelines -- its `build_design_validation_pipeline` is `build_design_train_pipeline(is_inference=True)` -- so the fork was maintaining a split the flag already made for us. The modules are now vendored unedited, training paths included, and `prepare_cif` calls the upstream builder rather than keeping its own transform list. Recorded divergences drop from 24 to 11, and all 11 are packaging rather than behaviour: the DDP logger becomes plain `logging`, and two data files are read from this package instead of a repository checkout. This lands two batches of behaviour change: * Reconciliation against native main. `canonical_polymer_ordering` now treats non-canonical amino acids as protein, so their backbone linkages carry an or…73d658a -
Use the checkpoint's own 147-token vocabulary, not AtomWorks' 34-token one
Verified signatureThe package read its residue vocabulary from atomworks.ml.encoding_definitions, which carries 34 tokens. The released checkpoints use the RFD4 repository's 147-token vocabulary, and PTR, SEP, NAG and MLY are absent from the AtomWorks one. Glycans and non-canonical residues were therefore unrepresentable: they fell through to atomized or unknown, and the decoder - which restricts residue classes by token type - was handed the wrong vocabulary. On a release whose point is that it handles them. Vendors the RFD4 repository's encoding module and the vocabulary it reads, and points the five import sites at it. TokenType and the residue groupings now derive from that vocabulary rather than from hand-written lists. Three further sites assumed the smaller vocabulary and are corrected to match the RFD4 datapipe: the atom37 slot table was built from a hardcoded 33-residue list, the slot lookup was gated to protein/RNA/DNA so a non-canonical residue's atoms resolved to -1 and were rejected as un…6e30fce -
Type glycans and non-canonical residues, and drop the deprecated AtomWorks call
Verified signatureTokenType carried only five members while the RFD4 repository has seven, and nothing ever assigned GLYCAN or NCAA. A glycan or non-canonical residue was therefore typed as protein, unknown or atomized, which hands the decoder the wrong per-token-type residue restriction - on a release whose point is that it handles them. Ports the two assignments from datapipes/bonds.py along with the 13 glycan and 100 NCAA residue names. Replaces get_annotation_2d_categories() with get_annotation_categories(n_body=2) at the two call sites that still used it, matching main and silencing the DeprecationWarning AtomWorks 3.0.3 emits on every run. check_vendored.py now compares vendored content against the source by default, rather than only comparing the recorded commit against the current one. The pin check cannot catch a header that was updated without the content being reconciled, which is how the above slipped through. Output-neutral on the nine example inputs: all 720 tensors bit-identical. Glyca…77832f5 -
Support the unified 147-class release: atomworks 3.0.3, chirality frames, encoder features
Verified signaturePins atomworks[ml]==3.0.3 and migrates AnnotateCovalentModifications to its API, matching the RFD4 inference datapipe (reassign_modified_residue=False, atomize_modified_residue=False). A pin bump alone fails: the 3.0.1 signature this package called no longer exists. Adds the features the unified checkpoint needs. AddChiralityFeature and the chirals helper are replaced with the RFD4 repository's current versions, which emit chiral_frame_atoms, chiral_slot_owner and tetrahedral_vertices and cover E/Z double-bond stereochemistry; without them noise_align_chirality cannot run. ground_truth_element and incident_bond_type_counts are added for the autoencoder encoder, which partial diffusion and inverse folding go through. Re-pins every vendored module to RFD4-Proteina 63ae4ff0cc26 (they recorded 0e05aece) and adds tools/check_vendored.py, which reports when a vendored source moves upstream. Verified against the previous behaviour: all 675 previously emitted tensors are bit-identical acros…38584dd
7 days ago
-
Add the annotated-CIF preparation and export package for the Diffusers RFD4-Proteina pipeline
Verified signatureceb0adf -
README metadata: this is a companion package, not a Diffusers model
Verified signature8d6a355 -
README metadata: this is a companion package, not a Diffusers model
Verified signature4b46fbb -
Add the annotated-CIF preparation and export package for the Diffusers RFD4-Proteina pipeline
Verified signature75b53c6 -
initial commit
Verified signaturea0517c1