# Wan 2.7 Image Generation > Generate stunning 2K images, edit with precision, and render multilingual text using Alibaba's Wan 2.7 AI model via API. ## Overview - **Endpoint**: `https://api.segmind.com/v1/wan2.7-image` - **Model ID**: `wan2.7-image` - **Category**: Text-to-Image Generation - **Type**: Synchronous (Direct response) - **Average Latency**: ~21.6s (30-day average) - **Average Cost**: $0.0429 per run (observed across past runs, not a price — see Pricing) - **Provider**: DASHSCOPE ## Pricing - **Cost**: $0.043 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 image: subject, setting, style, and mood. - Default: `"A cinematic aerial view of a dense green forest at golden hour, rays of sunlight piercing through the canopy, misty valleys below, photorealistic, 8K"` - **`image`** (`File (URL)`, _optional_): Image Reference or source image for editing or style transfer. - **`negative_prompt`** (`string`, _optional_): Negative Prompt Elements to exclude. Removes artifacts and unwanted styles. - Default: `"blurry, low quality, distorted, watermark"` - **`size`** (`string`, _optional_): Size Output resolution. 1K for drafts, 2K for production quality. - Default: `"2K"` - Options: "1K" (1K), "2K" (2K) - **`seed`** (`integer`, _optional_): Seed Fixed seed for reproducible results. Leave empty for unique. - Default: `0` - Range: 0 to 2147483647 - **`watermark`** (`boolean`, _optional_): Watermark Add AI watermark to output. Disable for production assets. - Default: `false` **Required Parameters Example**: ```json { "prompt": "A cinematic aerial view of a dense green forest at golden hour, rays of sunlight piercing through the canopy, misty valleys below, photorealistic, 8K" } ``` **Full Example**: ```json { "prompt": "A cinematic aerial view of a dense green forest at golden hour, rays of sunlight piercing through the canopy, misty valleys below, photorealistic, 8K", "image": "https://example.com/image.jpg", "negative_prompt": "blurry, low quality, distorted, watermark", "size": "2K", "seed": 0, "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 ## About ### Wan 2.7 Image Generation — Text-to-Image & Editing AI #### What is Wan 2.7? Wan 2.7 is Alibaba's latest image generation and editing model, released in April 2026. Built on a Flow Matching architecture, it supports text-to-image generation, instruction-based image editing, and multi-reference composition — all through a single unified API. Wan 2.7 is designed for professional workflows where prompt fidelity, text rendering accuracy, and compositional control matter most. Unlike previous generations, Wan 2.7 incorporates a reasoning step before generation: the model analyzes composition logic, spatial relationships, and semantic intent to produce outputs that closely match complex, multi-element prompts. This makes it especially effective for e-commerce campaigns, marketing visuals, storyboards, and any application requiring precise adherence to detailed descriptions. #### Key Features - **2K resolution output** (up to 4K with Wan 2.7 Pro) - **Instruction-based image editing** — add, move, or transform elements while preserving subject identity - **Advanced text rendering** — accurately renders readable text in 12 languages within images - **Multi-reference support** — use up to 9 reference images to guide composition - **Color palette control** — specify exact color tones for brand-consistent output - **Flow Matching architecture** — faster convergence and cleaner visuals compared to traditional diffusion #### Best Use Cases Wan 2.7 excels in production-grade creative and marketing workflows: generating product visuals with precise color specifications, creating storyboards and architectural concept art, producing e-commerce variants from reference images, rendering typographic designs and text overlays, and batch-generating consistent visual assets for campaigns. #### Prompt Tips and Output Quality Write detailed prompts that specify subject, setting, lighting, and composition. For complex multi-element scenes, describe spatial relationships explicitly — for example, "a red chair in the foreground left of center, with a blurred office background." For image editing tasks, reference the source elements to preserve and clearly describe what should change. Use `negative_prompt` to exclude unwanted artifacts or visual styles. Set `size` to `1K` for fast iteration and previews, and `2K` for final production output. ## Usage Guide ### How to Use Wan 2.7 Image Generation Wan 2.7 is a versatile image model from Alibaba built for both text-to-image generation and instruction-based editing. Here is how to get the most out of it across different workflows. #### Text-to-Image Generation For best results, write detailed prompts describing subject, setting, lighting, and atmosphere. Wan 2.7 analyzes your prompt before generating, so complex multi-element descriptions produce significantly better results than terse inputs. **Recommended for**: Marketing visuals, storyboards, concept art, batch asset generation. ```json { "prompt": "A modern cafe interior, warm ambient light, wooden tables, potted plants on windowsills, shallow depth of field, photorealistic", "size": "2K" } ``` #### Image Editing Supply a reference image via the `image` parameter and describe the modification in `prompt`. The model preserves structure and identity while applying the requested changes. **Recommended for**: E-commerce product variants, background swaps, element additions, color changes. ```json { "prompt": "Change the jacket color to navy blue, keep everything else the same", "image": "https://your-image-url.com/photo.jpg", "size": "2K" } ``` #### Text in Images For images that must contain legible text — signs, labels, posters — include the exact text in your prompt. Wan 2.7 supports 12 languages and produces print-quality results. ```json { "prompt": "A minimalist poster with the text Spring Collection 2026 in bold serif font, white background, navy text" } ``` #### Parameter Guide | Parameter | Recommended Setting | Purpose | |---|---|---| | `size` | `2K` for finals, `1K` for drafts | Balance speed and resolution | | `seed` | Fixed integer | Reproducible iterations | | `negative_prompt` | `blurry, low quality, distorted text` | Cleaner, more consistent outputs | | `watermark` | `false` | Production-ready assets without overlay | #### Tips - Be explicit about spatial relationships in multi-element scenes (foreground, background, left, right). - Use `negative_prompt` to suppress recurring artifacts or unwanted styles. - For brand campaigns, describe specific color tones in the prompt when color accuracy matters. - Start with `1K` to iterate quickly, then switch to `2K` for the final render. ## FAQ ### Does Wan 2.7 support image editing? Yes. Pass a reference image via the `image` parameter with an editing instruction in `prompt` to modify specific elements while preserving the rest of the composition. ### Can it render text accurately inside generated images? Wan 2.7 supports multilingual text rendering across 12 languages, making it one of the strongest models for images containing signs, labels, or typography. ### What resolution does Wan 2.7 support? The standard version outputs up to 2K (~2048px). The Pro variant supports 4K resolution. ### How does Wan 2.7 compare to Midjourney or FLUX? Wan 2.7 outperforms both on prompt adherence and text rendering for complex, multi-element scenes. Midjourney has an edge for purely artistic aesthetics; FLUX is faster for simple single-subject prompts. ### Can I use multiple reference images? Yes. Wan 2.7 supports up to 9 reference images for guided multi-reference composition. ### How do I get reproducible results? Set the `seed` parameter to a fixed integer. Reusing the same seed with the same prompt will produce the same output. ## Usage Examples ### cURL ```bash curl -X POST "https://api.segmind.com/v1/wan2.7-image" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A cinematic aerial view of a dense green forest at golden hour, rays of sunlight piercing through the canopy, misty valleys below, photorealistic, 8K", "image": "https://example.com/image.jpg", "negative_prompt": "blurry, low quality, distorted, watermark", "size": "2K", "seed": 0, "watermark": false }' ``` ### Python ```python import requests import json api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/wan2.7-image" data = { "prompt": "A cinematic aerial view of a dense green forest at golden hour, rays of sunlight piercing through the canopy, misty valleys below, photorealistic, 8K", "image": "https://example.com/image.jpg", "negative_prompt": "blurry, low quality, distorted, watermark", "size": "2K", "seed": 0, "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/wan2.7-image'; const data = { "prompt": "A cinematic aerial view of a dense green forest at golden hour, rays of sunlight piercing through the canopy, misty valleys below, photorealistic, 8K", "image": "https://example.com/image.jpg", "negative_prompt": "blurry, low quality, distorted, watermark", "size": "2K", "seed": 0, "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/wan2.7-image) - [API Documentation](https://www.segmind.com/models/wan2.7-image/api) - [Pricing Details](https://www.segmind.com/models/wan2.7-image/pricing) - [Platform Documentation](https://docs.segmind.com/)