# Qwen Image 3.0 > Generate and edit legible text-in-image posters, infographics, and UI mockups in 12 languages at up to 2K. ## Overview - **Endpoint**: `https://api.segmind.com/v1/qwen-image-3` - **Model ID**: `qwen-image-3` - **Category**: Text-to-Image Generation - **Type**: Synchronous (Direct response) - **Average Cost**: $0.04900000000000001 ## Pricing - **Cost**: $0.049 per generation ## API Information This model uses a **synchronous response pattern**: 1. Make a POST request with your parameters 2. Receive the output directly in the response (binary for images/videos/audio, JSON for text) 3. No polling required - response is immediate ### Input Schema The API accepts the following input parameters: - **`prompt`** (`string`, _required_): Prompt Describe the image to generate, or the edit to apply to the reference image(s). - **`image`** (`File (URL)`, _optional_): Reference Image Optional. Supply an image to edit it instead of generating from scratch. - **`image2`** (`File (URL)`, _optional_): Reference Image 2 Optional second reference image. - **`image3`** (`File (URL)`, _optional_): Reference Image 3 Optional third reference image. Up to 3 references are supported. - **`size`** (`string`, _optional_): Size Output resolution. Editing supports up to 1440 x 1440; 2048 x 2048 is text-to-image only. - Default: `"1024*1024"` - Options: "1024*1024" (1024 x 1024 (square)), "1328*1328" (1328 x 1328 (square, large)), "768*1024" (768 x 1024 (portrait 3:4)), "1024*768" (1024 x 768 (landscape 4:3)), "1080*1440" (1080 x 1440 (portrait 3:4, large)), "1440*1080" (1440 x 1080 (landscape 4:3, large)), "2048*2048" (2048 x 2048 (text-to-image only)) - **`negative_prompt`** (`string`, _optional_): Negative Prompt Elements to exclude from the image. - **`prompt_extend`** (`boolean`, _optional_): Prompt Extend Let the model automatically rewrite and enrich short prompts. - Default: `true` - **`prompt_extend_mode`** (`string`, _optional_): Prompt Extend Mode How the prompt is rewritten when Prompt Extend is on. - Default: `"direct"` - Options: "direct" (Direct - light touch-up), "agent" (Agent - fuller rewrite) - **`seed`** (`integer`, _optional_): Seed Seed for reproducible results. - Range: 0 to 2147483647 - **`watermark`** (`boolean`, _optional_): Watermark Add the Qwen watermark to the output. - Default: `false` **Required Parameters Example**: ```json { "prompt": "A cozy independent bookstore cafe on a rainy autumn evening, warm golden light glowing through the large front windows onto a wet cobblestone street, a hand-painted wooden sign above the entrance that reads \"Qwen Books & Coffee\", reflections shimmering in the puddles, a person under a red umbrella walking past, cinematic photorealistic detail, shallow depth of field, 35mm" } ``` **Full Example**: ```json { "prompt": "A cozy independent bookstore cafe on a rainy autumn evening, warm golden light glowing through the large front windows onto a wet cobblestone street, a hand-painted wooden sign above the entrance that reads \"Qwen Books & Coffee\", reflections shimmering in the puddles, a person under a red umbrella walking past, cinematic photorealistic detail, shallow depth of field, 35mm", "size": "1328*1328", "negative_prompt": "blurry, watermark, low quality, distorted text, deformed, extra limbs, jpeg artifacts", "prompt_extend": true, "prompt_extend_mode": "direct", "seed": 12345, "watermark": false } ``` ### Output Schema The API returns a synchronous response based on the model type: **For Image/Video/Audio Models**: - Response contains binary data (image/png, video/mp4, audio/mp3) - Content-Type header indicates the media type - Save the response body directly to a file **For Text Models**: - Response is JSON with the generated text - Structure varies by model **HTTP Response Codes**: - **200 - OK**: Request successful, output in response body - **400 - Bad Request**: Invalid parameters - **401 - Unauthorized**: Invalid or missing API key - **404 - Not Found**: Model not found - **406 - Not Acceptable**: Insufficient credits - **429 - Too Many Requests**: Rate limit exceeded - **500 - Server Error**: Internal server error ## Usage Examples ### cURL ```bash curl -X POST "https://api.segmind.com/v1/qwen-image-3" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A cozy independent bookstore cafe on a rainy autumn evening, warm golden light glowing through the large front windows onto a wet cobblestone street, a hand-painted wooden sign above the entrance that reads \"Qwen Books & Coffee\", reflections shimmering in the puddles, a person under a red umbrella walking past, cinematic photorealistic detail, shallow depth of field, 35mm", "size": "1328*1328", "negative_prompt": "blurry, watermark, low quality, distorted text, deformed, extra limbs, jpeg artifacts", "prompt_extend": true, "prompt_extend_mode": "direct", "seed": 12345, "watermark": false }' ``` ### Python ```python import requests import json api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/qwen-image-3" data = { "prompt": "A cozy independent bookstore cafe on a rainy autumn evening, warm golden light glowing through the large front windows onto a wet cobblestone street, a hand-painted wooden sign above the entrance that reads \"Qwen Books & Coffee\", reflections shimmering in the puddles, a person under a red umbrella walking past, cinematic photorealistic detail, shallow depth of field, 35mm", "size": "1328*1328", "negative_prompt": "blurry, watermark, low quality, distorted text, deformed, extra limbs, jpeg artifacts", "prompt_extend": true, "prompt_extend_mode": "direct", "seed": 12345, "watermark": false } response = requests.post( url, json=data, headers={ 'x-api-key': api_key, 'Content-Type': 'application/json' } ) if response.status_code == 200: # For image/video/audio models, response.content contains the binary data with open('output.png', 'wb') as f: f.write(response.content) print('Generation complete, saved to output.png') else: print(f"Error: {response.status_code}") print(response.text) ``` ### JavaScript ```javascript const apiKey = 'YOUR_API_KEY'; const url = 'https://api.segmind.com/v1/qwen-image-3'; const data = { "prompt": "A cozy independent bookstore cafe on a rainy autumn evening, warm golden light glowing through the large front windows onto a wet cobblestone street, a hand-painted wooden sign above the entrance that reads \"Qwen Books & Coffee\", reflections shimmering in the puddles, a person under a red umbrella walking past, cinematic photorealistic detail, shallow depth of field, 35mm", "size": "1328*1328", "negative_prompt": "blurry, watermark, low quality, distorted text, deformed, extra limbs, jpeg artifacts", "prompt_extend": true, "prompt_extend_mode": "direct", "seed": 12345, "watermark": false }; const response = await fetch(url, { method: 'POST', headers: { 'x-api-key': apiKey, 'Content-Type': 'application/json', }, body: JSON.stringify(data), }); if (response.ok) { // For image/video/audio models, response contains binary data const blob = await response.blob(); const downloadUrl = URL.createObjectURL(blob); // Create download link const a = document.createElement('a'); a.href = downloadUrl; a.download = 'output.png'; a.click(); console.log('Generation complete'); } ``` ## Additional Resources ### Documentation - [Model Playground](https://www.segmind.com/models/qwen-image-3) - [API Documentation](https://www.segmind.com/models/qwen-image-3/api) - [Pricing Details](https://www.segmind.com/models/qwen-image-3/pricing) - [Platform Documentation](https://docs.segmind.com/) ### Tags No tags available