Ideogram Character Serverless API
Achieve perfect character consistency across multiple generations from a single reference image.
POST /v2/ideogram-character · submit + poll 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3import segmind
4
5# Async (v2): submit to the queue and block until COMPLETED.
6# run() returns the final result dict (600s deadline, 1.0s poll by default).
7result = segmind.run(
8 "ideogram-character",
9 prompt="a close up photo of a woman in a fashion magazine photoshoot",
10 resolution="512x1536",
11 style_type="Realistic",
12 aspect_ratio="16:9",
13 rendering_speed="Quality",
14 magic_prompt_option="Off",
15 character_reference_image="https://segmind-resources.s3.amazonaws.com/output/9ad9b775-7b35-4485-affe-6215a933d825-686185927069985948.png",
16)
17print(result["status"]) # COMPLETED
18print(result.get("output")) # model output (e.g. media URL)
19print(result["metrics"]["inference_time"]) # server compute seconds
20
21# --- Or submit + poll manually (track request_id, control the cadence) ---
22from segmind import SegmindClient, InferenceFailed, InferenceTimeout
23
24client = SegmindClient() # reads SEGMIND_API_KEY
25payload = {
26 "prompt": "a close up photo of a woman in a fashion magazine photoshoot",
27 "resolution": "512x1536",
28 "style_type": "Realistic",
29 "aspect_ratio": "16:9",
30 "rendering_speed": "Quality",
31 "magic_prompt_option": "Off",
32 "character_reference_image": "https://segmind-resources.s3.amazonaws.com/output/9ad9b775-7b35-4485-affe-6215a933d825-686185927069985948.png",
33}
34job = client.submit_async("ideogram-character", **payload)
35print(job.request_id) # available immediately
36try:
37 result = job.wait(timeout=600, interval=1.0)
38except InferenceTimeout as e:
39 print("still running:", e.request_id)
40except InferenceFailed as e:
41 print("failed:", e.detail) 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3import segmind
4
5# Async (v2): submit to the queue and block until COMPLETED.
6# run() returns the final result dict (600s deadline, 1.0s poll by default).
7result = segmind.run(
8 "ideogram-character",
9 prompt="a close up photo of a woman in a fashion magazine photoshoot",
10 resolution="512x1536",
11 style_type="Realistic",
12 aspect_ratio="16:9",
13 rendering_speed="Quality",
14 magic_prompt_option="Off",
15 character_reference_image="https://segmind-resources.s3.amazonaws.com/output/9ad9b775-7b35-4485-affe-6215a933d825-686185927069985948.png",
16)
17print(result["status"]) # COMPLETED
18print(result.get("output")) # model output (e.g. media URL)
19print(result["metrics"]["inference_time"]) # server compute seconds
20
21# --- Or submit + poll manually (track request_id, control the cadence) ---
22from segmind import SegmindClient, InferenceFailed, InferenceTimeout
23
24client = SegmindClient() # reads SEGMIND_API_KEY
25payload = {
26 "prompt": "a close up photo of a woman in a fashion magazine photoshoot",
27 "resolution": "512x1536",
28 "style_type": "Realistic",
29 "aspect_ratio": "16:9",
30 "rendering_speed": "Quality",
31 "magic_prompt_option": "Off",
32 "character_reference_image": "https://segmind-resources.s3.amazonaws.com/output/9ad9b775-7b35-4485-affe-6215a933d825-686185927069985948.png",
33}
34job = client.submit_async("ideogram-character", **payload)
35print(job.request_id) # available immediately
36try:
37 result = job.wait(timeout=600, interval=1.0)
38except InferenceTimeout as e:
39 print("still running:", e.request_id)
40except InferenceFailed as e:
41 print("failed:", e.detail)API Endpoint
https://api.segmind.com/v1/ideogram-characterParameters
character_reference_imagerequiredstring (uri)Provide an image as a character reference. Use a clear headshot for accurate modeling.
"https://segmind-resources.s3.amazonaws.com/output/9ad9b775-7b35-4485-affe-6215a933d825-686185927069985948.png"promptrequiredstringDescribe the image you want to create. Use creative prompts for unique images.
"a close up photo of a woman in a fashion magazine photoshoot"aspect_ratiooptionalstringDefine the aspect ratio for your image. Choose a ratio like '16:9' for wide-screen images.
"16:9""1:3""3:1""1:2""2:1""9:16""16:9""10:16""16:10""2:3""3:2"+5 moreimageoptionalstring (uri)Provide an image for inpainting using the given mask. Start with a clear, high-resolution image for best results.
nullmagic_prompt_optionoptionalstringToggle magic prompt modes to automate text prompts. Use 'On' for automatic prompt enhancements.
"Off""Auto""On""Off"maskoptionalstring (uri)Use a mask to preserve parts of the image while inpainting. Choose a detailed mask for precise edits.
nullrendering_speedoptionalstringChoose rendering speed for processing time. Use 'Turbo' for fast results or 'Quality' for best results.
"Quality""Default""Turbo""Quality"resolutionoptionalstringChoose resolution for the image output. For detailed images, pick a higher resolution.
"512x1536""None""512x1536""576x1408""576x1472""576x1536""640x1344""640x1408""640x1472""640x1536""704x1152"+60 moreseedoptionalintegerSet a seed for reproducible results. Use a fixed seed for consistency across generations.
nullRange: 100 - 999999style_typeoptionalstringSelect the style for the image. Use 'Fiction' for creative artwork or 'Realistic' for lifelike images.
"Realistic""Auto""Fiction""Realistic"Response Type
Returns: Image
Asynchronous requests (v2)
Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.
- 1
POST /v2/ideogram-characterSubmit — returns request_id, status_url, response_url
- 2
GET /v2/requests/{id}/statusPoll — until COMPLETED or FAILED
- 3
GET /v2/requests/{id}Result — final response body
Status states
- A FAILED request is served as HTTP 422 — the body still carries the error detail.
- An unknown or expired request_id returns HTTP 404.
- Results are retained for 1 hour, then expire.
- Content / RAI blocks surface as FAILED, not a separate state.
- Track completion by polling the status endpoint.
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out