typefile
{
"content": "https://replicate.delivery/mgxm/39030380-7bcc-43c8-967d-d3a9f3b8c8d6/bair.jpg",
"style": "https://replicate.delivery/mgxm/0152398e-c57d-42b0-ac9f-7383d5910294/feathers.jpg"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_HyX**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run huage001/adaattn using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"huage001/adaattn:a8b707926f5748f9ac47dbc7c1b6a5afaf3c64014f99d03ff6307ca5c7524ab7",
{
input: {
content: "https://replicate.delivery/mgxm/39030380-7bcc-43c8-967d-d3a9f3b8c8d6/bair.jpg",
style: "https://replicate.delivery/mgxm/0152398e-c57d-42b0-ac9f-7383d5910294/feathers.jpg"
}
}
);
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=r8_HyX**********************************
This is your API token. Keep it to yourself.
import replicate
Run huage001/adaattn using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"huage001/adaattn:a8b707926f5748f9ac47dbc7c1b6a5afaf3c64014f99d03ff6307ca5c7524ab7",
input={
"content": "https://replicate.delivery/mgxm/39030380-7bcc-43c8-967d-d3a9f3b8c8d6/bair.jpg",
"style": "https://replicate.delivery/mgxm/0152398e-c57d-42b0-ac9f-7383d5910294/feathers.jpg"
}
)
# The huage001/adaattn 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/huage001/adaattn/api#output-schema
print(item)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_HyX**********************************
This is your API token. Keep it to yourself.
Run huage001/adaattn 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": "huage001/adaattn:a8b707926f5748f9ac47dbc7c1b6a5afaf3c64014f99d03ff6307ca5c7524ab7",
"input": {
"content": "https://replicate.delivery/mgxm/39030380-7bcc-43c8-967d-d3a9f3b8c8d6/bair.jpg",
"style": "https://replicate.delivery/mgxm/0152398e-c57d-42b0-ac9f-7383d5910294/feathers.jpg"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"outputType": "object",
"properties": {
"file": {
"outputType": "uri",
"mimeType": "image/png",
"inferred": false,
"outputValue": "https://replicate.delivery/mgxm/088e9652-042e-4a67-85c9-98d668ffcbaa/out.png",
"typeMismatch": false
}
},
"inferred": false,
"outputValue": {
"file": "https://replicate.delivery/mgxm/088e9652-042e-4a67-85c9-98d668ffcbaa/out.png"
},
"typeMismatch": false
}{
"id": "dcocygpa2nbztji2d2v44h4boe",
"model": "huage001/adaattn",
"version": "a8b707926f5748f9ac47dbc7c1b6a5afaf3c64014f99d03ff6307ca5c7524ab7",
"input": {
"content": "https://replicate.delivery/mgxm/39030380-7bcc-43c8-967d-d3a9f3b8c8d6/bair.jpg",
"style": "https://replicate.delivery/mgxm/0152398e-c57d-42b0-ac9f-7383d5910294/feathers.jpg"
},
"logs": "/root/.pyenv/versions/3.8.12/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.\n warnings.warn(\n[test] dataset [UnalignedDataset] was created",
"output": [
{
"file": "https://replicate.delivery/mgxm/088e9652-042e-4a67-85c9-98d668ffcbaa/out.png"
}
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2021-10-28T17:34:15.024496Z",
"started_at": "2021-12-01T06:58:12.335603Z",
"completed_at": "2021-10-28T17:34:27.604541Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/dcocygpa2nbztji2d2v44h4boe/cancel",
"get": "https://api.replicate.com/v1/predictions/dcocygpa2nbztji2d2v44h4boe"
},
"metrics": {
"total_time": 12.580045
}
}
