Generate > Create Text to Image
Create Text to Image
Generate an image from a text prompt.
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":"PROMPT","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/jsonAuthorizationstringrequiredBearer token or API key.
Location: HEADER
promptstringrequiredPrompt text used to generate the image.
Location: BODY
negative_promptstringoptionalOptional negative prompt.
Location: BODY
heightintegeroptionalOutput image height. Default: 1024.
Location: BODY
widthintegeroptionalOutput image width. Default: 1024.
Location: BODY
seedintegeroptionalRandom seed. Use -1 to auto-generate. Default: -1.
Location: BODY
num_inference_stepsintegeroptionalNumber of inference steps. Default: 9.
Location: BODY
guidance_scalenumberoptionalGuidance scale. Default: 0.0.
Location: BODY
cfg_normalizationbooleanoptionalWhether to enable CFG normalization. Default: false.
Location: BODY
cfg_truncationnumberoptionalCFG truncation value. Default: 1.0.
Location: BODY
max_sequence_lengthintegeroptionalMaximum text sequence length. Default: 512.
Location: BODY
model_idstringoptionalText-to-image model id. Default: text-to-image-default.
Location: BODY
titlestringoptionalOptional task title.
Location: BODY
Response
Response
application/jsonMCP Tool
This endpoint is also available through the Medux-hosted remote MCP service.
Create Text to Image
Generate an image from a text prompt.
Invocation Example
Generate an image from a text prompt.
On this page