Skip to content

Krea2 generation & lora trainer#15

Merged
imprsnst merged 4 commits into
mainfrom
krea-gen-trainer
Jul 25, 2026
Merged

Krea2 generation & lora trainer#15
imprsnst merged 4 commits into
mainfrom
krea-gen-trainer

Conversation

@imprsnst

@imprsnst imprsnst commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Generation

  • Krea 2 Turbo and Krea 2 RAW canvas nodes, registered as Core builtins alongside Z-Image. Each declares requirements and a fit estimate so the model popup warns before a 26 GB load instead of failing mid-load.
  • Reads ComfyUI-style files from Comfy-Org/Krea-2, bf16 builds only. The fp8_scaled, int8_convrot, mxfp8 and nvfp4 variants carry ComfyUI-specific scale tensors; the node says so up front. VAE is the diffusers-format one from Qwen/Qwen-Image. All repos public, no HF token needed.
  • img2img support plus the usual take/progress plumbing.
  • Extracted shared pipeline machinery from the Z-Image runner into models/pipeline_runtime.py and models/loaders.py. zimage/runner.py drops from ~1000 to ~250 lines and both families share one device/dtype/offload path. models/checkpoint.py centralises checkpoint inspection.

LoRA training

  • Trainer is arch-aware (training/arch.py): z-image and krea2, each declaring base resolution, target modules and text-encoder handling.
  • 4-bit (nf4) frozen base for Krea 2, which is what fits a 26 GB base into a 12 GB card at 512. The LoRA stays full precision, so the only cost is base fidelity. auto sizes base plus activations against the GPU and picks.
  • New hyperparameters in the Trainer Adjust panel: base quantisation (auto/none/nf4), LoRA scope (full vs attention, per the Krea authors' advice for long runs), caption dropout, flip augmentation.
  • raw base mode joins turbo_adapter/deturbo. Existing runs default to arch: z-image, so anything saved before this PR keeps working.
  • Settings stage behind an Update button instead of applying as you type. Checkpoints encode the rank, targets and base they were built with, so applying a change to a resumable run asks first, then discards that run's checkpoints via the new training:discard channel. Finished LoRA files are never touched.

Project / licensing

  • MIT to GPL-3.0-or-later (LICENSE, package.json, README badge).
  • Added CODE_OF_CONDUCT.md, CONTRIBUTING.md, issue templates, PR template.
  • README: Krea 2 section (files, VRAM floors, bf16-only and VAE-format gotchas), updated hardware table (Krea 2 1024² and LoRA training verified on an L40S 48 GB), updated known limits.

@imprsnst
imprsnst marked this pull request as ready for review July 25, 2026 06:28
@imprsnst
imprsnst merged commit 687a4a8 into main Jul 25, 2026
@imprsnst
imprsnst deleted the krea-gen-trainer branch July 25, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant