Skip to main content
POST
/
v1
/
generate-image
curl --request POST \
--url https://api.incredible.one/v1/generate-image \
--header 'Content-Type: application/json' \
--data '{
"prompt": "A majestic mountain landscape at sunset with vibrant colors"
}'
{
"success": true,
"image_url": "https://storage.googleapis.com/fw-flumina-kontext-images/abc123.jpeg",
"request_id": "abc123",
"seed": 42
}

Overview

Generate high-quality images from natural language descriptions using state-of-the-art FLUX.1 Kontext [pro] model. Perfect for content creation, product mockups, marketing materials, and creative projects. Generation time: 10-60 seconds
Model: FLUX.1 Kontext [pro] (Fireworks AI)
Output: JPEG or PNG image URLs

Use cases

  • Content creation — Blog images, social media posts, thumbnails
  • Product design — Mockups, concept art, visual brainstorming
  • Marketing — Ad creatives, promotional materials, landing page graphics
  • Creative projects — Illustrations, artwork, visual storytelling
  • UI/UX design — Hero images, backgrounds, placeholder content

Parameters

ParameterTypeRequiredDefaultDescription
promptstring✅ Yes-Text description of the image to generate
aspect_ratiostring❌ No"16:9"Image dimensions: 1:1, 16:9, 9:16, 4:3, 3:4, 21:9, 9:21
output_formatstring❌ No"jpeg"Output format: jpeg or png
seedinteger❌ NorandomRandom seed for reproducibility
prompt_upsamplingboolean❌ NofalseEnhance prompt for more creative results
safety_toleranceinteger❌ No2Content moderation (0-6, 0 is most strict)

Response

{
  "success": true,
  "image_url": "https://storage.googleapis.com/...",
  "request_id": "abc123",
  "seed": 42
}
FieldTypeDescription
successbooleanWhether generation succeeded
image_urlstringURL to the generated image (expires in 1 hour)
image_base64stringBase64-encoded image data (if available)
request_idstringUnique request ID
seedintegerSeed used for generation

Aspect ratios

Choose the right dimensions for your use case:
RatioBest forExample use cases
1:1SquareSocial media posts (Instagram), avatars, thumbnails
16:9WidescreenBlog headers, YouTube thumbnails, presentations
9:16PortraitMobile screens, Instagram stories, TikTok
4:3StandardTraditional photos, print materials
3:4Tall portraitBook covers, posters
21:9Ultra-wideCinematic, panoramic scenes

Examples

Basic image generation

curl -X POST https://api.incredible.one/v1/generate-image \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A majestic mountain landscape at sunset with vibrant colors"
  }'

With specific aspect ratio

import requests

response = requests.post(
    'https://api.incredible.one/v1/generate-image',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    json={
        'prompt': 'A minimalist coffee cup on a wooden table',
        'aspect_ratio': '1:1',
        'output_format': 'png'
    }
)

result = response.json()
if result['success']:
    print(f"Image URL: {result['image_url']}")

Reproducible generation with seed

const response = await fetch('https://api.incredible.one/v1/generate-image', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    prompt: 'A futuristic cyberpunk city at night',
    seed: 42,
    aspect_ratio: '16:9'
  })
});

const result = await response.json();
console.log('Image URL:', result.image_url);
console.log('Seed:', result.seed); // Use same seed for similar images

Prompt writing tips

Be specific and detailed

Vague: “A car”
Better: “A red sports car parked on a winding mountain road at sunset”

Include style and mood

  • “A watercolor painting of…”
  • “A photorealistic image of…”
  • “A minimalist illustration of…”
  • “…with dramatic lighting”
  • “…in soft pastel colors”

Describe composition and perspective

  • “…viewed from above”
  • “…close-up shot”
  • “…wide-angle landscape”
  • “…centered composition”

Use prompt upsampling for simple prompts

If your prompt is brief, enable prompt_upsampling: true to let the model enhance it:
{
  "prompt": "dragon",
  "prompt_upsampling": true
}

Seeds for reproducibility

Using the same seed with the same prompt will generate similar (but not identical) images:
# Generate image with specific seed
response = requests.post(
    'https://api.incredible.one/v1/generate-image',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    json={
        'prompt': 'A sunset over mountains',
        'seed': 12345
    }
)

# Later, use same seed for similar style
response2 = requests.post(
    'https://api.incredible.one/v1/generate-image',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    json={
        'prompt': 'A sunrise over ocean',  # Different prompt
        'seed': 12345  # Same seed = similar style
    }
)

Error handling

response = requests.post(
    'https://api.incredible.one/v1/generate-image',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    json={'prompt': 'A beautiful landscape'}
)

result = response.json()

if result['success']:
    image_url = result['image_url']
    print(f"Generated: {image_url}")
else:
    error = result['error']
    print(f"Error: {error}")
    if 'details' in result:
        print(f"Details: {result['details']}")

Common errors

StatusErrorSolution
400Invalid requestCheck parameters match required format
401UnauthorizedVerify API key is correct
500Generation failedTry again or simplify prompt
504TimeoutGeneration took >5 minutes, retry

Limitations

  • Generation time: 10-60 seconds per image
  • URL expiration: Image URLs expire after 1 hour
  • Content policy: Subject to Fireworks AI content moderation
  • Rate limits: Shared with other API endpoints

Best practices

  1. Save images immediately — URLs expire in 1 hour
  2. Use descriptive prompts — More details = better results
  3. Choose appropriate aspect ratios — Match your use case
  4. Store seeds — Keep seeds for images you want to recreate
  5. Handle timeouts — Retry failed generations

vs Other endpoints

Feature/v1/generate-image/v1/chat-completion
OutputImagesText, tool calls
Generation time10-60 seconds1-10 seconds
Use caseVisual contentConversations, agents
Requires promptYesYes (as message)
Supports toolsNoYes

Model information

  • Model: FLUX.1 Kontext [pro]
  • Provider: Fireworks AI
  • Context-aware: Yes
  • Quality: High (professional-grade)
  • Speed: 2-5 seconds average generation time

Next steps

Body

application/json
prompt
string
required

Text description of the image to generate

Minimum length: 1
aspect_ratio
enum<string>
default:16:9

Aspect ratio of the output image

Available options:
1:1,
16:9,
9:16,
4:3,
3:4,
21:9,
9:21
output_format
enum<string>
default:jpeg

Output format of the generated image

Available options:
jpeg,
png
seed
integer

Random seed for reproducibility. Using the same seed with the same prompt will generate similar images

prompt_upsampling
boolean
default:false

Whether to enhance the prompt for more creative generation

safety_tolerance
integer
default:2

Content moderation level (0-6, where 0 is most strict)

Required range: 0 <= x <= 6

Response

Image generated successfully

success
boolean
required

Whether image generation was successful

image_url
string<uri>

URL to the generated image (expires in 1 hour)

image_base64
string

Base64-encoded image data (if available)

request_id
string

Unique request ID from Fireworks API

seed
integer

Seed used for generation