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.
xinntao /realesrgan:1b976a4d
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 xinntao/realesrgan using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"xinntao/realesrgan:1b976a4d456ed9e4d1a846597b7614e79eadad3032e9124fa63859db0fd59b56",
{
input: {
img: "https://replicate.delivery/mgxm/0d454687-4710-488e-a384-3a15c40ae50f/children-alpha.png",
tile: 0,
scale: 2,
version: "General - v3",
face_enhance: true
}
}
);
// 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 xinntao/realesrgan using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"xinntao/realesrgan:1b976a4d456ed9e4d1a846597b7614e79eadad3032e9124fa63859db0fd59b56",
input={
"img": "https://replicate.delivery/mgxm/0d454687-4710-488e-a384-3a15c40ae50f/children-alpha.png",
"tile": 0,
"scale": 2,
"version": "General - v3",
"face_enhance": True
}
)
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 xinntao/realesrgan 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": "xinntao/realesrgan:1b976a4d456ed9e4d1a846597b7614e79eadad3032e9124fa63859db0fd59b56",
"input": {
"img": "https://replicate.delivery/mgxm/0d454687-4710-488e-a384-3a15c40ae50f/children-alpha.png",
"tile": 0,
"scale": 2,
"version": "General - v3",
"face_enhance": true
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2022-09-04T15:46:12.337557Z",
"created_at": "2022-09-04T15:46:05.783054Z",
"data_removed": false,
"error": null,
"id": "md7tkig2r5e6znkwuwef4pulka",
"input": {
"img": "https://replicate.delivery/mgxm/0d454687-4710-488e-a384-3a15c40ae50f/children-alpha.png",
"tile": 0,
"scale": 2,
"version": "General - v3",
"face_enhance": true
},
"logs": "img: /tmp/tmp4607j5ruchildren-alpha.png. version: General - v3. scale: 2.0. face_enhance: True. tile: 0.\n/root/.pyenv/versions/3.8.13/lib/python3.8/site-packages/torch/nn/functional.py:3103: UserWarning: The default behavior for interpolate/upsample with float scale_factor changed in 1.6.0 to align with other frameworks/libraries, and now uses scale_factor directly, instead of relying on the computed output size. If you wish to restore the old behavior, please set recompute_scale_factor=True. See the documentation of nn.Upsample for details.\n warnings.warn(\"The default behavior for interpolate/upsample with float scale_factor changed \"",
"metrics": {
"predict_time": 6.338057,
"total_time": 6.554503
},
"output": "https://replicate.delivery/mgxm/e11061b9-1308-415c-abdf-bf4a713c9611/out.png",
"started_at": "2022-09-04T15:46:05.999500Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/md7tkig2r5e6znkwuwef4pulka",
"cancel": "https://api.replicate.com/v1/predictions/md7tkig2r5e6znkwuwef4pulka/cancel"
},
"version": "1b976a4d456ed9e4d1a846597b7614e79eadad3032e9124fa63859db0fd59b56"
}
img: /tmp/tmp4607j5ruchildren-alpha.png. version: General - v3. scale: 2.0. face_enhance: True. tile: 0.
/root/.pyenv/versions/3.8.13/lib/python3.8/site-packages/torch/nn/functional.py:3103: UserWarning: The default behavior for interpolate/upsample with float scale_factor changed in 1.6.0 to align with other frameworks/libraries, and now uses scale_factor directly, instead of relying on the computed output size. If you wish to restore the old behavior, please set recompute_scale_factor=True. See the documentation of nn.Upsample for details.
warnings.warn("The default behavior for interpolate/upsample with float scale_factor changed "