Training Status
curl --request POST \
--url https://modelslab.com/api/v6/trainer/status/{training_id} \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>"
}
'import requests
url = "https://modelslab.com/api/v6/trainer/status/{training_id}"
payload = { "key": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({key: '<string>'})
};
fetch('https://modelslab.com/api/v6/trainer/status/{training_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://modelslab.com/api/v6/trainer/status/{training_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://modelslab.com/api/v6/trainer/status/{training_id}"
payload := strings.NewReader("{\n \"key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://modelslab.com/api/v6/trainer/status/{training_id}")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://modelslab.com/api/v6/trainer/status/{training_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "training_started",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "training_started",
"request_dump": {},
"response_dump": {},
"model_link": "<string>",
"inference": {
"status": "preparing",
"message": "<string>",
"model_id": "<string>",
"base_model_id": "<string>",
"trigger_word": "<string>",
"playground_url": "<string>",
"api": {
"url": "<string>",
"body": {}
}
}
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fetch_result": "<string>"
}{
"status": "error",
"message": "<string>"
}{
"status": "error",
"message": "<string>"
}Training Status
Check the progress of a training run and get the request that runs your trained LoRA.
POST
/
status
/
{training_id}
Training Status
curl --request POST \
--url https://modelslab.com/api/v6/trainer/status/{training_id} \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>"
}
'import requests
url = "https://modelslab.com/api/v6/trainer/status/{training_id}"
payload = { "key": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({key: '<string>'})
};
fetch('https://modelslab.com/api/v6/trainer/status/{training_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://modelslab.com/api/v6/trainer/status/{training_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://modelslab.com/api/v6/trainer/status/{training_id}"
payload := strings.NewReader("{\n \"key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://modelslab.com/api/v6/trainer/status/{training_id}")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://modelslab.com/api/v6/trainer/status/{training_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "training_started",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "training_started",
"request_dump": {},
"response_dump": {},
"model_link": "<string>",
"inference": {
"status": "preparing",
"message": "<string>",
"model_id": "<string>",
"base_model_id": "<string>",
"trigger_word": "<string>",
"playground_url": "<string>",
"api": {
"url": "<string>",
"body": {}
}
}
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fetch_result": "<string>"
}{
"status": "error",
"message": "<string>"
}{
"status": "error",
"message": "<string>"
}Returns the status of a training run. Poll it every minute or two. After the run completes, keep polling until
data.inference.status is ready; the response then contains the exact request to generate with your LoRA.
Request
Make aPOST request to the endpoint below, with the training id from Start Training in the path.
POST https://modelslab.com/api/v6/trainer/status/{training_id}
Body
json
{
"key": "your_api_key"
}
Status values
message / data.status | Meaning |
|---|---|
training_started | Queued or training. |
training_completed | Training finished, or you stopped the run. |
training_cancelled | Training failed. data.response_dump holds the reason. |
Response
While training
json
{
"status": "success",
"message": "training_started",
"data": {
"id": "9b2f6c1e-4d3a-4f8e-a1b2-3c4d5e6f7a8b",
"status": "training_started",
"request_dump": {
"trainer_id": "flux_lora_trainer",
"trigger_word": "pinkpanda",
"hf_username": "your_hf_username",
"training_steps": 750
},
"response_dump": {
"status": "queued"
},
"model_link": null,
"inference": null
},
"id": "9b2f6c1e-4d3a-4f8e-a1b2-3c4d5e6f7a8b",
"fetch_result": "https://modelslab.com/api/v6/trainer/status/9b2f6c1e-4d3a-4f8e-a1b2-3c4d5e6f7a8b"
}
Completed and ready to generate
json
{
"status": "success",
"message": "training_completed",
"data": {
"id": "9b2f6c1e-4d3a-4f8e-a1b2-3c4d5e6f7a8b",
"status": "training_completed",
"request_dump": {
"trainer_id": "flux_lora_trainer",
"trigger_word": "pinkpanda",
"hf_username": "your_hf_username",
"training_steps": 750
},
"response_dump": {
"status": "training_completed"
},
"model_link": "https://huggingface.co/your_hf_username/9b2f6c1e-4d3a-4f8e-a1b2-3c4d5e6f7a8b",
"inference": {
"status": "ready",
"message": "Your model is ready. Use the trigger word in your prompt.",
"model_id": "tm-3f9a1c2b7d4e5f6a8b9c0d1e",
"base_model_id": "fluxdev",
"trigger_word": "pinkpanda",
"playground_url": "https://modelslab.com/models/modelslab/fluxdev?model_id=fluxdev&lora_model=tm-3f9a1c2b7d4e5f6a8b9c0d1e",
"api": {
"url": "https://modelslab.com/api/v6/images/text2img",
"body": {
"key": "YOUR_API_KEY",
"model_id": "fluxdev",
"lora_model": "tm-3f9a1c2b7d4e5f6a8b9c0d1e",
"lora_strength": 1,
"prompt": "pinkpanda, a portrait photo",
"width": 1024,
"height": 1024,
"samples": 1
}
}
}
},
"id": "9b2f6c1e-4d3a-4f8e-a1b2-3c4d5e6f7a8b",
"fetch_result": "https://modelslab.com/api/v6/trainer/status/9b2f6c1e-4d3a-4f8e-a1b2-3c4d5e6f7a8b"
}
data.inference is null until training completes. For FLUX.2 Klein 9B, FLUX.3 Klein and MOSS Image runs it reports failed with This training cannot be prepared for inference., because those LoRAs are not loaded on ModelsLab. Download them from your Hugging Face repo instead.Body
application/json
Your API key. Get one from https://modelslab.com/dashboard/api-keys.
Response
Current state of the training run.
- Option 1
- Option 2
Was this page helpful?

