defaultin-the-wild text
typeenum
value typestring
optionsin-the-wild text, MSCOCO datasets, ImageNet class label
{
"generation_type": "in-the-wild text",
"guidance_scale": 5,
"image_class": "None",
"num_images": 4,
"prompt": "teddy bear playing in the pool",
"truncation_rate": "1"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_AQj**********************************
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/vq-diffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"cjwbw/vq-diffusion:be7cfa9e423f2f6269e22d75f96e6e6a2b140c42d3526fee5028576c108c6889",
{
input: {
generation_type: "in-the-wild text",
guidance_scale: 5,
image_class: "None",
num_images: 4,
prompt: "teddy bear playing in the pool",
truncation_rate: "1"
}
}
);
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_AQj**********************************
This is your API token. Keep it to yourself.
import replicate
Run cjwbw/vq-diffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"cjwbw/vq-diffusion:be7cfa9e423f2f6269e22d75f96e6e6a2b140c42d3526fee5028576c108c6889",
input={
"generation_type": "in-the-wild text",
"guidance_scale": 5,
"image_class": "None",
"num_images": 4,
"prompt": "teddy bear playing in the pool",
"truncation_rate": "1"
}
)
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_AQj**********************************
This is your API token. Keep it to yourself.
Run cjwbw/vq-diffusion 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/vq-diffusion:be7cfa9e423f2f6269e22d75f96e6e6a2b140c42d3526fee5028576c108c6889",
"input": {
"generation_type": "in-the-wild text",
"guidance_scale": 5,
"image_class": "None",
"num_images": 4,
"prompt": "teddy bear playing in the pool",
"truncation_rate": "1"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "iovzzmsirreu3lsxvro26kr54e",
"model": "cjwbw/vq-diffusion",
"version": "be7cfa9e423f2f6269e22d75f96e6e6a2b140c42d3526fee5028576c108c6889",
"input": {
"generation_type": "in-the-wild text",
"guidance_scale": 5,
"image_class": "None",
"num_images": 4,
"prompt": "teddy bear playing in the pool",
"truncation_rate": "1"
},
"logs": "/root/.pyenv/versions/3.8.13/lib/python3.8/site-packages/torch/utils/checkpoint.py:25: UserWarning: None of the inputs have requires_grad=True. Gradients will be None\n warnings.warn(\"None of the inputs have requires_grad=True. Gradients will be None\")\n/root/.pyenv/versions/3.8.13/lib/python3.8/site-packages/torch/nn/functional.py:1806: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.\n warnings.warn(\"nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.\")",
"output": [
{
"image": "https://replicate.delivery/mgxm/3b98f549-c8ba-46ab-90bb-da705ec7448a/output_0.png"
},
{
"image": "https://replicate.delivery/mgxm/fc34de91-d71f-423d-a6c4-d6723831ccf8/output_1.png"
},
{
"image": "https://replicate.delivery/mgxm/0a8f10e5-587a-45cd-b02f-8c3867872c1d/output_2.png"
},
{
"image": "https://replicate.delivery/mgxm/2eeb886b-a24e-470a-bdb7-1fe8b62fcfd6/output_3.png"
}
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2022-08-04T12:24:03.513718Z",
"started_at": "2022-08-04T12:32:00.698456Z",
"completed_at": "2022-08-04T12:32:52.890035Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/iovzzmsirreu3lsxvro26kr54e/cancel",
"get": "https://api.replicate.com/v1/predictions/iovzzmsirreu3lsxvro26kr54e"
},
"metrics": {
"predict_time": 52.191579,
"total_time": 529.376317
}
}