Overview
This node integrates with the Replicate API to run machine learning model predictions. It allows users to specify a model by name, type (community or official), and version, then provide input parameters to execute a prediction request. The node handles polling the prediction status until completion and returns the final prediction result.
Common scenarios include:
- Running AI/ML models hosted on Replicate for tasks like image generation, text analysis, or other model-specific predictions.
- Automating workflows that require invoking external ML models and processing their outputs.
- Using webhook notifications to trigger downstream processes when predictions complete asynchronously.
Example use case:
- A user wants to generate images using a community model hosted on Replicate. They specify the model name, select the version, provide input parameters such as prompt text, and receive the generated image URL in the output.
Properties
| Name | Meaning |
|---|---|
| Model Name | The full identifier of the model to run, typically in the format account/model-name. |
| Model Type | The category of the model: - Community: Community-contributed models with available version lists. - Official: Official models (e.g., meta/llama) without exposed version lists. |
| Model Version | The specific version of the model to run. Required for community models and selected from a searchable list. For official models, the latest version is used automatically. |
| Model Inputs | One or more input fields specifying the parameters to pass to the model. Each input includes: - Field Name or ID (loaded dynamically based on model/version) - Value typed as boolean, number, or string |
| Additional Fields | Optional extra settings: - Webhook URL: URL to receive webhook notifications when the prediction completes. - Webhook Events Filter: Select which events ("start", "completed") trigger webhook notifications. |
Output
The node outputs JSON data representing the prediction result returned by the Replicate API. The structure includes:
output: The main prediction output, parsed from JSON if needed.status: The final status of the prediction (e.g., "succeeded").error: Any error message if the prediction failed.
If the prediction is asynchronous, the node polls the prediction status until it completes or fails before returning the result.
Binary data is not directly handled by this node; any binary content would be referenced via URLs in the JSON output.
Dependencies
- Requires an API key credential for authenticating with the Replicate API.
- Uses HTTP requests to interact with Replicate endpoints for models, versions, and predictions.
- Supports webhook URLs for asynchronous notification of prediction completion.
Troubleshooting
Error: Could not get latest version ID for the official model
This occurs if the specified official model name is incorrect or the API response lacks version info. Verify the model name is correct and accessible.Prediction failed
The prediction request returned a failure status. The error message from the API is included if available. Check input parameters and model availability.Polling timeout or long delays
Predictions may take time depending on model complexity. If polling takes too long, consider using webhook notifications instead.Invalid input field errors
Ensure that input fields match the expected names and types loaded dynamically from the model schema.