Readme
Some models on replicate need files to be input as URLs; this just returns a replicate.delivery URL serving your uploaded plain text, audio, image, or video, or .zip
Allows upload to replicate.delivery
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run chigozienri/upload using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"chigozienri/upload:2472bd8ce171b57576bb610deb154057ad80518fefe7ca059f9e33f073b3456b",
{
input: {}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
No output yet! Press "Submit" to start a prediction.
This model costs approximately $0.00095 to run on Replicate, or 1052 runs per $1, but this varies depending on your inputs. It is also open source and you can run it on your own computer with Docker.
This model runs on CPU hardware. Predictions typically complete within 10 seconds.
Some models on replicate need files to be input as URLs; this just returns a replicate.delivery URL serving your uploaded plain text, audio, image, or video, or .zip