• Stefy Lanza (nextime / spora )'s avatar
    h3: run the newer diffusers as a 75 MB overlay, and train through it · 3d53da50
    Stefy Lanza (nextime / spora ) authored
    H3 and Krea 2 need diffusers >= 0.40 while the server runs 0.38. Upgrading in
    place is not free: measured on this box, SDXL comes out bit-identical but Z-Image
    drifts (mean |diff| 0.0146, max 0.32, against a same-version control that is
    bit-identical) — so the upgrade would silently change image output for a model
    that is working fine.
    
    Since diffusers is imported once per process, the split only has to be
    per-process. The H3 venv is now created with --system-site-packages and given
    nothing but diffusers>=0.40 and huggingface_hub>=1.23; torch, transformers and the
    rest are inherited from the server's venv. That is 75 MB instead of the several GB
    a standalone venv costs, and keeps one torch on the machine.
    CODERAI_H3_STANDALONE_VENV=1 still builds a fully independent venv from
    requirements-h3.txt, for the day the parent's torch is too old.
    
    Training follows the same boundary: tools/lora_train_worker.py runs one job in the
    overlay — references written out as PNGs, request flattened to JSON, progress
    returned as JSON lines and mirrored onto the usual /v1/loras/progress so polling is
    unchanged. _train_via_overlay() drives it.
    
    Routing is by capability, not hardcoded: _diffusers_has(arch) tries to load the
    classes, so wan and ltx2 train in-process (0.38 has them) while h3 and krea go
    out-of-process — and if the main venv is ever upgraded they move back in-process
    with no config change.
    
    Verified: the overlay resolves diffusers 0.40 with torch/transformers inherited and
    leaves the parent untouched; a probe job ran under it, reached _train_flow_dit and
    reported back through the job file. The trainers themselves are still unrun against
    real weights.
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_0182DhR1eFNPQyGmDrpHbedY
    3d53da50
Name
Last commit
Last update
codai Loading commit data...
docs Loading commit data...
packaging Loading commit data...
samples Loading commit data...
tests Loading commit data...
tools Loading commit data...
.dockerignore Loading commit data...
.gitignore Loading commit data...
AI.PROMPT Loading commit data...
CODERAI_API_DOCUMENTATION.md Loading commit data...
CoderAI.gif Loading commit data...
DISTRIBUTION.md Loading commit data...
LICENSE.md Loading commit data...
MULTIMODAL_CAPABILITIES.md Loading commit data...
MULTIMODAL_UI_EXAMPLES.md Loading commit data...
README.md Loading commit data...
REQUEST-geoclip-embeddings.md Loading commit data...
REQUEST-vpr-embeddings.md Loading commit data...
amdgpu-coredump-05000.bin Loading commit data...
build-oci.sh Loading commit data...
build.ps1 Loading commit data...
build.sh Loading commit data...
coderai Loading commit data...
coderai-broker-implementation-reference.md Loading commit data...
coderai-integration.md Loading commit data...
commands Loading commit data...
osxbuild.sh Loading commit data...
package-oci.sh Loading commit data...
package-tarball.sh Loading commit data...
requirements-crisperwhisper.txt Loading commit data...
requirements-h3.txt Loading commit data...
requirements-melotts.txt Loading commit data...
requirements-nemo.txt Loading commit data...
requirements-nvidia.txt Loading commit data...
requirements-ocr-paddle.txt Loading commit data...
requirements-ocr.txt Loading commit data...
requirements-pyannote.txt Loading commit data...
requirements-surya.txt Loading commit data...
requirements-vllm.txt Loading commit data...
requirements-vulkan.txt Loading commit data...
requirements.txt Loading commit data...
run-oci.sh Loading commit data...
smoke-test-oci.sh Loading commit data...
todo.md Loading commit data...
video_editor.config.json Loading commit data...