SCRIPTS.
PRODUCTION PYTHON
Source of the actor-LoRA pipeline built as company work at The Blue Studio’s BLUE LAB (March 2026), published with the company’s permission; actor names, photo filenames, and dataset paths are generalized (the actor dataset stays private). The code was written by Claude Code under my direction; design, review, and runs were mine. Click any filename to open the Python file. Sizes are approximate; comments in the public copies are in English.
Curation pipeline that auto-selects a training set (~29 images) from a large pool of photos. Largest script in the pipeline. Actual order: (1) ArcFace identity check (rejects other people) → (2) auto chest-up crop → (3) quality score, (4) tone consistency (LAB z-score), (5) de-duplication → (6) angle-diversity report → (7) trigger-word captions.
Resolution / tone / composition gates. Rejects images below resolution threshold, outside acceptable tone range, or with bad framing (face too small, off-center, multi-face). Generates a rejection log so the operator can re-shoot.
Sends a templated workflow JSON to a running ComfyUI instance over HTTP, polls until completion, and downloads the resulting images. Used during the eval loop to generate test prompts against each LoRA checkpoint.
Top-level orchestrator. Reads YAML config, sets environment, launches AI-Toolkit training subprocess with logging, captures exit code. Used to start runs from terminal or schedule overnight.
For each saved checkpoint (every 100 steps), generates a fixed eval prompt set, computes face embeddings via InsightFace ArcFace, compares to the source actor embedding, and writes the per-step similarity to disk.
Loads the LoRA-step similarity series and the commercial baseline (Higgsfield Soul 2.0) reference series, computes deltas, picks the best LoRA checkpoint by averaged identity score, and emits a summary table.
Sweeps inference-time parameters (CFG, Steps, max_shift) across three rounds, narrowing the search each round. Runs each combination through ComfyUI, scores via ArcFace, and writes a structured sweep log. Second-largest script.
Parses the sweep log, computes mean similarity per parameter combination, identifies the optimum, and surfaces the top-N candidates with their tradeoff axes (quality vs identity vs diversity).
Long-running monitor that tails the AI-Toolkit log directory, runs a quick eval whenever a new checkpoint appears, and emits a warning when the similarity curve starts to overshoot or plateau (early-stop signal).