This endpoint allows you to submit a request to generate images using Replicate models and evaluate them using selected evaluation models.
POST /generate-and-evaluate
{
"api_key": "your_replicate_api_key",
"title": "Evaluation Title",
"rows": [
{
"prompt": "A prompt for image generation",
"seed": 12345,
"examples": [
{
"model": "owner/model_name[:version]",
"prompt_input": "prompt_input_name", # optional, defaults to "prompt"
"seed_input": "seed_input_name", # optional, defaults to "seed"
"inputs": {
"key": "value",
...
}
}
]
}
],
"eval_models": ["ImageReward", "Aesthetic", ...]
}
curl -X POST http://localhost:8000/generate-and-evaluate \
-H "Content-Type: application/json" \
-d '{
"api_key": "your_replicate_api_key",
"title": "Test Evaluation",
"rows": [
{
"prompt": "A beautiful sunset over the ocean",
"seed": 42,
"examples": [
{
"model": "stability-ai/stable-diffusion:db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930b0c49861f96d1e5bf",
"prompt_input": "prompt",
"seed_input": "seed",
"inputs": {
"width": 512,
"height": 512,
"num_inference_steps": 50
}
}
]
}
],
"eval_models": ["ImageReward", "Aesthetic", "CLIP"]
}'
Upon successful submission, you will receive a JSON response with the evaluation ID and a URL to view the results:
{
"evaluation_id": "uuid-of-the-evaluation",
"results_url": "http://localhost:8000/results/uuid-of-the-evaluation/"
}
your_replicate_api_key
with your actual Replicate API key.seed
field is optional. If not provided, a random seed will be generated.eval_models
array should contain one or more of the supported evaluation models.This endpoint allows you to submit existing images for evaluation using selected evaluation models.
POST /api/evaluate-images
{
"api_key": "your_replicate_api_key",
"title": "Evaluation Title",
"data": [
{
"prompt": "A prompt for image evaluation",
"images": [
{
"url": "https://example.com/image1.jpg",
"labels": {
"key1": "value1",
"key2": "value2"
}
},
{
"url": "https://example.com/image2.jpg",
"labels": {
"key1": "value1",
"key2": "value2"
}
}
]
}
],
"models": ["ImageReward", "Aesthetic", ...]
}
curl -X POST http://localhost:8000/api/generate-and-evaluate \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_REPLICATE_API_KEY",
"title": "Flux Model Comparison",
"rows": [
{
"prompt": "the Great Pyramid",
"examples": [
{
"model": "black-forest-labs/flux-schnell",
"inputs": {
"go_fast": false
}
},
{
"model": "black-forest-labs/flux-schnell",
"inputs": {
"go_fast": true
}
}
]
},
{
"prompt": "robots meditating in a vipassana retreat",
"examples": [
{
"model": "black-forest-labs/flux-schnell",
"inputs": {
"go_fast": false
}
},
{
"model": "black-forest-labs/flux-schnell",
"inputs": {
"go_fast": true
}
}
]
}
],
"eval_models": ["ImageReward", "Aesthetic", "CLIP", "BLIP", "PickScore", "DreamSim"]
}'
Upon successful submission, you will receive a JSON response with the evaluation ID and a URL to view the results:
{
"evaluation_id": "uuid-of-the-evaluation",
"results_url": "http://localhost:8000/results/uuid-of-the-evaluation/"
}
your_replicate_api_key
with your actual Replicate API key.prompt
field is optional but must be consistent across all rows (either all present or all absent).labels
field for each image is optional.eval_models
array should contain one or more of the supported evaluation models.