Diffusers
Safetensors
English
RFD4ProteinaPipeline
biology
protein-design
biomolecular-design
structure-generation
flow-matching
annotated-cif
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
Model card: explicit pipeline arguments, link the open Diffusers pull request
Browse files
README.md
CHANGED
|
@@ -31,9 +31,9 @@ This repository is the [Diffusers](https://github.com/huggingface/diffusers) rel
|
|
| 31 |
>
|
| 32 |
> These weights are the **2026-10-19 release**: a 147-class residue vocabulary and a 32-dimensional
|
| 33 |
> latent, produced by a LoRA fine-tune of the pretrained base that is merged into these weights.
|
| 34 |
-
> Support for them is not in a released Diffusers version yet. It
|
| 35 |
-
>
|
| 36 |
-
> (
|
| 37 |
> incorrectly.
|
| 38 |
>
|
| 39 |
> You also need the matching [`nvidia/RFD4-Proteina-prep`](https://huggingface.co/nvidia/RFD4-Proteina-prep),
|
|
@@ -73,9 +73,16 @@ 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(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
write_cif(output, features, atoms, "design.cif")
|
| 80 |
```
|
| 81 |
|
|
|
|
| 31 |
>
|
| 32 |
> These weights are the **2026-10-19 release**: a 147-class residue vocabulary and a 32-dimensional
|
| 33 |
> latent, produced by a LoRA fine-tune of the pretrained base that is merged into these weights.
|
| 34 |
+
> Support for them is not in a released Diffusers version yet. It is in the open pull request
|
| 35 |
+
> [huggingface/diffusers#15088](https://github.com/huggingface/diffusers/pull/15088)
|
| 36 |
+
> (branch `add-rfd4-proteina-torch` of `kierandidi/diffusers`). An older Diffusers will fail to load this repository rather than sample it
|
| 37 |
> incorrectly.
|
| 38 |
>
|
| 39 |
> You also need the matching [`nvidia/RFD4-Proteina-prep`](https://huggingface.co/nvidia/RFD4-Proteina-prep),
|
|
|
|
| 73 |
|
| 74 |
required = ["padding_mask", "is_in_context_conditioning", "supports_local_latent", "token_type",
|
| 75 |
"atom37_mask", "coords_nm"]
|
|
|
|
| 76 |
conditioning = {name: value for name, value in features.items() if name not in required}
|
| 77 |
+
output = pipe(
|
| 78 |
+
padding_mask=features["padding_mask"],
|
| 79 |
+
is_in_context_conditioning=features["is_in_context_conditioning"],
|
| 80 |
+
supports_local_latent=features["supports_local_latent"],
|
| 81 |
+
token_type=features["token_type"],
|
| 82 |
+
atom37_mask=features["atom37_mask"],
|
| 83 |
+
conditioning_features=conditioning,
|
| 84 |
+
generator=torch.Generator("cuda:0").manual_seed(42),
|
| 85 |
+
)
|
| 86 |
write_cif(output, features, atoms, "design.cif")
|
| 87 |
```
|
| 88 |
|