You're looking at a specific version of this model. Jump to the model overview.
microsoft /bringing-old-photos-back-to-life:c75db81d
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 microsoft/bringing-old-photos-back-to-life using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"microsoft/bringing-old-photos-back-to-life:c75db81db6cbd809d93cc3b7e7a088a351a3349c9fa02b6d393e35e0d51ba799",
{
input: {
HR: false,
image: "https://replicate.delivery/mgxm/7869b8fd-2393-450b-8fd0-281f00eedef9/a.png",
with_scratch: false
}
}
);
console.log(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 microsoft/bringing-old-photos-back-to-life using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"microsoft/bringing-old-photos-back-to-life:c75db81db6cbd809d93cc3b7e7a088a351a3349c9fa02b6d393e35e0d51ba799",
input={
"HR": False,
"image": "https://replicate.delivery/mgxm/7869b8fd-2393-450b-8fd0-281f00eedef9/a.png",
"with_scratch": False
}
)
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 microsoft/bringing-old-photos-back-to-life 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": "c75db81db6cbd809d93cc3b7e7a088a351a3349c9fa02b6d393e35e0d51ba799",
"input": {
"HR": false,
"image": "https://replicate.delivery/mgxm/7869b8fd-2393-450b-8fd0-281f00eedef9/a.png",
"with_scratch": false
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
brew install cog
If you don’t have Homebrew, there are other installation options available.
Run this to download the model and run it in your local environment:
cog predict r8.im/microsoft/bringing-old-photos-back-to-life@sha256:c75db81db6cbd809d93cc3b7e7a088a351a3349c9fa02b6d393e35e0d51ba799 \
-i 'HR=false' \
-i 'image="https://replicate.delivery/mgxm/7869b8fd-2393-450b-8fd0-281f00eedef9/a.png"' \
-i 'with_scratch=false'
To learn more, take a look at the Cog documentation.
Run this to download the model and run it in your local environment:
docker run -d -p 5000:5000 --gpus=all r8.im/microsoft/bringing-old-photos-back-to-life@sha256:c75db81db6cbd809d93cc3b7e7a088a351a3349c9fa02b6d393e35e0d51ba799
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "HR": false, "image": "https://replicate.delivery/mgxm/7869b8fd-2393-450b-8fd0-281f00eedef9/a.png", "with_scratch": false } }' \ http://localhost:5000/predictions
To learn more, take a look at the Cog documentation.
Add a payment method to run this model.
Each run costs approximately $0.022. Alternatively, try out our featured models for free.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2021-09-20T16:27:51.532784Z",
"created_at": "2021-09-20T16:27:28.360906Z",
"data_removed": false,
"error": null,
"id": "cxqxicgcjng5rfrrgtbsx2ffmm",
"input": {
"HR": false,
"image": "https://replicate.delivery/mgxm/7869b8fd-2393-450b-8fd0-281f00eedef9/a.png",
"with_scratch": false
},
"logs": "Running Stage 1: Overall restoration\nFinish Stage 1 ...\nRunning Stage 2: Face Detection\nFinish Stage 2 ...\nRunning Stage 3: Face Enhancement\nFinish Stage 3 ...\nRunning Stage 4: Blending\nFinish Stage 4 ...\nAll the processing is done. Please check the results.",
"metrics": {
"total_time": 23.171878
},
"output": [
{
"file": "https://replicate.delivery/mgxm/18b02ad9-ae81-4044-800e-65732df6bdc7/out.png"
}
],
"started_at": "2021-12-04T14:16:37.885270Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/cxqxicgcjng5rfrrgtbsx2ffmm",
"cancel": "https://api.replicate.com/v1/predictions/cxqxicgcjng5rfrrgtbsx2ffmm/cancel"
},
"version": "7c0dc6206cc4d002ccd985f0a3944a18dcb918cfd9f2e4678db568388a57d98d"
}
Running Stage 1: Overall restoration
Finish Stage 1 ...
Running Stage 2: Face Detection
Finish Stage 2 ...
Running Stage 3: Face Enhancement
Finish Stage 3 ...
Running Stage 4: Blending
Finish Stage 4 ...
All the processing is done. Please check the results.
This example was created by a different version, microsoft/bringing-old-photos-back-to-life:7c0dc620.