yuval-alaluf / restyle_encoder
ReStyle: A Residual-Based StyleGAN Encoder via Iterative Refinement
Prediction
yuval-alaluf/restyle_encoder:898c82c1a38bd205a5a3bbc06ab567bc32a2c3324b3d8205e4c3ab7c368fe668ID6lufjzilijekvibd6x4ifb3lmyStatusSucceededSourceWebHardware–Total duration–CreatedInput
{ "input": "https://replicate.delivery/mgxm/34f067a1-8d8e-41c8-aea4-c3f8d6db2421/affleck_2.jpg", "encoding_type": "toonify", "num_iterations": "2", "display_intermediate_results": false }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run yuval-alaluf/restyle_encoder using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "yuval-alaluf/restyle_encoder:898c82c1a38bd205a5a3bbc06ab567bc32a2c3324b3d8205e4c3ab7c368fe668", { input: { input: "https://replicate.delivery/mgxm/34f067a1-8d8e-41c8-aea4-c3f8d6db2421/affleck_2.jpg", encoding_type: "toonify", num_iterations: "2", display_intermediate_results: false } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run yuval-alaluf/restyle_encoder using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "yuval-alaluf/restyle_encoder:898c82c1a38bd205a5a3bbc06ab567bc32a2c3324b3d8205e4c3ab7c368fe668", input={ "input": "https://replicate.delivery/mgxm/34f067a1-8d8e-41c8-aea4-c3f8d6db2421/affleck_2.jpg", "encoding_type": "toonify", "num_iterations": "2", "display_intermediate_results": False } ) # The yuval-alaluf/restyle_encoder model can stream output as it's running. # The predict method returns an iterator, and you can iterate over that output. for item in output: # https://replicate.com/yuval-alaluf/restyle_encoder/api#output-schema print(item)
To learn more, take a look at the guide on getting started with Python.
Run yuval-alaluf/restyle_encoder 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": "yuval-alaluf/restyle_encoder:898c82c1a38bd205a5a3bbc06ab567bc32a2c3324b3d8205e4c3ab7c368fe668", "input": { "input": "https://replicate.delivery/mgxm/34f067a1-8d8e-41c8-aea4-c3f8d6db2421/affleck_2.jpg", "encoding_type": "toonify", "num_iterations": "2", "display_intermediate_results": false } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2021-09-09T06:38:28.302060Z", "created_at": "2021-09-09T06:38:12.172064Z", "data_removed": false, "error": null, "id": "6lufjzilijekvibd6x4ifb3lmy", "input": { "input": "https://replicate.delivery/mgxm/34f067a1-8d8e-41c8-aea4-c3f8d6db2421/affleck_2.jpg", "encoding_type": "toonify", "num_iterations": "2", "display_intermediate_results": false }, "logs": "Loading faces model...\nLoading ReStyle pSp from checkpoint: pretrained_models/restyle_psp_ffhq_encode.pt\nDone!\nLoading toonify model...\nLoading ReStyle pSp from checkpoint: pretrained_models/restyle_psp_toonify.pt\nDone!\nAligning image...\nDone!\nRunning inference...\nFinished inference in 0.5075435638427734 seconds!\nPreparing result...", "metrics": {}, "output": [ { "file": "https://replicate.delivery/mgxm/9a18e6e5-bc13-460b-9516-f4d601cc6f6f/output.png" } ], "started_at": null, "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/6lufjzilijekvibd6x4ifb3lmy", "cancel": "https://api.replicate.com/v1/predictions/6lufjzilijekvibd6x4ifb3lmy/cancel" }, "version": "898c82c1a38bd205a5a3bbc06ab567bc32a2c3324b3d8205e4c3ab7c368fe668" }
Loading faces model... Loading ReStyle pSp from checkpoint: pretrained_models/restyle_psp_ffhq_encode.pt Done! Loading toonify model... Loading ReStyle pSp from checkpoint: pretrained_models/restyle_psp_toonify.pt Done! Aligning image... Done! Running inference... Finished inference in 0.5075435638427734 seconds! Preparing result...
Prediction
yuval-alaluf/restyle_encoder:898c82c1a38bd205a5a3bbc06ab567bc32a2c3324b3d8205e4c3ab7c368fe668IDa6xzwypicfbgfkdkipllxcz2omStatusSucceededSourceWebHardware–Total duration–CreatedInput
{ "input": "https://replicate.delivery/mgxm/1a620003-3cd5-445f-9383-c1b79f62152a/blunt.jpg", "encoding_type": "toonify", "num_iterations": "2", "display_intermediate_results": false }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run yuval-alaluf/restyle_encoder using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "yuval-alaluf/restyle_encoder:898c82c1a38bd205a5a3bbc06ab567bc32a2c3324b3d8205e4c3ab7c368fe668", { input: { input: "https://replicate.delivery/mgxm/1a620003-3cd5-445f-9383-c1b79f62152a/blunt.jpg", encoding_type: "toonify", num_iterations: "2", display_intermediate_results: false } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run yuval-alaluf/restyle_encoder using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "yuval-alaluf/restyle_encoder:898c82c1a38bd205a5a3bbc06ab567bc32a2c3324b3d8205e4c3ab7c368fe668", input={ "input": "https://replicate.delivery/mgxm/1a620003-3cd5-445f-9383-c1b79f62152a/blunt.jpg", "encoding_type": "toonify", "num_iterations": "2", "display_intermediate_results": False } ) # The yuval-alaluf/restyle_encoder model can stream output as it's running. # The predict method returns an iterator, and you can iterate over that output. for item in output: # https://replicate.com/yuval-alaluf/restyle_encoder/api#output-schema print(item)
To learn more, take a look at the guide on getting started with Python.
Run yuval-alaluf/restyle_encoder 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": "yuval-alaluf/restyle_encoder:898c82c1a38bd205a5a3bbc06ab567bc32a2c3324b3d8205e4c3ab7c368fe668", "input": { "input": "https://replicate.delivery/mgxm/1a620003-3cd5-445f-9383-c1b79f62152a/blunt.jpg", "encoding_type": "toonify", "num_iterations": "2", "display_intermediate_results": false } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2021-09-09T06:41:51.125435Z", "created_at": "2021-09-09T06:41:36.172035Z", "data_removed": false, "error": null, "id": "a6xzwypicfbgfkdkipllxcz2om", "input": { "input": "https://replicate.delivery/mgxm/1a620003-3cd5-445f-9383-c1b79f62152a/blunt.jpg", "encoding_type": "toonify", "num_iterations": "2", "display_intermediate_results": false }, "logs": "Loading faces model...\nLoading ReStyle pSp from checkpoint: pretrained_models/restyle_psp_ffhq_encode.pt\nDone!\nLoading toonify model...\nLoading ReStyle pSp from checkpoint: pretrained_models/restyle_psp_toonify.pt\nDone!\nAligning image...\nDone!\nRunning inference...\nFinished inference in 0.4569976329803467 seconds!\nPreparing result...", "metrics": {}, "output": [ { "file": "https://replicate.delivery/mgxm/f2cdae92-a5c8-4028-b6a1-e6c74a35dabb/output.png" } ], "started_at": null, "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/a6xzwypicfbgfkdkipllxcz2om", "cancel": "https://api.replicate.com/v1/predictions/a6xzwypicfbgfkdkipllxcz2om/cancel" }, "version": "898c82c1a38bd205a5a3bbc06ab567bc32a2c3324b3d8205e4c3ab7c368fe668" }
Loading faces model... Loading ReStyle pSp from checkpoint: pretrained_models/restyle_psp_ffhq_encode.pt Done! Loading toonify model... Loading ReStyle pSp from checkpoint: pretrained_models/restyle_psp_toonify.pt Done! Aligning image... Done! Running inference... Finished inference in 0.4569976329803467 seconds! Preparing result...
Prediction
yuval-alaluf/restyle_encoder:285cfce6766c53b472d02ce9333a48536202b077be5fb4730af4d577ef7f803bIDheuu7bfgizgz3azysfm2kguraaStatusSucceededSourceWebHardware–Total duration–CreatedInput
{ "input": "https://replicate.delivery/mgxm/0562e6c1-88e6-4c67-b7d6-66093730e536/benedict.jpeg", "encoding_type": "toonify", "num_iterations": "2", "display_intermediate_results": false }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run yuval-alaluf/restyle_encoder using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "yuval-alaluf/restyle_encoder:285cfce6766c53b472d02ce9333a48536202b077be5fb4730af4d577ef7f803b", { input: { input: "https://replicate.delivery/mgxm/0562e6c1-88e6-4c67-b7d6-66093730e536/benedict.jpeg", encoding_type: "toonify", num_iterations: "2", display_intermediate_results: false } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run yuval-alaluf/restyle_encoder using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "yuval-alaluf/restyle_encoder:285cfce6766c53b472d02ce9333a48536202b077be5fb4730af4d577ef7f803b", input={ "input": "https://replicate.delivery/mgxm/0562e6c1-88e6-4c67-b7d6-66093730e536/benedict.jpeg", "encoding_type": "toonify", "num_iterations": "2", "display_intermediate_results": False } ) # The yuval-alaluf/restyle_encoder model can stream output as it's running. # The predict method returns an iterator, and you can iterate over that output. for item in output: # https://replicate.com/yuval-alaluf/restyle_encoder/api#output-schema print(item)
To learn more, take a look at the guide on getting started with Python.
Run yuval-alaluf/restyle_encoder 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": "yuval-alaluf/restyle_encoder:285cfce6766c53b472d02ce9333a48536202b077be5fb4730af4d577ef7f803b", "input": { "input": "https://replicate.delivery/mgxm/0562e6c1-88e6-4c67-b7d6-66093730e536/benedict.jpeg", "encoding_type": "toonify", "num_iterations": "2", "display_intermediate_results": false } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2021-09-14T18:31:53.076885Z", "created_at": "2021-09-14T18:31:42.357774Z", "data_removed": false, "error": null, "id": "heuu7bfgizgz3azysfm2kguraa", "input": { "input": "https://replicate.delivery/mgxm/0562e6c1-88e6-4c67-b7d6-66093730e536/benedict.jpeg", "encoding_type": "toonify", "num_iterations": "2", "display_intermediate_results": false }, "logs": "Loading faces model...\nLoading ReStyle pSp from checkpoint: pretrained_models/restyle_psp_ffhq_encode.pt\nDone!\nLoading toonify model...\nLoading ReStyle pSp from checkpoint: pretrained_models/restyle_psp_toonify.pt\nDone!\nAligning image...\nDone!\nRunning inference...\nFinished inference in 0.44214463233947754 seconds!\nPreparing result...", "metrics": { "total_time": 10.719111 }, "output": [ { "file": "https://replicate.delivery/mgxm/dbe85891-61e1-42e0-9654-bc200b074072/output.png" } ], "started_at": "2021-12-04T23:37:53.377905Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/heuu7bfgizgz3azysfm2kguraa", "cancel": "https://api.replicate.com/v1/predictions/heuu7bfgizgz3azysfm2kguraa/cancel" }, "version": "285cfce6766c53b472d02ce9333a48536202b077be5fb4730af4d577ef7f803b" }
Loading faces model... Loading ReStyle pSp from checkpoint: pretrained_models/restyle_psp_ffhq_encode.pt Done! Loading toonify model... Loading ReStyle pSp from checkpoint: pretrained_models/restyle_psp_toonify.pt Done! Aligning image... Done! Running inference... Finished inference in 0.44214463233947754 seconds! Preparing result...
Prediction
yuval-alaluf/restyle_encoder:a5947984668920dbcd06e26e9a6d44d2d057e78973e35aa816cdc2da345cfe33Input
{ "input": "https://replicate.delivery/mgxm/24ebe659-33d0-4fec-a4b2-3b99f7960744/zuckerberg.jpg", "encoding_type": "toonify", "num_iterations": "2", "display_intermediate_results": false }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run yuval-alaluf/restyle_encoder using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "yuval-alaluf/restyle_encoder:a5947984668920dbcd06e26e9a6d44d2d057e78973e35aa816cdc2da345cfe33", { input: { input: "https://replicate.delivery/mgxm/24ebe659-33d0-4fec-a4b2-3b99f7960744/zuckerberg.jpg", encoding_type: "toonify", num_iterations: "2", display_intermediate_results: false } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run yuval-alaluf/restyle_encoder using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "yuval-alaluf/restyle_encoder:a5947984668920dbcd06e26e9a6d44d2d057e78973e35aa816cdc2da345cfe33", input={ "input": "https://replicate.delivery/mgxm/24ebe659-33d0-4fec-a4b2-3b99f7960744/zuckerberg.jpg", "encoding_type": "toonify", "num_iterations": "2", "display_intermediate_results": False } ) # The yuval-alaluf/restyle_encoder model can stream output as it's running. # The predict method returns an iterator, and you can iterate over that output. for item in output: # https://replicate.com/yuval-alaluf/restyle_encoder/api#output-schema print(item)
To learn more, take a look at the guide on getting started with Python.
Run yuval-alaluf/restyle_encoder 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": "yuval-alaluf/restyle_encoder:a5947984668920dbcd06e26e9a6d44d2d057e78973e35aa816cdc2da345cfe33", "input": { "input": "https://replicate.delivery/mgxm/24ebe659-33d0-4fec-a4b2-3b99f7960744/zuckerberg.jpg", "encoding_type": "toonify", "num_iterations": "2", "display_intermediate_results": false } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2021-09-14T18:35:48.827568Z", "created_at": "2021-09-14T18:34:34.776033Z", "data_removed": false, "error": null, "id": "zzuqb3etdzbv5o3c234ijwiib4", "input": { "input": "https://replicate.delivery/mgxm/24ebe659-33d0-4fec-a4b2-3b99f7960744/zuckerberg.jpg", "encoding_type": "toonify", "num_iterations": "2", "display_intermediate_results": false }, "logs": "Loading faces model...\nLoading ReStyle pSp from checkpoint: pretrained_models/restyle_psp_ffhq_encode.pt\nDone!\nLoading toonify model...\nLoading ReStyle pSp from checkpoint: pretrained_models/restyle_psp_toonify.pt\nDone!\nAligning image...\nDone!\nRunning inference...\nFinished inference in 0.47192955017089844 seconds!\nPreparing result...", "metrics": { "total_time": 74.051535 }, "output": [ { "file": "https://replicate.delivery/mgxm/0245cab7-1ed2-40fe-a3b4-e7b81471135f/output.png" } ], "started_at": "2021-12-21T12:05:21.031137Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/zzuqb3etdzbv5o3c234ijwiib4", "cancel": "https://api.replicate.com/v1/predictions/zzuqb3etdzbv5o3c234ijwiib4/cancel" }, "version": "a5947984668920dbcd06e26e9a6d44d2d057e78973e35aa816cdc2da345cfe33" }
Loading faces model... Loading ReStyle pSp from checkpoint: pretrained_models/restyle_psp_ffhq_encode.pt Done! Loading toonify model... Loading ReStyle pSp from checkpoint: pretrained_models/restyle_psp_toonify.pt Done! Aligning image... Done! Running inference... Finished inference in 0.47192955017089844 seconds! Preparing result...
Want to make some of these yourself?
Run this model