ModelsLab/Stable Diffusion Trainer
sd-trainerEfficiently train custom Stable Diffusion models with flexible batch sizes, gradient checkpointing, and memory-optimized attention requiring 12-24 GB VRAM for high-quality 512×512 to 1024×1024 image outputs.
API Endpoint URL
Base URL for all API requests to this endpoint.
https://modelslab.com/api/v6/trainer/train
API Authentication
Authentication requires a valid API key included in the request. Generate and manage your API keys from your developer dashboard. Include the key in the key parameter for all API requests.
Integration Examples
Production-ready code samples for API integration
{"instance_prompt": "thalman than","images": ["https://pics.craiyon.com/2024-05-25/8sgy0rrpQvat_T1JLeAmEg.webp","https://cdn.decohere.ai/cus_QmeRRs7CrpQL06-stablevideo/outputs/1728674089177/example_image.webp","https://cdn.openart.ai/published/z1GNaRNOXOqkt1NmKac1/zdaB9HfQ_CAlV_1024.webp"],"hf_token": null,"hf_username": null,"base_model_type": "sdxl","seed": "298329","training_steps": "1500","resolution": "1024","batch_size": "4","mixed_precision": "fp16","rank": "4","alpha": "2","learning_rate": "0.0001","server_name": "NVIDIA GeForce RTX 3090 ($0.46/hr)","trainer_id": "sd-trainer","key": "YOUR_API_KEY"}
SDKs
Official SDKs
Production-ready SDKs and client libraries for all major programming languages
API Parameters
Technical specifications for API request parameters.
| Field Name | Parameter | Technical Description |
|---|---|---|
| Instance Prompt | instance_prompt | Prompt for training the instance. |
| Images | images | Dataset for training, either as a path string or a list of paths (Required) |
| Hf Token | hf_token | Hugging Face token for accessing models. |
| Hf Username | hf_username | Hugging Face username for model storage |
| Base Model Type | base_model_type | Type of the base model. (Required) |
| Seed | seed | Random seed for reproducibility. (Required) |
| Training Steps | training_steps | No description available |
| Resolution | resolution | Resolution for the training images. |
| Batch Size | batch_size | Batch size for training. |
| Mixed Precision | mixed_precision | Precision mode for training allowed (fp16, bf16”) |
| Rank | rank | Rank for LoRA |
| Alpha | alpha | Alpha for LoRA. |
| Learning Rate | learning_rate | No description available |
| Server | server_name | No description available |
| Trainer Id | trainer_id | No description available |