Qwen - Text to Image
Endpoint
POST /images/generations
Full URL: https://modelfold.ai/v1/images/generations
Authentication: every request must include the
Authorization: Bearer <API_KEY>header.
Send model parameters directly in the JSON body. Do not wrap them in input. This request waits for generation to finish and returns data[].url; supported media models also offer async jobs, polling and callbacks. Replace example media URLs with your own publicly accessible files. See API gateway for billing and errors.
Input parameters for the generation task
Request Parameters
Body (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The model name to use for generation. Required field. - Must be qwen/text-to-image for this endpoint Default:"qwen/text-to-image"。 Allowed values:qwen/text-to-image。 Example:qwen/text-to-image。 |
acceleration | string | No | Acceleration level for image generation. Options: 'none', 'regular', 'high'. Higher acceleration increases speed. 'regular' balances speed and quality. 'high' is recommended for images without text Default:"none"。 Allowed values:none / regular / high。 Example:none。 |
enable_safety_checker | boolean | No | The safety checker is always enabled in Playground. It can only be disabled by setting false through the API. (Boolean value (true/false)) Example:true。 |
guidance_scale | number | No | The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you (Min: 0, Max: 20, Step: 0.1) (step: 0.1) Default:2.5。 minimum: 0. maximum: 20. Example:2.5。 |
image_size | string | No | The size of the generated image. Set this field explicitly. Allowed values:square / square_hd / portrait_4_3 / portrait_16_9 / landscape_4_3 / landscape_16_9。 Example:square_hd。 |
negative_prompt | string | No | The negative prompt for the generation (Max length: 500 characters) maxLength: 500. Example:。 |
num_inference_steps | number | No | The number of inference steps to perform (Min: 2, Max: 250, Step: 1) (step: 1) Default:30。 minimum: 2. maximum: 250. Example:30。 |
output_format | string | No | The format of the generated image Default:"png"。 Allowed values:png / jpeg。 Example:png。 |
prompt | string | Yes | Prompt required by the ModelFold gateway; at most 2000 characters. The prompt to generate the image with (Max length: 5000 characters) maxLength: 2000. Example:A rainy nighttime city poster illuminated by neon lights.。 |
seed | integer | No | The same seed and the same prompt given to the same version of the model will output the same image every time |
Request Example
bash
curl -X POST "https://modelfold.ai/v1/images/generations" \
-H "Authorization: Bearer $MODELFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen/text-to-image",
"prompt": "A rainy nighttime city poster illuminated by neon lights.",
"acceleration": "none",
"guidance_scale": 2.5,
"num_inference_steps": 30,
"output_format": "png"
}'json
{
"model": "qwen/text-to-image",
"prompt": "A rainy nighttime city poster illuminated by neon lights.",
"acceleration": "none",
"guidance_scale": 2.5,
"num_inference_steps": 30,
"output_format": "png"
}Response
200 — Generation completed. usage contains actual billing details; result URLs are illustrative.
json
{
"ok": true,
"created": 1792134000,
"data": [
{
"url": "https://modelfold.ai/uploads/outputs/result.png"
}
],
"usage": {}
}