Download and organize all your Replicate predictions, including images, videos, and metadata
Project description
Replicate Predictions Downloader (Python)
Download and organize all your Replicate predictions, including images, videos, 3D models, and metadata.
Why
Replicate doesn't keep your prediction data forever. Per their data retention policy, predictions created via the API have their inputs, outputs, files, and logs automatically removed after one hour by default. Predictions made on the website are kept indefinitely, but output files still need downloading if you want local copies. This tool grabs everything while it's still there.
Features
- Batch download all your Replicate prediction outputs
- Organize by model into clean directory structures
- Smart filenames with dates, model names, and prompt snippets
- ZIP archives for each model for easy backup
- Date filtering - download predictions from specific time ranges
- Incremental downloads - only fetch new predictions since last run
- Full metadata export as JSON
Installation
pip install replicate-predictions-downloader
Or with pipx for isolated CLI usage:
pipx install replicate-predictions-downloader
Setup
-
Get your API token from replicate.com/account/api-tokens
-
Set your token:
export REPLICATE_API_TOKEN=your_token_here
Or create a
.envfile:REPLICATE_API_TOKEN=your_token_here
Usage
Download all predictions
replicate-downloader
Download predictions from a specific date
replicate-downloader --since "2024-01-15"
replicate-downloader --since "7 days ago"
replicate-downloader --since yesterday
Download predictions in a date range
replicate-downloader --since "2024-01-01" --until "2024-06-30"
Incremental download (since last run)
replicate-downloader --last-run
Output Structure
replicate_outputs_2024-01-15/
├── by-model/
│ ├── stable-diffusion/
│ │ ├── 2024-01-15_stable-diffusion_a-photo-of-an-astronaut_abc123.png
│ │ ├── 2024-01-15_stable-diffusion_sunset-over-mountains_def456.png
│ │ └── abc123_metadata.json
│ ├── stable-diffusion.zip
│ ├── flux-pro/
│ │ └── ...
│ └── flux-pro.zip
└── replicate_metadata_2024-01-15.json
Python API
You can also use the downloader programmatically:
from replicate_downloader import ReplicateDownloader
downloader = ReplicateDownloader(
api_token="your_token", # or use REPLICATE_API_TOKEN env var
since="7 days ago",
)
downloader.run()
Options
| Option | Description |
|---|---|
-s, --since DATE |
Download predictions created since this date |
-u, --until DATE |
Download predictions created until this date |
-l, --last-run |
Only download predictions since the last successful run |
--all |
Download all predictions (default) |
--version |
Show version |
--help |
Show help |
Date Formats
The --since and --until options support:
- ISO format:
2024-01-15 - Relative:
yesterday,7 days ago,2 weeks ago,1 month ago
Related
- replicate-predictions-downloader - Node.js version
- Replicate Python SDK
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file replicate_predictions_downloader-1.1.0.tar.gz.
File metadata
- Download URL: replicate_predictions_downloader-1.1.0.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f3759ec45b9a1ffb53ba97fcbec8775040d0b8410943dc11d184aa9ced67a30
|
|
| MD5 |
1b0f7adf7a22b22ced29b9c372f23cee
|
|
| BLAKE2b-256 |
5ce16f815329af0e9ff16b509acfdccb4a7c0a107d2f6cfc53c71eefa31c954c
|
File details
Details for the file replicate_predictions_downloader-1.1.0-py3-none-any.whl.
File metadata
- Download URL: replicate_predictions_downloader-1.1.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c7ceb24c6fe8bb1cc81b8a5487f4051e121dd2b7336633b3de306e20a4dac79
|
|
| MD5 |
1478bc15c7e1072b22d3b21bc2268d56
|
|
| BLAKE2b-256 |
eee70d3a6389bbb44d257546689fc64d77e6352f29b913ce3421ad8f7f49a2ac
|