Выполните запрос GET /replicate/v1/predictions/, чтобы получить сведения о prediction Replicate и прогресс в реальном времени по ID задачи для сценариев генерации изображений.
curl --request GET \
--url https://api.cometapi.com/replicate/v1/predictions/{id} \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"input": {},
"model": "<string>",
"output": [
"<string>"
],
"status": "<string>",
"created_at": "<string>",
"data_removed": true,
"logs": "<string>",
"urls": {
"get": "<string>",
"cancel": "<string>",
"stream": "<string>"
},
"error": "<string>",
"metrics": {
"image_count": 123,
"predict_time": 123
},
"version": "<string>",
"started_at": "<string>",
"completed_at": "<string>"
}status, чтобы понять, prediction всё ещё выполняется или уже завершёнoutput для URL сгенерированных ресурсовerror для ошибок на стороне провайдераmetrics, если вам нужны сведения о времени выполнения или количестве изображенийСначала создайте prediction
Выполняйте polling по id prediction
status не перейдёт в терминальное состояние, а output не будет заполнен или не вернётся ошибка провайдера.Bearer token authentication. Use your CometAPI key.
Prediction id returned by the create endpoint.
Current prediction state.
Show child attributes
Show child attributes
curl --request GET \
--url https://api.cometapi.com/replicate/v1/predictions/{id} \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"input": {},
"model": "<string>",
"output": [
"<string>"
],
"status": "<string>",
"created_at": "<string>",
"data_removed": true,
"logs": "<string>",
"urls": {
"get": "<string>",
"cancel": "<string>",
"stream": "<string>"
},
"error": "<string>",
"metrics": {
"image_count": 123,
"predict_time": 123
},
"version": "<string>",
"started_at": "<string>",
"completed_at": "<string>"
}