Infinite You Serverless API

InfiniteYou generates high-fidelity portraits preserving identity while aligning with creative text prompts.

~163.00s
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)

API Endpoint

POSThttps://api.segmind.com/v1/infinite-you

Parameters

id_imagerequired
string (uri)

Upload a portrait image for processing. Ensure it contains a clear human face.

control_imageoptional
string (uri)

Optional: Use a secondary image for compositional control. Ideal for consistent layout.

Default: null
enable_anti_bluroptional
boolean

Activate to reduce blur. Ideal for sharp, defined structures.

Default: false
enable_realismoptional
boolean

Toggle realism enhancement feature. Enable for lifelike representation.

Default: true
guidance_scaleoptional
number

Adjustment on prompt adherence. Set higher for precise, lower for creative outputs.

Default: 3.5Range: 0 - 10
heightoptional
integer

Output image height in pixels. Use 960 for standard or 1280 for a more detailed view.

Default: 1152Range: 256 - 1280
infusenet_conditioning_scaleoptional
number

Controls identity influence. Lower for more creative deviation.

Default: 1Range: 0 - 1
infusenet_guidance_endoptional
number

Defines when identity guidance stops. Generally kept at 1.0 for full application.

Default: 1Range: 0 - 1
infusenet_guidance_startoptional
number

Defines when to apply identity guidance. Typical range is 0.0-0.1.

Default: 0Range: 0 - 1
model_versionoptional
string

Selects model type. 'aes_stage2' for enhanced aesthetics or 'sim_stage1' for simplicity.

Default: "aes_stage2"
Allowed values :
"sim_stage1""aes_stage2"
num_stepsoptional
integer

Controls image refinement steps. Use 30 for good quality, 50 for best details.

Default: 30Range: 1 - 100
output_formatoptional
string

Choose the image format. 'webp' for compressibility, 'png' for quality.

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

Defines the output quality. 80 for general use, 100 for optimal.

Default: 80Range: 1 - 100
promptoptional
string

Input your vision for the image. Example: 'Vibrant sunset over mountains, surreal, dream-like'.

seedoptional
integer

Sets the random seed for reproducibility. Use a specific number for repeatability or null for randomness.

Default: 6255
widthoptional
integer

Output image width in pixels. Choose 768 for portrait or 960 for landscape.

Default: 864Range: 256 - 1280

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. 1
    POST /v2/infinite-you

    Submitreturns request_id, status_url, response_url

  2. 2
    GET /v2/requests/{id}/status

    Polluntil COMPLETED or FAILED

  3. 3
    GET /v2/requests/{id}

    Resultfinal response body

Status states

QUEUEDAccepted, waiting for a worker
PROCESSINGRunning on a worker
COMPLETEDDone — result body is ready
FAILEDErrored (incl. content/RAI blocks)
  • 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.

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