train_doctor
Preflight and set up the training environment: verify Docker/GPU readiness, bootstrap the native trainer, or build the GPU Docker image.
Instructions
Preflight and set up the TRAINER ITSELF — the docker/GPU/venv machinery every training job needs. Touches no dataset and no job. Driven by the action parameter:
action:"doctor" — Preflight the local trainer: docker daemon reachable,
--gpus allGPU passthrough working (NVIDIA Container Toolkit), trainer image built. Read-only, takes no other parameters. Returns per-check booleans + setup hints. Also reports the training data root and whether HF_TOKEN is set (needed to download FLUX.1-dev on first run), the native (dockerless) bootstrap status, and the connected pod. Run this first when a training start fails.action:"bootstrap" — Set up the NATIVE (dockerless) trainer on this machine (
target'local', the default) or on a pod (target'pod', optionalpod_id): clone ai-toolkit at the pinned commit, create its venv, install torch + requirements. One-time per machine/pod (~10 min fresh, idempotent; a pod's /workspace persists it across restarts). Needed before a target 'pod' train_start on a fresh pod (no docker there). Long-running.action:"build_image" — Build the headless GPU trainer image (comfyui-mcp-trainer:latest) from docker/trainer/Dockerfile — one-time, several minutes (CUDA + torch + ai-toolkit). Requires a reachable docker daemon.
aiToolkitRefpins the ai-toolkit commit/tag for reproducibility. The docker alternative to action:"bootstrap".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Which trainer-setup operation to perform. "doctor" is read-only and takes no other parameters; "bootstrap" takes `target` (+ `pod_id` for target 'pod'); "build_image" takes an optional `aiToolkitRef`. None of them touches a dataset or a job. | |
| pod_id | No | action:"bootstrap" — pod to bootstrap (target 'pod'). Default: the connected pod. | |
| target | No | action:"bootstrap" — where to install the native trainer. Default local. | local |
| aiToolkitRef | No | action:"build_image" — ai-toolkit git ref (commit/tag) to build against. Default: the Dockerfile's pinned ref. |