# Qwen Image Max (qwen-image-max) Vendor: Alibaba Model ID: `qwen-image-max` Base URL: `https://api.mulerouter.ai` Type: Inference API (async task-based) ## Description text-to-image model with enhanced realism and text rendering ## Variant: Create Generation Task Endpoint: `POST /vendors/alibaba/v1/qwen-image-max/generation` ### Input Schema The API accepts the following input parameters: - **`seed`** (`integer`, _optional_): Random seed for reproducibility [0, 2147483647]. Using the same seed produces more consistent results. Note: Results are not guaranteed to be identical for every call even with the same seed. - Range: `0` to `2147483647` - **`size`** (`string`, _optional_): Image resolution in format "width\*height". Default: 1664\*928 Available resolutions and aspect ratios: - 1664\*928 (default): 16:9 - 1472\*1104: 4:3 - 1328\*1328: 1:1 - 1104\*1472: 3:4 - 928\*1664: 9:16 - Options: `"1664*928"`, `"1472*1104"`, `"1328*1328"`, `"1104*1472"`, `"928*1664"` - Default: `"1664*928"` - **`prompt`** (`string`, _required_): Text description for the image (max 800 characters). Describes the desired content, style, and composition of the generated image. Supports both Chinese and English. - Max length: 800 - **`prompt_extend`** (`boolean`, _optional_): Enable intelligent prompt rewriting. When enabled, the model optimizes and refines the positive prompt. Keep enabled if your input prompt is simple or if you want the model to be more creative. Set to false if your prompt is already detailed and professional. - Default: `true` - **`safety_filter`** (`boolean | null`, _optional_): Enable content safety filter. Defaults to true. Set to false to disable content safety inspection. - Default: `true` - **`negative_prompt`** (`string | null`, _optional_): Negative prompt describing unwanted content (max 500 characters). Used to constrain the image generation. Example: low resolution, low quality, deformed limbs, deformed fingers, oversaturated, waxy, no facial details, overly smooth, AI-like, chaotic composition, blurry text, distorted text. - Max length: 500 **Required Parameters Example**: ```json { "prompt": "" } ``` **Full Example**: ```json { "seed": 0, "size": "1664*928", "prompt": "", "prompt_extend": true, "safety_filter": true, "negative_prompt": null } ``` ## Variant: /vendors/alibaba/v1/qwen-image-max/generation/{task_id} Endpoint: `POST /vendors/alibaba/v1/qwen-image-max/generation/{task_id}` ## Usage (Async Task API) This model uses an async task-based workflow with two API calls: 1. **Submit a task** — `POST /v1/inference/qwen-image-max` to create a generation task 2. **Poll for result** — `GET /v1/inference/qwen-image-max/{task_id}` to check status and retrieve the result ### Step 1: Submit a Task #### cURL ```bash curl -X POST https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-max/generation \ -H "Content-Type: application/json" \ -H "Authorization: Bearer " \ -d '{ "prompt": "Your prompt here" }' ``` #### Python ```python import requests API_KEY = "" ENDPOINT = "https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-max/generation" response = requests.post( ENDPOINT, headers={ "Content-Type": "application/json", "Authorization": f"Bearer {API_KEY}" }, json={ "prompt": "Your prompt here" } ) result = response.json() task_id = result["task_info"]["id"] print(f"Task created: {task_id}") ``` #### Node.js / TypeScript ```typescript const API_KEY = ""; const ENDPOINT = "https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-max/generation"; const response = await fetch(ENDPOINT, { method: "POST", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${API_KEY}` }, body: JSON.stringify({ prompt: "Your prompt here" }) }); const result = await response.json(); const taskId = result.task_info.id; console.log("Task created:", taskId); ``` #### Submit Response (202) ```json { "task_info": { "id": "8e1e315e-b50d-4334-a231-be7d19a372f4", "status": "processing", "created_at": "2026-01-01T00:00:00.000Z" } } ``` ### Step 2: Poll for Result Use the task ID from Step 1 to poll the status endpoint until the task is completed. Endpoint: `GET /v1/inference/qwen-image-max/{task_id}` #### cURL ```bash curl -X GET https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-max/generation/ \ -H "Authorization: Bearer " ``` #### Python ```python import time status_url = f"https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-max/generation/{task_id}" while True: status = requests.get(status_url, headers={ "Authorization": f"Bearer {API_KEY}" }).json() task_status = status["task_info"]["status"] if task_status in ("completed", "succeeded"): print("Result:", status) break elif task_status == "failed": print("Task failed:", status) break time.sleep(5) ``` #### Node.js / TypeScript ```typescript const statusUrl = `https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-max/generation/${taskId}`; while (true) { const statusRes = await fetch(statusUrl, { headers: { "Authorization": `Bearer ${API_KEY}` } }); const status = await statusRes.json(); const taskStatus = status.task_info.status; if (taskStatus === "completed" || taskStatus === "succeeded") { console.log("Result:", status); break; } else if (taskStatus === "failed") { console.log("Task failed:", status); break; } await new Promise(r => setTimeout(r, 5000)); } ``` ## Additional Resources ### Documentation - [Model Playground](https://www.mulerouter.ai/models/qwen-image-max) - [API Documentation](https://mulerouter.ai/docs/api-reference/endpoint/alibaba/qwen-image-max/generation) ### MuleRouter Platform - [Platform Documentation](https://www.mulerouter.ai/docs) - [API Keys Management](https://www.mulerouter.ai/app/api-keys)