# FLUX.2 Klein 9B LoRA Trainer > FLUX.2 Klein 9B LoRA Trainer Efficiently fine-tune custom FLUX.2 Klein 9B LoRA models using optimised training pipelines, flexible image format support, and a minimum of 16 GB of of VRAM for fast, high-quality LoRA training. ## Overview - **Model ID**: `flux2-klein-9b-lora-trainer` - **Category**: training - **Provider**: modelslab - **Source Type**: Open Source Model - **Status**: active - **Screenshot**: `https://assets.modelslab.ai/generations/54dfe855-cd75-4798-b78f-aaad0ef3b912.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/trainer/train` - **Method**: POST ### Parameters - **`images`** (required): Add miimum 15 images for good quality lora trained - Type: array - **`trigger_word`** (required): Trigger word for the LoRA model - Type: text - **`hf_username`** (optional): username for huggingface - Type: text - **`hf_token`** (optional): hf token for the user - Type: text - **`training_steps`** (optional): Recommended training steps are based on your dataset size. Training Steps = 100 to 150 × number of images. Example 10 images × 150 = 1500 steps. General Rule of Thumb: Fewer images = more steps per image. More images = fewer steps per image - Type: number (range: 500-3000) - **`training_id`** (optional): Please enter the training ID - Type: text ## Usage Examples ### cURL ```bash curl --request POST \ --url https://modelslab.com/api/v6/trainer/train \ --header "Content-Type: application/json" \ --data '{ "key": "YOUR_API_KEY", "model_id": "flux2-klein-9b-lora-trainer", "trigger_word": "Pink", "training_steps": "2000" }' ``` ### Python ```python import requests response = requests.post( "https://modelslab.com/api/v6/trainer/train", headers={ "Content-Type": "application/json" }, json={ "key": "YOUR_API_KEY", "model_id": "flux2-klein-9b-lora-trainer", "trigger_word": "Pink", "training_steps": "2000" } ) print(response.json()) ``` ### JavaScript ```javascript fetch("https://modelslab.com/api/v6/trainer/train", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "key": "YOUR_API_KEY", "model_id": "flux2-klein-9b-lora-trainer", "trigger_word": "Pink", "training_steps": "2000" }) }) .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 "flux2-klein-9b-lora-trainer" # Find this model modelslab models detail --id flux2-klein-9b-lora-trainer # Get model details modelslab generate image --prompt "..." --model flux2-klein-9b-lora-trainer # Generate with model modelslab config set generation.default_model flux2-klein-9b-lora-trainer # 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/flux2-klein-9b-lora-trainer) - [API Documentation](https://docs.modelslab.com) - [ModelsLab Platform](https://modelslab.com)