Home / Topics / Predictions

Output files


Some models generate files as output, like images, audio, or video.

When a model generates files, they are automatically uploaded to a Replicate-managed domain, and the URL to each file is included in the output of the model's response.

Here's a simplified example prediction from the Flux Schnell model, which can produce multiple output files in a single run:

{
  "id": "m420tb253nrm60cj09c8hwfgxw",
  "input": {
    "prompt": "A fantastical, dreamlike cityscape inspired by Paul Klee's surrealist style, with undulating buildings, vibrant colors, and whimsical architectural details, set against a bright blue sky with puffy white clouds.",
    "num_outputs": 4
  },
  "output": [
    "https://replicate.delivery/yhqm/zhBT5Cu9HFZVCZC9ecfY80gCXM9uCtA1f5vJe7MHSoJRIx3NB/out-0.jpg",
    "https://replicate.delivery/yhqm/SRMJkAmSnDIsJNw2zDe5tBhxyrhha2zApLZn0y2s0KZCJedTA/out-1.jpg",
    "https://replicate.delivery/yhqm/TXdX922eTHwvfEkopbj9o6eqfVt53tMrcjhmeDFZfHGLhEfuJA/out-2.jpg",
    "https://replicate.delivery/yhqm/NTXVHdf2gd0nBqlUeG2VGLklIx9FYpWgm9jg8Dud3S4ES8dTA/out-3.jpg"
  ],
}

Data retention

For predictions created through the API, output files are automatically deleted after an hour. You must save a copy of any files in the output if you'd like to continue using them. For more details on how to store prediction data, see the webhooks docs.

For predictions created through the web interface, output files are kept indefinitely, unless you delete them manually.

Output file domains

Output files are served by replicate.delivery and its subdomains.

If you use an allow list of external domains for your assets, add replicate.delivery and *.replicate.delivery to it.

For example, if you're building a Next.js app that displays output files from Replicate, update your Next.js config as follows:

const nextConfig = {
  images: {
    remotePatterns: [
      {
        protocol: "https",
        hostname: "replicate.delivery",
      },
      {
        protocol: "https",
        hostname: "*.replicate.delivery",
      }
    ]
  }
}