HiDream-I1 (Fast)

HiDream-I1 is a next-generation, open-source image generative foundation model designed for text-to-image synthesis, especially for rendering text.

~9.75s
~$0.015
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/hidream-l1-fast"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "seed": -1,
12    "prompt": "a cute panda holding a sign that says \"Keep Calm and Keep Building\"",
13    "model_type": "fast",
14    "resolution": "1024 Γ— 1024 (Square)",
15    "speed_mode": "Lightly Juiced 🍊 (more consistent)",
16    "output_format": "webp",
17    "output_quality": 100
18}
19
20response = requests.post(url, headers=headers, json=data)
21
22if response.status_code == 200:
23    result = response.json()
24    print(json.dumps(result, indent=2))
25else:
26    print(f"Error: {response.status_code}")
27    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/hidream-l1-fast

Parameters

promptrequired
string

Prompt

Default: "a cute panda holding a sign that says \"Keep Calm and Keep Building\""
model_typeoptional
string

An enumeration.

Default: "fast"
Allowed values :
"fast"
output_formatoptional
string

Output format.

Default: "webp"
Allowed values :
"png""jpg""webp"
output_qualityoptional
integer

Output image quality (for jpg and webp)

Default: 100Range: 1 - 100
resolutionoptional
string

Image resolution

Default: "1024 Γ— 1024 (Square)"
Allowed values :
"1024 Γ— 1024 (Square)""768 Γ— 1360 (Portrait)""1360 Γ— 768 (Landscape)""880 Γ— 1168 (Portrait)""1168 Γ— 880 (Landscape)""1248 Γ— 832 (Landscape)""832 Γ— 1248 (Portrait)"
seedoptional
integer

Seed (-1 for random)

Default: -1
speed_modeoptional
string

Quality vs Speed

Default: "Lightly Juiced 🍊 (more consistent)"
Allowed values :
"Unsqueezed πŸ‹ (highest quality)""Lightly Juiced 🍊 (more consistent)""Juiced πŸ”₯ (more speed)""Extra Juiced πŸš€ (even more speed)"

Response Type

Returns: Image

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out