typefile
{
"T_inv": 200,
"T_step": 100,
"image": "https://replicate.delivery/mgxm/c4d3d37d-8545-4941-b6aa-fce61d7d0769/download.png",
"manipulation_amplitude": 0.3,
"target_class": "Bangs"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_A9F**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run cjwbw/diffae using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"cjwbw/diffae:5d917b91659e117aa8b0c5d6213077e9132083e4a8a272f344cc52c3ba2f6e98",
{
input: {
T_inv: 200,
T_step: 100,
image: "https://replicate.delivery/mgxm/c4d3d37d-8545-4941-b6aa-fce61d7d0769/download.png",
manipulation_amplitude: 0.3,
target_class: "Bangs"
}
}
);
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_A9F**********************************
This is your API token. Keep it to yourself.
import replicate
Run cjwbw/diffae using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"cjwbw/diffae:5d917b91659e117aa8b0c5d6213077e9132083e4a8a272f344cc52c3ba2f6e98",
input={
"T_inv": 200,
"T_step": 100,
"image": "https://replicate.delivery/mgxm/c4d3d37d-8545-4941-b6aa-fce61d7d0769/download.png",
"manipulation_amplitude": 0.3,
"target_class": "Bangs"
}
)
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=r8_A9F**********************************
This is your API token. Keep it to yourself.
Run cjwbw/diffae 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": "cjwbw/diffae:5d917b91659e117aa8b0c5d6213077e9132083e4a8a272f344cc52c3ba2f6e98",
"input": {
"T_inv": 200,
"T_step": 100,
"image": "https://replicate.delivery/mgxm/c4d3d37d-8545-4941-b6aa-fce61d7d0769/download.png",
"manipulation_amplitude": 0.3,
"target_class": "Bangs"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "zslqku6dlndo3fs33vgtzeugvm",
"model": "cjwbw/diffae",
"version": "5d917b91659e117aa8b0c5d6213077e9132083e4a8a272f344cc52c3ba2f6e98",
"input": {
"T_inv": 200,
"T_step": 100,
"image": "https://replicate.delivery/mgxm/c4d3d37d-8545-4941-b6aa-fce61d7d0769/download.png",
"manipulation_amplitude": 0.3,
"target_class": "Bangs"
},
"logs": "Aligning image...\nEncoding and Manipulating the aligned image...\npredict.py:125: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).\n convert_img = torch.tensor(img)",
"output": [
{
"image": "https://replicate.delivery/mgxm/98cdbe4e-bdfa-4dfe-ac5d-fe88958ba698/original_aligned.png"
},
{
"image": "https://replicate.delivery/mgxm/a174e57b-1fdf-40b7-8132-3307a7a8d6c0/manipulated_img.png"
}
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2022-08-03T20:50:04.745592Z",
"started_at": "2022-08-03T20:51:22.666905Z",
"completed_at": "2022-08-03T20:51:54.463524Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/zslqku6dlndo3fs33vgtzeugvm/cancel",
"get": "https://api.replicate.com/v1/predictions/zslqku6dlndo3fs33vgtzeugvm"
},
"metrics": {
"predict_time": 31.796619,
"total_time": 109.717932
}
}