# MOSS Image LoRA Trainer > Train custom MOSS Image LoRA models efficiently with flexible batch sizes, optimized attention, and 12–24 GB VRAM support for high-quality 512×512 to 1024×1024 image generation. ## Overview - **Model ID**: `moss-image-lora-trainer` - **Category**: training - **Provider**: modelslab - **Source Type**: Open Source Model - **Status**: active - **Screenshot**: `https://assets.modelslab.ai/generations/7cc607c2-1e9f-454b-b6a8-f552e2b1924b.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 - **`instance_prompt`** (required): Prompt for training the instance. - Type: textarea - **`images`** (required): Dataset for training, either as a path string or a list of paths (Required) - Type: array - **`hf_token`** (optional): Hugging Face token for accessing models. - Type: text - **`hf_username`** (optional): Hugging Face username for model storage - Type: text - **`base_model_type`** (optional): Type of the base model. (Required) - Type: text - **`seed`** (optional): Random seed for reproducibility. (Required) - Type: number - **`training_steps`** (optional): - Type: number - **`resolution`** (optional): Resolution for the training images. - Type: number (range: 512-1024) - **`batch_size`** (optional): Batch size for training. - Type: number (range: 1-128) - **`mixed_precision`** (optional): Precision mode for training allowed (fp16, bf16”) - Type: select (options: fp16) - **`rank`** (optional): Rank for LoRA - Type: number (range: 1-512) - **`alpha`** (optional): Alpha for LoRA. - Type: number (range: 1-1024) - **`learning_rate`** (optional): - Type: number - **`trainer_id`** (optional): - 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": "moss-image-lora-trainer", "instance_prompt": "thalman than", "base_model_type": "moss-image-lora-trainer", "seed": "298329", "training_steps": "1500", "resolution": "1024", "batch_size": "4", "mixed_precision": "fp16", "rank": "4", "alpha": "2", "learning_rate": "0.0001", "trainer_id": "moss-image-lora-trainer" }' ``` ### 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": "moss-image-lora-trainer", "instance_prompt": "thalman than", "base_model_type": "moss-image-lora-trainer", "seed": "298329", "training_steps": "1500", "resolution": "1024", "batch_size": "4", "mixed_precision": "fp16", "rank": "4", "alpha": "2", "learning_rate": "0.0001", "trainer_id": "moss-image-lora-trainer" } ) 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": "moss-image-lora-trainer", "instance_prompt": "thalman than", "base_model_type": "moss-image-lora-trainer", "seed": "298329", "training_steps": "1500", "resolution": "1024", "batch_size": "4", "mixed_precision": "fp16", "rank": "4", "alpha": "2", "learning_rate": "0.0001", "trainer_id": "moss-image-lora-trainer" }) }) .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 "moss-image-lora-trainer" # Find this model modelslab models detail --id moss-image-lora-trainer # Get model details modelslab generate image --prompt "..." --model moss-image-lora-trainer # Generate with model modelslab config set generation.default_model moss-image-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/moss-image-lora-trainer) - [API Documentation](https://docs.modelslab.com) - [ModelsLab Platform](https://modelslab.com)