Google Colab Kohya LoRA Workflow

Заказчик: AI | Опубликовано: 14.12.2025

I need a single, well-commented Google Colab notebook that lets me run the full kohya_ss pipeline end-to-end without leaving the browser. 1. Auto-captioning The notebook must accept an input folder of unlabeled images on my Drive and create technical, detail-rich captions for each file (e.g., via BLIP or any kohya_ss-compatible module). Generated captions should be written back as *.txt files next to each image so kohya_ss can pick them up for training. 2. LoRA training Using those freshly captioned images, the next section should fine-tune a Stable Diffusion-compatible model into a LoRA. I want the usual kohya_ss training options exposed (learning rate, resolution, batch size, number of epochs) but filled with sensible defaults. The code should automatically save the resulting *.safetensors LoRA to Drive. 3. Image generation with background control Finally, include an inference cell that loads the trained LoRA, merges it with the base model if needed, and produces exactly five images per run. The prompt must let me pin the subject’s outfit and pose yet vary the background—e.g., “Subject in same red saree, full body, standing, highly detailed, background: Taj Mahal, sunset.” The cell should output the five PNGs side-by-side and store them in a dated folder on Drive. Deliverables • A ready-to-run *.ipynb using kohya_ss, Diffusers/InvokeAI or Automatic1111 back-end as required • Inline comments explaining every major step and parameter • Minimal setup friction: automatic Drive mounting, model download, and dependency installs Acceptance When I press “Runtime → Run all,” the notebook should: ✅ Caption my unlabeled images with technical, detailed text ✅ Train a LoRA without manual edits ✅ Generate and display five consistent-outfit images against the chosen background (e.g., Taj Mahal) and save them to Drive Keep the code modular so I can swap models or tweak hyperparameters later. If it gives any issue while running on my colab, you should be able to help me online.