Infinite You Serverless API
InfiniteYou generates high-fidelity portraits preserving identity while aligning with creative text prompts.
POST /v2/infinite-you · 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 "infinite-you",
9 seed=6255,
10 width=864,
11 height=1152,
12 prompt="A sophisticated gentleman exuding confidence. He is dressed in a 1990s brown plaid jacket with a high collar, paired with a dark grey turtleneck. His trousers are tailored and charcoal in color, complemented by a sleek leather belt. The background showcases an elegant library with bookshelves, a marble fireplace, and warm lighting, creating a refined and cozy atmosphere. His relaxed posture and casual hand-in-pocket stance add to his composed and stylish demeanor",
13 id_image="https://segmind-resources.s3.amazonaws.com/output/e533504e-4e22-4219-88a1-152e002e1a99-man2.png",
14 num_steps=30,
15 model_version="aes_stage2",
16 output_format="webp",
17 enable_realism=True,
18 guidance_scale=3.5,
19 output_quality=80,
20 enable_anti_blur=False,
21 infusenet_guidance_end=1,
22 infusenet_guidance_start=0,
23 infusenet_conditioning_scale=1,
24)
25print(result["status"]) # COMPLETED
26print(result.get("output")) # model output (e.g. media URL)
27print(result["metrics"]["inference_time"]) # server compute seconds
28
29# --- Or submit + poll manually (track request_id, control the cadence) ---
30from segmind import SegmindClient, InferenceFailed, InferenceTimeout
31
32client = SegmindClient() # reads SEGMIND_API_KEY
33payload = {
34 "seed": 6255,
35 "width": 864,
36 "height": 1152,
37 "prompt": "A sophisticated gentleman exuding confidence. He is dressed in a 1990s brown plaid jacket with a high collar, paired with a dark grey turtleneck. His trousers are tailored and charcoal in color, complemented by a sleek leather belt. The background showcases an elegant library with bookshelves, a marble fireplace, and warm lighting, creating a refined and cozy atmosphere. His relaxed posture and casual hand-in-pocket stance add to his composed and stylish demeanor",
38 "id_image": "https://segmind-resources.s3.amazonaws.com/output/e533504e-4e22-4219-88a1-152e002e1a99-man2.png",
39 "num_steps": 30,
40 "model_version": "aes_stage2",
41 "output_format": "webp",
42 "enable_realism": True,
43 "guidance_scale": 3.5,
44 "output_quality": 80,
45 "enable_anti_blur": False,
46 "infusenet_guidance_end": 1,
47 "infusenet_guidance_start": 0,
48 "infusenet_conditioning_scale": 1,
49}
50job = client.submit_async("infinite-you", **payload)
51print(job.request_id) # available immediately
52try:
53 result = job.wait(timeout=600, interval=1.0)
54except InferenceTimeout as e:
55 print("still running:", e.request_id)
56except InferenceFailed as e:
57 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 "infinite-you",
9 seed=6255,
10 width=864,
11 height=1152,
12 prompt="A sophisticated gentleman exuding confidence. He is dressed in a 1990s brown plaid jacket with a high collar, paired with a dark grey turtleneck. His trousers are tailored and charcoal in color, complemented by a sleek leather belt. The background showcases an elegant library with bookshelves, a marble fireplace, and warm lighting, creating a refined and cozy atmosphere. His relaxed posture and casual hand-in-pocket stance add to his composed and stylish demeanor",
13 id_image="https://segmind-resources.s3.amazonaws.com/output/e533504e-4e22-4219-88a1-152e002e1a99-man2.png",
14 num_steps=30,
15 model_version="aes_stage2",
16 output_format="webp",
17 enable_realism=True,
18 guidance_scale=3.5,
19 output_quality=80,
20 enable_anti_blur=False,
21 infusenet_guidance_end=1,
22 infusenet_guidance_start=0,
23 infusenet_conditioning_scale=1,
24)
25print(result["status"]) # COMPLETED
26print(result.get("output")) # model output (e.g. media URL)
27print(result["metrics"]["inference_time"]) # server compute seconds
28
29# --- Or submit + poll manually (track request_id, control the cadence) ---
30from segmind import SegmindClient, InferenceFailed, InferenceTimeout
31
32client = SegmindClient() # reads SEGMIND_API_KEY
33payload = {
34 "seed": 6255,
35 "width": 864,
36 "height": 1152,
37 "prompt": "A sophisticated gentleman exuding confidence. He is dressed in a 1990s brown plaid jacket with a high collar, paired with a dark grey turtleneck. His trousers are tailored and charcoal in color, complemented by a sleek leather belt. The background showcases an elegant library with bookshelves, a marble fireplace, and warm lighting, creating a refined and cozy atmosphere. His relaxed posture and casual hand-in-pocket stance add to his composed and stylish demeanor",
38 "id_image": "https://segmind-resources.s3.amazonaws.com/output/e533504e-4e22-4219-88a1-152e002e1a99-man2.png",
39 "num_steps": 30,
40 "model_version": "aes_stage2",
41 "output_format": "webp",
42 "enable_realism": True,
43 "guidance_scale": 3.5,
44 "output_quality": 80,
45 "enable_anti_blur": False,
46 "infusenet_guidance_end": 1,
47 "infusenet_guidance_start": 0,
48 "infusenet_conditioning_scale": 1,
49}
50job = client.submit_async("infinite-you", **payload)
51print(job.request_id) # available immediately
52try:
53 result = job.wait(timeout=600, interval=1.0)
54except InferenceTimeout as e:
55 print("still running:", e.request_id)
56except InferenceFailed as e:
57 print("failed:", e.detail)API Endpoint
https://api.segmind.com/v1/infinite-youParameters
id_imagerequiredstring (uri)Upload a portrait image for processing. Ensure it contains a clear human face.
control_imageoptionalstring (uri)Optional: Use a secondary image for compositional control. Ideal for consistent layout.
nullenable_anti_bluroptionalbooleanActivate to reduce blur. Ideal for sharp, defined structures.
falseenable_realismoptionalbooleanToggle realism enhancement feature. Enable for lifelike representation.
trueguidance_scaleoptionalnumberAdjustment on prompt adherence. Set higher for precise, lower for creative outputs.
3.5Range: 0 - 10heightoptionalintegerOutput image height in pixels. Use 960 for standard or 1280 for a more detailed view.
1152Range: 256 - 1280infusenet_conditioning_scaleoptionalnumberControls identity influence. Lower for more creative deviation.
1Range: 0 - 1infusenet_guidance_endoptionalnumberDefines when identity guidance stops. Generally kept at 1.0 for full application.
1Range: 0 - 1infusenet_guidance_startoptionalnumberDefines when to apply identity guidance. Typical range is 0.0-0.1.
0Range: 0 - 1model_versionoptionalstringSelects model type. 'aes_stage2' for enhanced aesthetics or 'sim_stage1' for simplicity.
"aes_stage2""sim_stage1""aes_stage2"num_stepsoptionalintegerControls image refinement steps. Use 30 for good quality, 50 for best details.
30Range: 1 - 100output_formatoptionalstringChoose the image format. 'webp' for compressibility, 'png' for quality.
"webp""png""jpg""webp"output_qualityoptionalintegerDefines the output quality. 80 for general use, 100 for optimal.
80Range: 1 - 100promptoptionalstringInput your vision for the image. Example: 'Vibrant sunset over mountains, surreal, dream-like'.
seedoptionalintegerSets the random seed for reproducibility. Use a specific number for repeatability or null for randomness.
6255widthoptionalintegerOutput image width in pixels. Choose 768 for portrait or 960 for landscape.
864Range: 256 - 1280Response 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/infinite-youSubmit — 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