Run and fine-tune open-source models. Deploy custom models at scale. All with one line of code.
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN
})
const model =
const input = {
prompt:
};
const [output] = await replicate.run(model, { input });
console.log(output);
With Replicate you can
bytedance/sdxl-lightning-4step
SDXL-Lightning by ByteDance: a fast text-to-image model that makes high-quality images in 4 steps
697M runs
black-forest-labs/flux-1.1-pro-ultra
FLUX1.1 [pro] in ultra and raw modes. Images are up to 4 megapixels. Use raw mode for realism.
3M runs
stability-ai/stable-diffusion-3.5-large
A text-to-image model that generates high-resolution images with fine details. It supports various artistic styles and produces diverse outputs from the same prompt, thanks to Query-Key Normalization.
329k runs
ideogram-ai/ideogram-v2
An excellent image model with state of the art inpainting, prompt comprehension and text rendering
339k runs
recraft-ai/recraft-v3-svg
Recraft V3 SVG (code-named red_panda) is a text-to-image model with the ability to generate high quality SVG images including logotypes, and icons. The model supports a wide list of styles.
45k runs
nvidia/sana
A fast image model with wide artistic range and resolutions up to 4096x4096
63k runs
luma/photon
High-quality image generation model optimized for creative professional workflows and ultra-high fidelity outputs
93k runs
playgroundai/playground-v2.5-1024px-aesthetic
Playground v2.5 is the state-of-the-art open-source model in aesthetic quality
2M runs
All the latest open-source models are on Replicate. They’re not just demos — they all actually work and have production-ready APIs.
AI shouldn’t be locked up inside academic papers and demos. Make it real by pushing it to Replicate.
meta/llama-2-7b-chat
A 7 billion parameter language model from Meta, fine tuned for chat completions
16M runs
stability-ai/stable-diffusion-inpainting
Fill in masked parts of images with Stable Diffusion
18M runs
microsoft/bringing-old-photos-back-to-life
Bringing Old Photos Back to Life
947k runs
google-research/maxim
Multi-Axis MLP for Image Processing
482k runs
salesforce/blip
Generate image captions
124M runs
mistralai/mistral-7b-v0.1
A 7 billion parameter language model from Mistral.
1M runs
laion-ai/erlich
Generate a logo using text.
348k runs
batouresearch/photorealistic-fx
RunDiffusion FX Photorealistic model, developed by RunDiffusion.
41k runs
pollinations/3d-photo-inpainting
3D Photography using Context-aware Layered Depth Inpainting
6k runs
pollinations/modnet
A deep learning approach to remove background & adding new background image
622k runs
prompthero/dreamshaper
Generate a new image given any input text with Dreamshaper v7
325k runs
You can get started with any open-source model with just one line of code. But as you do more complex things, you fine-tune models or deploy your own custom code.
Our community has already published thousands of models that are ready to use in production. You can run these with one line of code.
import replicate
output = replicate.run(
"black-forest-labs/flux-dev",
input={
"aspect_ratio": "1:1",
"num_outputs": 1,
"output_format": "jpg",
"output_quality": 80,
"prompt": "An astronaut riding a rainbow unicorn, cinematic, dramatic",
}
)
print(output)
You can improve open-source models with your own data to create new models that are better suited to specific tasks.
Image models like SDXL can generate images of a particular person, object, or style.
Train a model:
training = replicate.trainings.create(
destination="mattrothenberg/drone-art"
version="ostris/flux-dev-lora-trainer:e440909d3512c31646ee2e0c7d6f6f4923224863a6a10c494606e79fb5844497",
input={
"steps": 1000,
"input_images":
,
"trigger_word": "TOK",
},
)
This will result in a new model:
mattrothenberg/drone-art
Fantastical images of drones on land and in the sky
0 runs
mattrothenberg/drone-art
Fantastical images of drones on land and in the sky
0 runs
Then, you can run it with one line of code:
output = replicate.run(
"mattrothenberg/drone-art:abcde1234...",
input={"prompt": "a photo of TOK forming a rainbow in the sky"}),
)
You aren’t limited to the models on Replicate: you can deploy your own custom models using Cog, our open-source tool for packaging machine learning models.
Cog takes care of generating an API server and deploying it on a big cluster in the cloud. We scale up and down to handle demand, and you only pay for the compute that you use.
First, define the environment your model runs in with cog.yaml:
build:
gpu: true
system_packages:
- "libgl1-mesa-glx"
- "libglib2.0-0"
python_version: "3.10"
python_packages:
- "torch==1.13.1"
predict: "predict.py:Predictor"
Next, define how predictions are run on your model with predict.py:
from cog import BasePredictor, Input, Path
import torch
class Predictor(BasePredictor):
def setup(self):
"""Load the model into memory to make running multiple predictions efficient"""
self.model = torch.load("./weights.pth")
# The arguments and types the model takes as input
def predict(self,
image: Path = Input(description="Grayscale input image")
) -> Path:
"""Run a single prediction on the model"""
processed_image = preprocess(image)
output = self.model(processed_image)
return postprocess(output)
Thousands of businesses are building their AI products on Replicate. Your team can deploy an AI feature in a day and scale to millions of users, without having to be machine learning experts.
If you get a ton of traffic, Replicate scales up automatically to handle the demand. If you don't get any traffic, we scale down to zero and don't charge you a thing.
Replicate only bills you for how long your code is running. You don't pay for expensive GPUs when you're not using them.
Deploying machine learning models at scale is hard. If you've tried, you know. API servers, weird dependencies, enormous model weights, CUDA, GPUs, batching.
Prediction throughput (requests per second)
Metrics let you keep an eye on how your models are performing, and logs let you zoom in on particular predictions to debug how your model is behaving.
With Replicate and tools like Next.js and Vercel, you can wake up with an idea and watch it hit the front page of Hacker News by the time you go to bed.