Skip to main content

Generate Images

POST /v1/ai/image

Generate images from text prompts using AI models. This page covers all generation options and model-specific features.

Basic Generation

curl

curl -X POST https://api.vidiking.com/v1/ai/image \
-H "Authorization: Bearer $VIDIKING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A sleek electric car in a showroom with dramatic lighting",
"model": "flux",
"width": 1920,
"height": 1080
}'

Node.js

const image = await client.ai.generateImage({
prompt: 'A sleek electric car in a showroom with dramatic lighting',
model: 'flux',
width: 1920,
height: 1080,
});

console.log(image.url);

Python

image = client.ai.generate_image(
prompt="A sleek electric car in a showroom with dramatic lighting",
model="flux",
width=1920,
height=1080,
)
print(image.url)

Response

{
"id": "img_abc123",
"url": "https://cdn.vidiking.com/ai/img_abc123.png",
"model": "flux",
"width": 1920,
"height": 1080,
"credits_used": 5,
"created_at": "2025-01-15T10:30:00Z"
}

DALL-E 3

Best for photorealistic scenes and text in images. Cost: $0.18.

curl -X POST https://api.vidiking.com/v1/ai/image \
-H "Authorization: Bearer $VIDIKING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A coffee shop interior with a chalkboard menu that reads DAILY SPECIALS, warm ambient lighting",
"model": "dall-e-3",
"width": 1024,
"height": 1024,
"style": "vivid"
}'

DALL-E 3 specific options:

OptionValuesDescription
stylenatural, vividvivid produces more saturated, dramatic images

Flux

Best general-purpose model. Fast and cost-effective. Cost: $0.14.

curl -X POST https://api.vidiking.com/v1/ai/image \
-H "Authorization: Bearer $VIDIKING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Flat lay product photography of skincare bottles on marble surface with dried flowers",
"model": "flux",
"width": 1080,
"height": 1080,
"style": "natural"
}'

Stable Diffusion

Best for artistic styles and illustrations. Supports negative prompts. Cost: 4 credits.

curl -X POST https://api.vidiking.com/v1/ai/image \
-H "Authorization: Bearer $VIDIKING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Digital illustration of a fantasy castle on a floating island, concept art style, detailed",
"model": "stable-diffusion",
"width": 1024,
"height": 1024,
"style": "artistic",
"negative_prompt": "blurry, low quality, watermark, text"
}'

Stable Diffusion specific options:

OptionValuesDescription
negative_promptstringThings to exclude from the image
stylenatural, artisticGuides the overall aesthetic
steps20-50Inference steps (higher = more detail, slower)

Supported Sizes

Aspect RatioDimensionsUse Case
1:1512x512, 1024x1024Social media, profile images
16:91024x576, 1920x1080Video backgrounds, thumbnails
9:16576x1024, 1080x1920Stories, vertical content
4:31024x768Presentations
3:4768x1024Portrait-oriented content

Batch Generation

Generate multiple images in a single request. See Bulk Images for details.

Using in Video Timelines

Generated images can be used directly as assets in video timelines:

const bg = await client.ai.generateImage({
prompt: 'Abstract gradient background',
width: 1920,
height: 1080,
});

await client.render({
timeline: {
tracks: [{
clips: [{
asset: { type: 'image', src: bg.url },
start: 0,
length: 10,
}],
}],
},
output: { format: 'mp4', resolution: 'hd' },
});

Rate Limits

ModelRequests/min
flux30
stable-diffusion30
dall-e-315