Instructions to use phi-lab-rice/GRADE with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use phi-lab-rice/GRADE with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("phi-lab-rice/GRADE", 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
Download src/models/da3/inference.py from phi-lab-rice/GRADE: direct link, hf CLI and curl.
- Browser
- Download file 462 Bytes
-
https://huggingface.co/phi-lab-rice/GRADE/resolve/main/src/models/da3/inference.py
- Command line
-
hf download hf://phi-lab-rice/GRADE/src/models/da3/inference.py
-
curl -L -o inference.py https://huggingface.co/phi-lab-rice/GRADE/resolve/main/src/models/da3/inference.py
462 Bytes
| from pathlib import Path | |
| import sys | |
| SRC = Path(__file__).resolve().parents[2] | |
| sys.path.insert(0, str(SRC)) | |
| from inference_runtime import launch | |
| HERE = Path(__file__).resolve().parent | |
| ROOT = HERE.parents[2] | |
| launch( | |
| SRC / "Baselines/da3/inference.py", | |
| ("--data_root", str(ROOT / "evaluation_dataset/Smoke-Eval"), "--checkpoint", str(ROOT / "checkpoints/baselines/da3/da3metric-large.safetensors"), "--output_dir", str(ROOT / "inference_results/da3")), | |
| ) | |