🎉 New Year Sale: Get 20% OFF on all plans — Use code NEWYEAR2026.

Upgrade now
Stable Diffusion Trainer thumbnail

ModelsLab/Stable Diffusion Trainer

sd-trainer
Stable Diffusion TrainerFree for Premium UsersLLMs.txt
Efficiently 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 PlaygroundAPI Documentation

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 NameParameterTechnical Description
Instance Promptinstance_promptPrompt for training the instance.
ImagesimagesDataset for training, either as a path string or a list of paths (Required)
Hf Tokenhf_tokenHugging Face token for accessing models.
Hf Usernamehf_usernameHugging Face username for model storage
Base Model Typebase_model_typeType of the base model. (Required)
SeedseedRandom seed for reproducibility. (Required)
Training Stepstraining_stepsNo description available
ResolutionresolutionResolution for the training images.
Batch Sizebatch_sizeBatch size for training.
Mixed Precisionmixed_precisionPrecision mode for training allowed (fp16, bf16”)
RankrankRank for LoRA
AlphaalphaAlpha for LoRA.
Learning Ratelearning_rateNo description available
Serverserver_nameNo description available
Trainer Idtrainer_idNo description available