Generate images with Amazon Nova Canvas
const url = 'https://dashboard.quantcdn.io/api/v3/organizations/example/ai/image-generation';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"taskType":"TEXT_IMAGE","textToImageParams":{"text":"A serene mountain landscape at sunset with snow-capped peaks","negativeText":"blurry, low quality, distorted","style":"PHOTOREALISM"},"imageGenerationConfig":{"width":1024,"height":1024,"quality":"premium","numberOfImages":1,"cfgScale":7},"region":"us-east-1"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://dashboard.quantcdn.io/api/v3/organizations/example/ai/image-generation \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "taskType": "TEXT_IMAGE", "textToImageParams": { "text": "A serene mountain landscape at sunset with snow-capped peaks", "negativeText": "blurry, low quality, distorted", "style": "PHOTOREALISM" }, "imageGenerationConfig": { "width": 1024, "height": 1024, "quality": "premium", "numberOfImages": 1, "cfgScale": 7 }, "region": "us-east-1" }'Generates images using Amazon Nova Canvas image generation model.
*
* Region Restriction: Nova Canvas is ONLY available in:
* - us-east-1 (US East, N. Virginia)
* - ap-northeast-1 (Asia Pacific, Tokyo)
* - eu-west-1 (Europe, Ireland)
* ❌ NOT available in ap-southeast-2 (Sydney)
*
* Supported Task Types:
* - TEXT_IMAGE: Basic text-to-image generation
* - TEXT_IMAGE with Conditioning: Layout-guided generation using edge detection or segmentation
* - COLOR_GUIDED_GENERATION: Generate images with specific color palettes
* - IMAGE_VARIATION: Create variations of existing images
* - INPAINTING: Fill masked areas in images
* - OUTPAINTING: Extend images beyond their borders
* - BACKGROUND_REMOVAL: Remove backgrounds from images
* - VIRTUAL_TRY_ON: Try on garments/objects on people
*
* Quality Options:
* - standard: Faster generation, lower cost
* - premium: Higher quality, slower generation
*
* Timeout: Image generation can take up to 5 minutes
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The organisation ID
Request Bodyrequired
Section titled “Request Bodyrequired”Image generation request
object
Model to use for image generation
Type of image generation task
Parameters for TEXT_IMAGE task
object
Text prompt
What NOT to include
Base64-encoded conditioning image
Parameters for COLOR_GUIDED_GENERATION task
object
Parameters for IMAGE_VARIATION task
object
Parameters for INPAINTING task
object
Parameters for OUTPAINTING task
object
Parameters for BACKGROUND_REMOVAL task
object
Parameters for VIRTUAL_TRY_ON task
object
General image generation configuration
object
AWS region for Nova Canvas
Example
{ "taskType": "TEXT_IMAGE", "textToImageParams": { "text": "A serene mountain landscape at sunset with snow-capped peaks", "negativeText": "blurry, low quality, distorted", "style": "PHOTOREALISM" }, "imageGenerationConfig": { "width": 1024, "height": 1024, "quality": "premium", "numberOfImages": 1, "cfgScale": 7 }, "region": "us-east-1"}Responses
Section titled “Responses”Image(s) generated successfully
object
Array of base64-encoded generated images
Base64-encoded mask image (for virtual try-on)
Error message if any images were blocked by content moderation
Examplegenerated
{ "images": [ "example" ], "maskImage": "example", "error": "example"}Invalid request parameters
Access denied
Failed to generate images
