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 secondsModel: 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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | ✅ Yes | - | Text description of the image to generate |
aspect_ratio | string | ❌ No | "16:9" | Image dimensions: 1:1, 16:9, 9:16, 4:3, 3:4, 21:9, 9:21 |
output_format | string | ❌ No | "jpeg" | Output format: jpeg or png |
seed | integer | ❌ No | random | Random seed for reproducibility |
prompt_upsampling | boolean | ❌ No | false | Enhance prompt for more creative results |
safety_tolerance | integer | ❌ No | 2 | Content moderation (0-6, 0 is most strict) |
Response
| Field | Type | Description |
|---|---|---|
success | boolean | Whether generation succeeded |
image_url | string | URL to the generated image (expires in 1 hour) |
image_base64 | string | Base64-encoded image data (if available) |
request_id | string | Unique request ID |
seed | integer | Seed used for generation |
Aspect ratios
Choose the right dimensions for your use case:| Ratio | Best for | Example use cases |
|---|---|---|
1:1 | Square | Social media posts (Instagram), avatars, thumbnails |
16:9 | Widescreen | Blog headers, YouTube thumbnails, presentations |
9:16 | Portrait | Mobile screens, Instagram stories, TikTok |
4:3 | Standard | Traditional photos, print materials |
3:4 | Tall portrait | Book covers, posters |
21:9 | Ultra-wide | Cinematic, panoramic scenes |
Examples
Basic image generation
With specific aspect ratio
Reproducible generation with seed
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, enableprompt_upsampling: true to let the model enhance it:
Seeds for reproducibility
Using the sameseed with the same prompt will generate similar (but not identical) images:
Error handling
Common errors
| Status | Error | Solution |
|---|---|---|
| 400 | Invalid request | Check parameters match required format |
| 401 | Unauthorized | Verify API key is correct |
| 500 | Generation failed | Try again or simplify prompt |
| 504 | Timeout | Generation 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
- Save images immediately — URLs expire in 1 hour
- Use descriptive prompts — More details = better results
- Choose appropriate aspect ratios — Match your use case
- Store seeds — Keep seeds for images you want to recreate
- Handle timeouts — Retry failed generations
vs Other endpoints
| Feature | /v1/generate-image | /v1/chat-completion |
|---|---|---|
| Output | Images | Text, tool calls |
| Generation time | 10-60 seconds | 1-10 seconds |
| Use case | Visual content | Conversations, agents |
| Requires prompt | Yes | Yes (as message) |
| Supports tools | No | Yes |
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
- Get your API key: API Dashboard
- See all endpoints: API Reference
- Learn about other services: Answer, Web Search
Body
application/json
Text description of the image to generate
Minimum length:
1Aspect ratio of the output image
Available options:
1:1, 16:9, 9:16, 4:3, 3:4, 21:9, 9:21 Output format of the generated image
Available options:
jpeg, png Random seed for reproducibility. Using the same seed with the same prompt will generate similar images
Whether to enhance the prompt for more creative generation
Content moderation level (0-6, where 0 is most strict)
Required range:
0 <= x <= 6Response
Image generated successfully