Instructions to use nvidia/RFD4-Proteina-Diffusers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use nvidia/RFD4-Proteina-Diffusers 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-Diffusers", 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
Point the examples section at a reproduction path that exists
Browse filesThe section told readers to run examples/run_examples.py from the prep repository. That script reads a flat <name>.cif from a local --inputs-dir, not this repository layout of examples/<name>/input.cif, and the prep repository ships seven of these nine inputs: the two antibody ones are excluded there. So the instruction could not reproduce the table it sat under.
It now points at this repository own inputs through the Quickstart above, which already downloads examples/protein_binder/input.cif, and names run_hub_examples.py for the seven that prep does package, since that runner pins the model, prep and Diffusers revisions.
The Quickstart required list also gains coords_nm. It is a named pipeline argument that partial diffusion and inverse folding read; leaving it in conditioning_features raises "partial and inverse generation require clean coords_nm". A full run ignores it, so the snippet behaves identically.
|
@@ -71,7 +71,8 @@ pipe = RFD4ProteinaPipeline.from_pretrained("nvidia/RFD4-Proteina-Diffusers", dt
|
|
| 71 |
input_cif = hf_hub_download("nvidia/RFD4-Proteina-Diffusers", "examples/protein_binder/input.cif")
|
| 72 |
features, atoms = prepare_cif(input_cif, seed=42, device=pipe.device)
|
| 73 |
|
| 74 |
-
required = ["padding_mask", "is_in_context_conditioning", "supports_local_latent", "token_type",
|
|
|
|
| 75 |
inputs = {name: features[name] for name in required}
|
| 76 |
conditioning = {name: value for name, value in features.items() if name not in required}
|
| 77 |
output = pipe(**inputs, conditioning_features=conditioning, generator=torch.Generator("cuda:0").manual_seed(42))
|
|
@@ -111,7 +112,7 @@ Each `examples/<name>/` folder holds the AtomWorks Studio input (`input.cif`), t
|
|
| 111 |
|
| 112 |
</details>
|
| 113 |
|
| 114 |
-
These examples demonstrate the conditioning workflow. They are not experimental binding or catalytic-activity results, and example selection does not establish biological design quality. `examples/examples.json` lists the sampling task of each input. To reproduce
|
| 115 |
|
| 116 |
## Precision and speed
|
| 117 |
|
|
|
|
| 71 |
input_cif = hf_hub_download("nvidia/RFD4-Proteina-Diffusers", "examples/protein_binder/input.cif")
|
| 72 |
features, atoms = prepare_cif(input_cif, seed=42, device=pipe.device)
|
| 73 |
|
| 74 |
+
required = ["padding_mask", "is_in_context_conditioning", "supports_local_latent", "token_type",
|
| 75 |
+
"atom37_mask", "coords_nm"]
|
| 76 |
inputs = {name: features[name] for name in required}
|
| 77 |
conditioning = {name: value for name, value in features.items() if name not in required}
|
| 78 |
output = pipe(**inputs, conditioning_features=conditioning, generator=torch.Generator("cuda:0").manual_seed(42))
|
|
|
|
| 112 |
|
| 113 |
</details>
|
| 114 |
|
| 115 |
+
These examples demonstrate the conditioning workflow. They are not experimental binding or catalytic-activity results, and example selection does not establish biological design quality. `examples/examples.json` lists the sampling task of each input. To reproduce one, download its `input.cif` from this repository and run it the way the Quickstart above does. The seven non-antibody inputs are also packaged in [`rfd4-proteina-prep`](https://huggingface.co/nvidia/RFD4-Proteina-prep), whose `examples/run_hub_examples.py` regenerates them against pinned model, prep and Diffusers revisions.
|
| 116 |
|
| 117 |
## Precision and speed
|
| 118 |
|