You're looking at a specific version of this model. Jump to the model overview.
eladrich /pixel2style2pixel:919ed2f7
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 eladrich/pixel2style2pixel using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"eladrich/pixel2style2pixel:919ed2f7b6c5c24f3a53207842b61b6eba515136bd7bb9ffa75e01e970609cc4",
{
input: {
image: "https://replicate.delivery/mgxm/7935db96-ae91-440f-8c75-b94bd6315d79/input_img.jpg",
model: "toonify"
}
}
);
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 eladrich/pixel2style2pixel using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"eladrich/pixel2style2pixel:919ed2f7b6c5c24f3a53207842b61b6eba515136bd7bb9ffa75e01e970609cc4",
input={
"image": "https://replicate.delivery/mgxm/7935db96-ae91-440f-8c75-b94bd6315d79/input_img.jpg",
"model": "toonify"
}
)
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 eladrich/pixel2style2pixel 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": "919ed2f7b6c5c24f3a53207842b61b6eba515136bd7bb9ffa75e01e970609cc4",
"input": {
"image": "https://replicate.delivery/mgxm/7935db96-ae91-440f-8c75-b94bd6315d79/input_img.jpg",
"model": "toonify"
}
}' \
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/eladrich/pixel2style2pixel@sha256:919ed2f7b6c5c24f3a53207842b61b6eba515136bd7bb9ffa75e01e970609cc4 \
-i 'image="https://replicate.delivery/mgxm/7935db96-ae91-440f-8c75-b94bd6315d79/input_img.jpg"' \
-i 'model="toonify"'
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/eladrich/pixel2style2pixel@sha256:919ed2f7b6c5c24f3a53207842b61b6eba515136bd7bb9ffa75e01e970609cc4
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "image": "https://replicate.delivery/mgxm/7935db96-ae91-440f-8c75-b94bd6315d79/input_img.jpg", "model": "toonify" } }' \ 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.0019. 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-14T22:01:27.122378Z",
"created_at": "2021-09-14T22:01:17.248756Z",
"data_removed": false,
"error": null,
"id": "epfjo3erfnfizagwhoqnv4a3hq",
"input": {
"image": "https://replicate.delivery/mgxm/7935db96-ae91-440f-8c75-b94bd6315d79/input_img.jpg",
"model": "toonify"
},
"logs": "Namespace(batch_size=8, board_interval=50, checkpoint_path='pretrained_models/psp_ffhq_toonify.pt', dataset_type='ffhq_encode', device='cuda:0', encoder_type='GradualStyleEncoder', exp_dir='', id_lambda=1.0, image_interval=100, input_nc=3, l2_lambda=1.0, l2_lambda_crop=0, label_nc=0, learn_in_w=False, learning_rate=0.0001, lpips_lambda=0.8, lpips_lambda_crop=0, max_steps='10000', optim_name='ranger', output_size=1024, resize_factors=None, save_interval=1000, start_from_latent_avg=True, stylegan_weights='', test_batch_size=8, test_workers=8, train_decoder=False, val_interval=1000, w_norm_lambda=0.025, workers=8)\nLoading pSp from checkpoint: pretrained_models/psp_ffhq_toonify.pt\nModel successfully loaded!\nAligned image has shape: (256, 256)",
"metrics": {
"total_time": 9.873622
},
"output": [
{
"file": "https://replicate.delivery/mgxm/ad94def7-0808-4f65-ab1f-c3e157df82cd/out.png"
}
],
"started_at": "2021-11-30T17:26:23.902218Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/epfjo3erfnfizagwhoqnv4a3hq",
"cancel": "https://api.replicate.com/v1/predictions/epfjo3erfnfizagwhoqnv4a3hq/cancel"
},
"version": "a9e25b9995d98612afc75a3dd98446976aec34251843b36a7b34d7e272d170cf"
}
Namespace(batch_size=8, board_interval=50, checkpoint_path='pretrained_models/psp_ffhq_toonify.pt', dataset_type='ffhq_encode', device='cuda:0', encoder_type='GradualStyleEncoder', exp_dir='', id_lambda=1.0, image_interval=100, input_nc=3, l2_lambda=1.0, l2_lambda_crop=0, label_nc=0, learn_in_w=False, learning_rate=0.0001, lpips_lambda=0.8, lpips_lambda_crop=0, max_steps='10000', optim_name='ranger', output_size=1024, resize_factors=None, save_interval=1000, start_from_latent_avg=True, stylegan_weights='', test_batch_size=8, test_workers=8, train_decoder=False, val_interval=1000, w_norm_lambda=0.025, workers=8)
Loading pSp from checkpoint: pretrained_models/psp_ffhq_toonify.pt
Model successfully loaded!
Aligned image has shape: (256, 256)
This example was created by a different version, eladrich/pixel2style2pixel:a9e25b99.