feat(lora-worker): add optional train_id to POST /train (explicit publish-path namespace)

comfy-dev's explicit-over-implicit call: arbo now sends train_id, so the
worker no longer derives the loras/trained/{train_id}/ namespace from
output_dir.parent (which coupled it to arbo's handoff layout). train_id is
optional + path-safe-validated; when present it wins, else the path
derivation remains as the fallback. Wired through TrainRequest ->
validate_request -> published_relative_path -> _publish_lora. 18 tests green.
This commit is contained in:
vh
2026-07-07 01:49:24 -07:00
parent 74dbfafdf1
commit b617a8b674
4 changed files with 34 additions and 6 deletions
@@ -39,6 +39,7 @@ class TrainRequest(BaseModel):
tier: str
device_index: int = Field(ge=0, le=1)
seed: int = Field(default=42, ge=0)
train_id: str | None = None # Phase 2: arbo's id, the publish-path namespace (optional)
@app.post("/train")