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.
Choose generating images from in-the-wild text, MSCOCO datasets, or ImageNet class label.
Default: "in-the-wild text"
Prompt for generating image. Valid when generation_type is set to in-the-wild text and MSCOCO datasets.
Default: ""
Choose the ImageNet label. Valid when generation_type is set to ImageNet class label.
Default: "None"
Number of generated images.
Default: 4
Sample with truncation.
Default: 0.86
Improved VQ-Diffusion with learnable classifier-free sampling.
Default: 1
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
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: { prompt: "teddy bear playing in the pool", num_images: 4, image_class: "None", guidance_scale: 5, generation_type: "in-the-wild text", truncation_rate: 1 } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
import replicate
output = replicate.run( "microsoft/vq-diffusion:81ca56aa6c06543cf0398aa5a13102a294abfb8cea8f1aa307a7c1556e638ac9", input={ "prompt": "teddy bear playing in the pool", "num_images": 4, "image_class": "None", "guidance_scale": 5, "generation_type": "in-the-wild text", "truncation_rate": 1 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
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": { "prompt": "teddy bear playing in the pool", "num_images": 4, "image_class": "None", "guidance_scale": 5, "generation_type": "in-the-wild text", "truncation_rate": 1 } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{ "completed_at": "2022-06-30T14:44:18.829720Z", "created_at": "2022-06-30T14:43:27.504481Z", "data_removed": false, "error": null, "id": "xzybxltvefafhibs6jvgwq7w24", "input": { "prompt": "teddy bear playing in the pool", "num_images": 4, "image_class": "None", "guidance_scale": 5, "generation_type": "in-the-wild text", "truncation_rate": "1" }, "logs": null, "metrics": { "predict_time": 51.121242, "total_time": 51.325239 }, "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" } ], "started_at": "2022-06-30T14:43:27.708478Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/xzybxltvefafhibs6jvgwq7w24", "cancel": "https://api.replicate.com/v1/predictions/xzybxltvefafhibs6jvgwq7w24/cancel" }, "version": "81ca56aa6c06543cf0398aa5a13102a294abfb8cea8f1aa307a7c1556e638ac9" }