mirror of
https://github.com/vladmandic/automatic
synced 2026-09-09 06:18:43 +02:00
f9d2bbe080
Base ships last.up all-zeros so the branch is a no-op; pre-branch finetunes omit both keys. A zero_init_missing spec field zero-fills them on load instead of falling back to the base transformer.
16 lines
706 B
Python
16 lines
706 B
Python
from pipelines.krea2.transformer_krea2 import Krea2Transformer2DModel
|
|
from pipelines.native_transformer import TransformerSpec
|
|
|
|
|
|
# Checkpoint keys are bare (`first.`, `blocks.N.`, `txtfusion.`, ...) and the transformer's
|
|
# module tree mirrors them exactly, so no state-dict conversion is needed. The model has no
|
|
# rope/pos buffers, so the default acceptable-missing set is sufficient.
|
|
#
|
|
# `last.up`/`last.down` are a dormant zero-init residual branch (base ships last.up.weight
|
|
# all-zeros). Finetunes predating it omit both keys; zero-fill so the branch stays a no-op.
|
|
KREA2_SPEC = TransformerSpec(
|
|
cls=Krea2Transformer2DModel,
|
|
converter=None,
|
|
zero_init_missing=("last.down.", "last.up."),
|
|
)
|