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.
wolverinn /image-style-transfer-pytorch:85791f7c
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";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run wolverinn/image-style-transfer-pytorch using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"wolverinn/image-style-transfer-pytorch:85791f7c6ed6339236e5218ec234c9f03b93da0cab8ed6c36c2853ff2eb070c5",
{
input: {
style: "https://replicate.delivery/pbxt/IqlSqyRekHzdJfrPX86IDKYzqyxduaLdsrJ0ZaOjeqEQoP6V/wallhaven-665019.png",
content: "https://replicate.delivery/pbxt/IqlSrGQYeJAWOTyZ29tsRaU4KmBUPo82UHmee8a0oOKFRZPf/11.jpg"
}
}
);
// 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 wolverinn/image-style-transfer-pytorch using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"wolverinn/image-style-transfer-pytorch:85791f7c6ed6339236e5218ec234c9f03b93da0cab8ed6c36c2853ff2eb070c5",
input={
"style": "https://replicate.delivery/pbxt/IqlSqyRekHzdJfrPX86IDKYzqyxduaLdsrJ0ZaOjeqEQoP6V/wallhaven-665019.png",
"content": "https://replicate.delivery/pbxt/IqlSrGQYeJAWOTyZ29tsRaU4KmBUPo82UHmee8a0oOKFRZPf/11.jpg"
}
)
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 wolverinn/image-style-transfer-pytorch 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": "wolverinn/image-style-transfer-pytorch:85791f7c6ed6339236e5218ec234c9f03b93da0cab8ed6c36c2853ff2eb070c5",
"input": {
"style": "https://replicate.delivery/pbxt/IqlSqyRekHzdJfrPX86IDKYzqyxduaLdsrJ0ZaOjeqEQoP6V/wallhaven-665019.png",
"content": "https://replicate.delivery/pbxt/IqlSrGQYeJAWOTyZ29tsRaU4KmBUPo82UHmee8a0oOKFRZPf/11.jpg"
}
}' \
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": "2023-05-19T09:48:15.297124Z",
"created_at": "2023-05-19T09:44:58.637306Z",
"data_removed": false,
"error": null,
"id": "gn53ffpdkneobazj4razitawcm",
"input": {
"style": "https://replicate.delivery/pbxt/IqlSqyRekHzdJfrPX86IDKYzqyxduaLdsrJ0ZaOjeqEQoP6V/wallhaven-665019.png",
"content": "https://replicate.delivery/pbxt/IqlSrGQYeJAWOTyZ29tsRaU4KmBUPo82UHmee8a0oOKFRZPf/11.jpg"
},
"logs": "/root/.pyenv/versions/3.8.16/lib/python3.8/site-packages/torchvision/transforms/transforms.py:257: UserWarning: Argument interpolation should be of type InterpolationMode instead of int. Please, use InterpolationMode enum.\nwarnings.warn(\n[test] dataset [UnalignedDataset] was created",
"metrics": {
"predict_time": 4.156883,
"total_time": 196.659818
},
"output": "https://replicate.delivery/pbxt/icRIonLgfC1OMKUEj7CaKRuRsIzPw33Ix7UJio8oDaDvvneQA/1684489694.png",
"started_at": "2023-05-19T09:48:11.140241Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/gn53ffpdkneobazj4razitawcm",
"cancel": "https://api.replicate.com/v1/predictions/gn53ffpdkneobazj4razitawcm/cancel"
},
"version": "85791f7c6ed6339236e5218ec234c9f03b93da0cab8ed6c36c2853ff2eb070c5"
}
/root/.pyenv/versions/3.8.16/lib/python3.8/site-packages/torchvision/transforms/transforms.py:257: UserWarning: Argument interpolation should be of type InterpolationMode instead of int. Please, use InterpolationMode enum.
warnings.warn(
[test] dataset [UnalignedDataset] was created