Pick an image model on Replicate, call it from your server, save results to storage, and cap cost per user so image generation stays affordable.
Add AI image generation to my app using Replicate
How it works
- Pick a model: Vovy opens Replicate's image models, runs your test prompt on two or three in the browser, and compares quality, speed and price per image.
- Create an API token: Vovy creates a token in Account settings, adds billing with your approval, and saves REPLICATE_API_TOKEN as a server secret.
- Call it from your backend: Vovy asks Claude Code for a server function that runs the model with the user's prompt and waits for the result.
- Save images to storage: Replicate output links expire, so Claude Code copies each image into a Supabase Storage bucket and saves the permanent URL.
- Add a per-user limit: Claude Code adds a daily image limit per user so one person cannot run up your bill. A card shows cost per image and at 1,000 users.
What you provide
- A Replicate account
- A Supabase project
- The style of images you want
What you get
- A chosen image model
- Image generation in your app
- Images saved permanently
- A per-user cost cap
FAQ
How much does each image cost?
It depends on the model: fast models cost fractions of a cent, top models a few cents or more. Vovy shows the real price before you pick.
Why did my images disappear?
Replicate's output URLs are temporary. Copy images to your own storage, as this setup does.
Can users make anything they want?
Models have safety filters, but you are responsible for your app. Add your own content rules for sensitive topics.
Related tasks
All tasks