MeduxMedux

Image > Text to Image

Text to Image

Generate an image from a text prompt.

POST/api/app/v1/generate/image/text_to_image

Examples

curl -X POST https://api.medux.io/api/app/v1/generate/image/text_to_image \
  -H 'Authorization: Bearer $MEDUX_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"cfg_normalization":false,"cfg_truncation":1,"guidance_scale":0,"height":1024,"max_sequence_length":512,"model_id":"text-to-image-default","num_inference_steps":9,"prompt":"An isometric 3D render of a media pipeline: video, image and audio tiles flowing through a single glowing violet hub on a dark studio background, soft volumetric light, crisp product-shot detail","seed":-1,"width":1024}'

Auth Requirements

Authentication is required via Authorization header.

Preconditions

Requires a valid Authorization header and the configured request body.

Successful requests return a Medux task record immediately. Use the task query or sync endpoints to track completion.

Request

Body

application/json
Authorizationstringrequired

Bearer token or API key.

Location: HEADER

promptstringrequired

Prompt text used to generate the image. Default: An isometric 3D render of a media pipeline: video, image and audio tiles flowing through a single glowing violet hub on a dark studio background, soft volumetric light, crisp product-shot detail.

Location: BODY

negative_promptstringoptional

Optional negative prompt.

Location: BODY

heightintegeroptional

Output image height. Default: 1024.

Location: BODY

widthintegeroptional

Output image width. Default: 1024.

Location: BODY

seedintegeroptional

Random seed. Use -1 to auto-generate. Default: -1.

Location: BODY

num_inference_stepsintegeroptional

Number of inference steps. Default: 9.

Location: BODY

guidance_scalenumberoptional

Guidance scale. Default: 0.0.

Location: BODY

cfg_normalizationbooleanoptional

Whether to enable CFG normalization. Default: false.

Location: BODY

cfg_truncationnumberoptional

CFG truncation value. Default: 1.0.

Location: BODY

max_sequence_lengthintegeroptional

Maximum text sequence length. Default: 512.

Location: BODY

model_idstringoptional

Text-to-image model id. Default: text-to-image-default.

Location: BODY

titlestringoptional

Optional task title.

Location: BODY

Response

Response

application/json
codeint32optional

response code enums:
.. 0: ok
.. 12: invalid input
.. 1410: invalid model
.. 1409: paid plan required
.. 1401: insufficient credits
.... 1401 ~ 1499 是 media
.. 1404: provider error
.. 1405: provider timeout
.. 13: unauthenticated
.. 16: rate limit
.. 99: server error

Available options: 0 12 1410 1409 1401 1404 1405 13 16 99

Location: RESPONSE

data.assetobjectoptional

No description provided.

Location: RESPONSE

data.paid_plan_requiredobjectoptional

No description provided.

Location: RESPONSE

data.taskobjectoptional

No description provided.

Location: RESPONSE

messagestringoptional

No description provided.

Available options: ok invalid input invalid model paid plan required insufficient credits provider error provider timeout unauthenticated rate limit server error

Location: RESPONSE

MCP Tool

This endpoint is also available through the Medux-hosted remote MCP service.

Text to Image

Generate an image from a text prompt.

Invocation Example

Generate an image from a text prompt.