Skip to content

Instantly share code, notes, and snippets.

@mrhgd
mrhgd / aitoolkit_service.py
Created May 27, 2026 05:03
GenFlow aitoolkit service v2 - Flux 2 fix
"""
GenFlow ai-toolkit pod-side service.
Wraps ostris/ai-toolkit as an HTTP service so the GenFlow server (which lives
on a separate sandbox) can submit Flux 2 LoRA training jobs to it.
Mirrors the lifecycle of the ComfyUI-FluxTrainer path:
POST /train → kicks off a subprocess, returns jobId
GET /status/:id → progress + final output filename
POST /cancel/:id → terminate subprocess