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:
| Option | Values | Description |
|---|---|---|
style | natural, vivid | vivid 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:
| Option | Values | Description |
|---|---|---|
negative_prompt | string | Things to exclude from the image |
style | natural, artistic | Guides the overall aesthetic |
steps | 20-50 | Inference steps (higher = more detail, slower) |
Supported Sizes
| Aspect Ratio | Dimensions | Use Case |
|---|---|---|
| 1:1 | 512x512, 1024x1024 | Social media, profile images |
| 16:9 | 1024x576, 1920x1080 | Video backgrounds, thumbnails |
| 9:16 | 576x1024, 1080x1920 | Stories, vertical content |
| 4:3 | 1024x768 | Presentations |
| 3:4 | 768x1024 | Portrait-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
| Model | Requests/min |
|---|---|
flux | 30 |
stable-diffusion | 30 |
dall-e-3 | 15 |