Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
Input
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";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run scamai/upscaler using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"scamai/upscaler:5cba8cdca1446f44599f99b16ef6ad76b2d107d40197ba380f4830b4bc7d3424",
{
input: {
image: "https://replicate.delivery/pbxt/MESCy1ZTFXbX1IukxsWxqhKDPTKufR7dDFMbdo4khkLMweF2/37054504-089d7a00-214d-11e8-8982-ca836f7a4460.jpg",
upscale_factor: 2
}
}
);
// 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.
pip 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
Run scamai/upscaler using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"scamai/upscaler:5cba8cdca1446f44599f99b16ef6ad76b2d107d40197ba380f4830b4bc7d3424",
input={
"image": "https://replicate.delivery/pbxt/MESCy1ZTFXbX1IukxsWxqhKDPTKufR7dDFMbdo4khkLMweF2/37054504-089d7a00-214d-11e8-8982-ca836f7a4460.jpg",
"upscale_factor": 2
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run scamai/upscaler using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "scamai/upscaler:5cba8cdca1446f44599f99b16ef6ad76b2d107d40197ba380f4830b4bc7d3424",
"input": {
"image": "https://replicate.delivery/pbxt/MESCy1ZTFXbX1IukxsWxqhKDPTKufR7dDFMbdo4khkLMweF2/37054504-089d7a00-214d-11e8-8982-ca836f7a4460.jpg",
"upscale_factor": 2
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{
"completed_at": "2024-12-30T03:43:24.175685Z",
"created_at": "2024-12-30T03:40:45.910000Z",
"data_removed": false,
"error": null,
"id": "vg2vc9q1tsrga0cm2pk80y2xzm",
"input": {
"image": "https://replicate.delivery/pbxt/MESCy1ZTFXbX1IukxsWxqhKDPTKufR7dDFMbdo4khkLMweF2/37054504-089d7a00-214d-11e8-8982-ca836f7a4460.jpg",
"upscale_factor": 2
},
"logs": "2024-12-30 03:42:52,750 - predict - INFO - Image received and stored in /tmp/tmpfqnw7dkw37054504-089d7a00-214d-11e8-8982-ca836f7a4460.jpg\n2024-12-30 03:43:00,254 - INFO - [1/1] Processing: tmpfqnw7dkw37054504-089d7a00-214d-11e8-8982-ca836f7a4460.jpg\n2024-12-30 03:43:01,786 - INFO - 1 faces are detected\n2024-12-30 03:43:24,125 - predict - INFO - Upscaler finished running successfully. Returning final image.",
"metrics": {
"predict_time": 31.549308822,
"total_time": 158.265685
},
"output": "https://replicate.delivery/czjl/n7KBzlF6wVp1Ndtf2dLCQ8tDYsdooaEhr8i95tkKKmcuRefnA/tmpfqnw7dkw37054504-089d7a00-214d-11e8-8982-ca836f7a4460.png",
"started_at": "2024-12-30T03:42:52.626376Z",
"status": "succeeded",
"urls": {
"stream": "https://stream.replicate.com/v1/files/fddq-f6jrynxlnsqhal7fzqymydi4j666fx6togn5pepertjzjzi33o6q",
"get": "https://api.replicate.com/v1/predictions/vg2vc9q1tsrga0cm2pk80y2xzm",
"cancel": "https://api.replicate.com/v1/predictions/vg2vc9q1tsrga0cm2pk80y2xzm/cancel"
},
"version": "5cba8cdca1446f44599f99b16ef6ad76b2d107d40197ba380f4830b4bc7d3424"
}
2024-12-30 03:42:52,750 - predict - INFO - Image received and stored in /tmp/tmpfqnw7dkw37054504-089d7a00-214d-11e8-8982-ca836f7a4460.jpg
2024-12-30 03:43:00,254 - INFO - [1/1] Processing: tmpfqnw7dkw37054504-089d7a00-214d-11e8-8982-ca836f7a4460.jpg
2024-12-30 03:43:01,786 - INFO - 1 faces are detected
2024-12-30 03:43:24,125 - predict - INFO - Upscaler finished running successfully. Returning final image.