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_WaC**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run microsoft/vq-diffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"microsoft/vq-diffusion:81ca56aa6c06543cf0398aa5a13102a294abfb8cea8f1aa307a7c1556e638ac9",
{
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_WaC**********************************
This is your API token. Keep it to yourself.
import replicate
Run microsoft/vq-diffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"microsoft/vq-diffusion:81ca56aa6c06543cf0398aa5a13102a294abfb8cea8f1aa307a7c1556e638ac9",
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_WaC**********************************
This is your API token. Keep it to yourself.
Run microsoft/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": "microsoft/vq-diffusion:81ca56aa6c06543cf0398aa5a13102a294abfb8cea8f1aa307a7c1556e638ac9",
"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": "xzybxltvefafhibs6jvgwq7w24",
"model": "microsoft/vq-diffusion",
"version": "81ca56aa6c06543cf0398aa5a13102a294abfb8cea8f1aa307a7c1556e638ac9",
"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": "",
"output": [
{
"image": "https://replicate.delivery/mgxm/c143b007-2317-4fb0-a138-0e12e4271fe4/output_0.png"
},
{
"image": "https://replicate.delivery/mgxm/a8c9fe33-9571-4797-9f6c-8b29e913947b/output_1.png"
},
{
"image": "https://replicate.delivery/mgxm/7b684e1c-6de9-46c3-9938-505930fb080b/output_2.png"
},
{
"image": "https://replicate.delivery/mgxm/ed69a8ee-0d50-4dce-873a-519de16281f9/output_3.png"
}
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2022-06-30T14:43:27.504481Z",
"started_at": "2022-06-30T14:43:27.708478Z",
"completed_at": "2022-06-30T14:44:18.82972Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/xzybxltvefafhibs6jvgwq7w24/cancel",
"get": "https://api.replicate.com/v1/predictions/xzybxltvefafhibs6jvgwq7w24"
},
"metrics": {
"predict_time": 51.121242,
"total_time": 51.325239
}
}