# Flux 3.1 Image Edit > AI model for generating image content ## Overview - **Model ID**: `flux-3.1-i2i` - **Category**: image - **Provider**: bfl - **Source Type**: Closed Source Model - **Status**: model_ready - **Screenshot**: `https://assets.modelslab.ai/generations/a5636956-a07f-426f-94a3-6e30acc6fefd.webp` ## 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/v7/images/image-to-image` - **Method**: POST ### Parameters - **`init_image`** (required): Upload up to 10 images to edit or use as references - Type: array - **`prompt`** (required): Describe in text how the image that need to be generated should appear. - Type: textarea - **`model_id`** (optional): Model id - Type: text - **`resolution`** (required): Select the output resolution - Type: select (options: 1K, 1.5K, 2K, 2.5K, 3.5K, 4K) - **`aspect_ratio`** (required): Select the aspect ratio - Type: select (options: Match first image, Auto, 21:9, 2:1, 16:9, 3:2, 7:5, 4:3, 5:4, 1:1, 4:5, 3:4, 5:7, 2:3, 9:16, 1:2, 9:21) - **`mode`** (required): Quality gives the best typography and fine detail. Fast is cheaper and quicker. - Type: select (options: Quality, Fast) - **`elements`** (required): Optional: draw boxes to place, move or remove objects. - Type: bounding_boxes ## Usage Examples ### cURL ```bash curl --request POST \ --url https://modelslab.com/api/v7/images/image-to-image \ --header "Content-Type: application/json" \ --data '{ "key": "YOUR_API_KEY", "model_id": "flux-3.1-i2i", "prompt": "The girl in image 1 and the dog in image 2 together in the same frame, in a living room, sofa in the background", "resolution": "1k", "aspect_ratio": "match_first_image", "mode": "quality" }' ``` ### Python ```python import requests response = requests.post( "https://modelslab.com/api/v7/images/image-to-image", headers={ "Content-Type": "application/json" }, json={ "key": "YOUR_API_KEY", "model_id": "flux-3.1-i2i", "prompt": "The girl in image 1 and the dog in image 2 together in the same frame, in a living room, sofa in the background", "resolution": "1k", "aspect_ratio": "match_first_image", "mode": "quality" } ) print(response.json()) ``` ### JavaScript ```javascript fetch("https://modelslab.com/api/v7/images/image-to-image", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "key": "YOUR_API_KEY", "model_id": "flux-3.1-i2i", "prompt": "The girl in image 1 and the dog in image 2 together in the same frame, in a living room, sofa in the background", "resolution": "1k", "aspect_ratio": "match_first_image", "mode": "quality" }) }) .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 "flux-3.1-i2i" # Find this model modelslab models detail --id flux-3.1-i2i # Get model details modelslab generate image --prompt "..." --model flux-3.1-i2i # Generate with model modelslab config set generation.default_model flux-3.1-i2i # 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/bfl/flux-3.1-i2i) - [API Documentation](https://docs.modelslab.com) - [ModelsLab Platform](https://modelslab.com)