# Qwen 2.1 Realtime Image Editing > AI model for generating image content ## Overview - **Model ID**: `qwen-image-2.1` - **Category**: image - **Provider**: modelslab - **Source Type**: Closed Source Model - **Status**: model_ready - **Screenshot**: `https://assets.modelslab.ai/generations/ab65b3ba-0b1e-461f-b0fc-6c6ffc487b1c.png` ## API Information This model can be used via our HTTP API. See the API documentation and usage examples below. ### Endpoint - **URL**: `https://modelslab.com/api/v6/images/img2img` - **Method**: POST ### Parameters - **`init_image`** (required): Please upload the reference image you want to edit. Upto 10 Reference image you can upload - Type: array - **`prompt`** (required): Enter the text for the image you want to generate - Type: textarea - **`samples`** (required): Number of images that can be generated in a single request - Type: number (range: 1-4) - **`width`** (required): Width must be at least 512 px and at most 1344 px - Type: number (range: 512-1344) - **`height`** (required): Height must be at least 512 px and at most 1344 px - Type: number (range: 512-1344) ## Usage Examples ### cURL ```bash curl --request POST \ --url https://modelslab.com/api/v6/images/img2img \ --header "Content-Type: application/json" \ --data '{ "key": "YOUR_API_KEY", "model_id": "qwen-image-2.1", "prompt": "Use the girl from the reference image as the main subject. Dress her in the jacket shown in Image 2, and have her hold the purse shown in Image 3. Place her standing naturally next to the car shown in Image 4.Keep her facial features, hairstyle, body proportions, and overall appearance consistent with the original girl. Match the lighting, shadows, perspective, and image quality so that the girl, jacket, purse, and car look naturally integrated into the same scene. Create a realistic, high-quality photograph.", "samples": "1", "width": "1024", "height": "1024" }' ``` ### Python ```python import requests response = requests.post( "https://modelslab.com/api/v6/images/img2img", headers={ "Content-Type": "application/json" }, json={ "key": "YOUR_API_KEY", "model_id": "qwen-image-2.1", "prompt": "Use the girl from the reference image as the main subject. Dress her in the jacket shown in Image 2, and have her hold the purse shown in Image 3. Place her standing naturally next to the car shown in Image 4.Keep her facial features, hairstyle, body proportions, and overall appearance consistent with the original girl. Match the lighting, shadows, perspective, and image quality so that the girl, jacket, purse, and car look naturally integrated into the same scene. Create a realistic, high-quality photograph.", "samples": "1", "width": "1024", "height": "1024" } ) print(response.json()) ``` ### JavaScript ```javascript fetch("https://modelslab.com/api/v6/images/img2img", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "key": "YOUR_API_KEY", "model_id": "qwen-image-2.1", "prompt": "Use the girl from the reference image as the main subject. Dress her in the jacket shown in Image 2, and have her hold the purse shown in Image 3. Place her standing naturally next to the car shown in Image 4.Keep her facial features, hairstyle, body proportions, and overall appearance consistent with the original girl. Match the lighting, shadows, perspective, and image quality so that the girl, jacket, purse, and car look naturally integrated into the same scene. Create a realistic, high-quality photograph.", "samples": "1", "width": "1024", "height": "1024" }) }) .then(response => response.json()) .then(data => console.log(data)); ``` ## Integration Options ### CLI Install: `curl -fsSL https://modelslab.sh/install.sh | sh` or `brew install modelslab/tap/modelslab` ```bash modelslab auth login # Authenticate modelslab models search "qwen-image-2.1" # Find this model modelslab models detail --id qwen-image-2.1 # Get model details modelslab generate image --prompt "..." --model qwen-image-2.1 # Generate with model modelslab config set generation.default_model qwen-image-2.1 # Set as default ``` - Website: https://modelslab.sh - GitHub: https://github.com/ModelsLab/modelslab-cli ### MCP Servers (Model Context Protocol) For Claude Code, Cursor, VS Code, Windsurf, and any MCP-compatible agent. - Generation: `https://modelslab.com/mcp/v7` (API key auth, 23 tools) - Agent Control Plane: `https://modelslab.com/mcp/agents` (Bearer token auth, 10 tools) Claude Code config (`~/.claude/settings.json`): ```json { "mcpServers": { "modelslab-v7": { "url": "https://modelslab.com/mcp/v7", "headers": { "Authorization": "Bearer YOUR_API_KEY" } } } } ``` - Documentation: https://docs.modelslab.com/mcp-web-api/overview ### Agent Skills Install skill files directly into AI coding agents: ```bash npx skills add modelslab/skills --all # All skills npx skills add modelslab/skills --skill image-generation # Specific skill npx skills add modelslab/skills --all -a claude-code -a cursor # Target agents ``` - GitHub: https://github.com/ModelsLab/skills - Documentation: https://docs.modelslab.com/agent-skills ### SDKs - Python: `pip install modelslab` - TypeScript: `npm install modelslab` - PHP: `composer require modelslab/modelslab` - Go: `go get github.com/modelslab/modelslab-go` - Dart: `dart pub add modelslab` ## Links - [Model Playground](https://modelslab.com/models/modelslab/qwen-image-2.1) - [API Documentation](https://docs.modelslab.com) - [ModelsLab Platform](https://modelslab.com)