Replicate
AI model hosting platform for running image generation, image editing, and video generation models via API.
Core Models
Text-to-Image
- FLUX Schnell — fast, cost-effective image generation for drafts and iteration
- FLUX Pro — high-quality generation for production use
Image-to-Image
- Kontext Pro — editorial restyling and image editing that preserves composition while changing style, lighting, or mood
Integration Patterns
Synchronous Predictions
Best for fast models (under 30 seconds). Submit a prediction and poll for completion.
Webhook-Based
Best for slow models (video generation, high-res images). Submit with a webhook URL and receive results asynchronously.
Cost Optimization
- Use Schnell for drafts, Pro for finals
- Cache predictions by input hash to avoid regeneration
- Set appropriate timeouts to avoid hanging on failed predictions
- Use webhooks instead of polling for long-running models