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
+3 -1
View File
@@ -298,7 +298,9 @@ class JobManager:
if not job.lora_path:
return
try:
rel = published_relative_path(job.params["output_dir"], job.params["output_name"])
rel = published_relative_path(
job.params["output_dir"], job.params["output_name"], job.params.get("train_id")
)
dest = config.LORAS_PUBLISH_ROOT / rel
dest.parent.mkdir(parents=True, exist_ok=True)
try: