xinntao
/
realesrgan
Practical Image Restoration Algorithms for General/Anime Images
Prediction
xinntao/realesrgan:1b976a4dInput
{ "img": "https://replicate.delivery/mgxm/0d454687-4710-488e-a384-3a15c40ae50f/children-alpha.png", "tile": 0, "scale": 2, "version": "General - v3", "face_enhance": true }
npm install replicate
Set theREPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the clientimport 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 } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
Set theREPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the clientimport 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.
Set theREPLICATE_API_TOKEN
environment variableexport 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": "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.
Install Cogbrew install cog
If you don’t have Homebrew, there are other installation options available.
Pull and run xinntao/realesrgan using Cog (this will download the full model and run it in your local environment):
cog predict r8.im/xinntao/realesrgan@sha256:1b976a4d456ed9e4d1a846597b7614e79eadad3032e9124fa63859db0fd59b56 \ -i 'img="https://replicate.delivery/mgxm/0d454687-4710-488e-a384-3a15c40ae50f/children-alpha.png"' \ -i 'tile=0' \ -i 'scale=2' \ -i 'version="General - v3"' \ -i 'face_enhance=true'
To learn more, take a look at the Cog documentation.
Pull and run xinntao/realesrgan using Docker (this will download the full model and run it in your local environment):
docker run -d -p 5000:5000 --gpus=all r8.im/xinntao/realesrgan@sha256:1b976a4d456ed9e4d1a846597b7614e79eadad3032e9124fa63859db0fd59b56
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "img": "https://replicate.delivery/mgxm/0d454687-4710-488e-a384-3a15c40ae50f/children-alpha.png", "tile": 0, "scale": 2, "version": "General - v3", "face_enhance": true } }' \ http://localhost:5000/predictions
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" }
Generated inimg: /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 "
Prediction
xinntao/realesrgan:1b976a4dInput
{ "img": "https://replicate.delivery/mgxm/f50a356c-5dc9-411b-a93e-4e5bb487a2cc/0030.jpg", "tile": 0, "scale": 2, "version": "Anime - anime6B" }
npm install replicate
Set theREPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the clientimport 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/f50a356c-5dc9-411b-a93e-4e5bb487a2cc/0030.jpg", tile: 0, scale: 2, version: "Anime - anime6B" } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
Set theREPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the clientimport 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/f50a356c-5dc9-411b-a93e-4e5bb487a2cc/0030.jpg", "tile": 0, "scale": 2, "version": "Anime - anime6B" } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_API_TOKEN
environment variableexport 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": "1b976a4d456ed9e4d1a846597b7614e79eadad3032e9124fa63859db0fd59b56", "input": { "img": "https://replicate.delivery/mgxm/f50a356c-5dc9-411b-a93e-4e5bb487a2cc/0030.jpg", "tile": 0, "scale": 2, "version": "Anime - anime6B" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Install Cogbrew install cog
If you don’t have Homebrew, there are other installation options available.
Pull and run xinntao/realesrgan using Cog (this will download the full model and run it in your local environment):
cog predict r8.im/xinntao/realesrgan@sha256:1b976a4d456ed9e4d1a846597b7614e79eadad3032e9124fa63859db0fd59b56 \ -i 'img="https://replicate.delivery/mgxm/f50a356c-5dc9-411b-a93e-4e5bb487a2cc/0030.jpg"' \ -i 'tile=0' \ -i 'scale=2' \ -i 'version="Anime - anime6B"'
To learn more, take a look at the Cog documentation.
Pull and run xinntao/realesrgan using Docker (this will download the full model and run it in your local environment):
docker run -d -p 5000:5000 --gpus=all r8.im/xinntao/realesrgan@sha256:1b976a4d456ed9e4d1a846597b7614e79eadad3032e9124fa63859db0fd59b56
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "img": "https://replicate.delivery/mgxm/f50a356c-5dc9-411b-a93e-4e5bb487a2cc/0030.jpg", "tile": 0, "scale": 2, "version": "Anime - anime6B" } }' \ http://localhost:5000/predictions
Output
{ "completed_at": "2022-09-04T15:45:11.273918Z", "created_at": "2022-09-04T15:45:06.796272Z", "data_removed": false, "error": null, "id": "zlg27qitqrdkhcs7fd7kysx7dq", "input": { "img": "https://replicate.delivery/mgxm/f50a356c-5dc9-411b-a93e-4e5bb487a2cc/0030.jpg", "tile": 0, "scale": 2, "version": "Anime - anime6B" }, "logs": "img: /tmp/tmp8jmbzobi0030.jpg. version: Anime - anime6B. scale: 2.0. face_enhance: False. tile: 0.", "metrics": { "predict_time": 4.288051, "total_time": 4.477646 }, "output": "https://replicate.delivery/mgxm/64bfb221-6b36-4e5d-8f81-77d7b2adecf9/out..jpg", "started_at": "2022-09-04T15:45:06.985867Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/zlg27qitqrdkhcs7fd7kysx7dq", "cancel": "https://api.replicate.com/v1/predictions/zlg27qitqrdkhcs7fd7kysx7dq/cancel" }, "version": "1b976a4d456ed9e4d1a846597b7614e79eadad3032e9124fa63859db0fd59b56" }
Generated inimg: /tmp/tmp8jmbzobi0030.jpg. version: Anime - anime6B. scale: 2.0. face_enhance: False. tile: 0.
Prediction
xinntao/realesrgan:1b976a4dInput
{ "img": "https://replicate.delivery/mgxm/18579112-081d-4449-8c71-277667b0c3c9/wolf_gray.jpg", "tile": 0, "scale": 2, "version": "General - RealESRGANplus" }
npm install replicate
Set theREPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the clientimport 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/18579112-081d-4449-8c71-277667b0c3c9/wolf_gray.jpg", tile: 0, scale: 2, version: "General - RealESRGANplus" } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
Set theREPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the clientimport 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/18579112-081d-4449-8c71-277667b0c3c9/wolf_gray.jpg", "tile": 0, "scale": 2, "version": "General - RealESRGANplus" } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_API_TOKEN
environment variableexport 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": "1b976a4d456ed9e4d1a846597b7614e79eadad3032e9124fa63859db0fd59b56", "input": { "img": "https://replicate.delivery/mgxm/18579112-081d-4449-8c71-277667b0c3c9/wolf_gray.jpg", "tile": 0, "scale": 2, "version": "General - RealESRGANplus" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Install Cogbrew install cog
If you don’t have Homebrew, there are other installation options available.
Pull and run xinntao/realesrgan using Cog (this will download the full model and run it in your local environment):
cog predict r8.im/xinntao/realesrgan@sha256:1b976a4d456ed9e4d1a846597b7614e79eadad3032e9124fa63859db0fd59b56 \ -i 'img="https://replicate.delivery/mgxm/18579112-081d-4449-8c71-277667b0c3c9/wolf_gray.jpg"' \ -i 'tile=0' \ -i 'scale=2' \ -i 'version="General - RealESRGANplus"'
To learn more, take a look at the Cog documentation.
Pull and run xinntao/realesrgan using Docker (this will download the full model and run it in your local environment):
docker run -d -p 5000:5000 --gpus=all r8.im/xinntao/realesrgan@sha256:1b976a4d456ed9e4d1a846597b7614e79eadad3032e9124fa63859db0fd59b56
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "img": "https://replicate.delivery/mgxm/18579112-081d-4449-8c71-277667b0c3c9/wolf_gray.jpg", "tile": 0, "scale": 2, "version": "General - RealESRGANplus" } }' \ http://localhost:5000/predictions
Output
{ "completed_at": "2022-09-04T15:46:45.047888Z", "created_at": "2022-09-04T15:46:39.262732Z", "data_removed": false, "error": null, "id": "bnvg3i3poveinm4tikkr7zezpe", "input": { "img": "https://replicate.delivery/mgxm/18579112-081d-4449-8c71-277667b0c3c9/wolf_gray.jpg", "tile": 0, "scale": 2, "version": "General - RealESRGANplus" }, "logs": "img: /tmp/tmpo9au7bqewolf_gray.jpg. version: General - RealESRGANplus. scale: 2.0. face_enhance: False. tile: 0.", "metrics": { "predict_time": 5.551531, "total_time": 5.785156 }, "output": "https://replicate.delivery/mgxm/c43078c1-71b0-472e-a4e0-6df714ed05d1/out..jpg", "started_at": "2022-09-04T15:46:39.496357Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/bnvg3i3poveinm4tikkr7zezpe", "cancel": "https://api.replicate.com/v1/predictions/bnvg3i3poveinm4tikkr7zezpe/cancel" }, "version": "1b976a4d456ed9e4d1a846597b7614e79eadad3032e9124fa63859db0fd59b56" }
Generated inimg: /tmp/tmpo9au7bqewolf_gray.jpg. version: General - RealESRGANplus. scale: 2.0. face_enhance: False. tile: 0.
Want to make some of these yourself?
Run this model