mirror of
https://github.com/vladmandic/automatic
synced 2026-09-01 10:01:01 +02:00
cda4822ca0
Loading a Chroma transformer override via UNET dropdown crashed at inference with a shape mismatch in unpack_uint4: from_single_file does not integrate quantization_config the way from_pretrained does, so the dequantizer state was set up but the .weight tensor was never packed. CHROMA_SPEC routes through native_transformer with the diffusers Chroma converter, which loads bare and quantizes explicitly via sdnq_quantize_model.
19 lines
609 B
Python
19 lines
609 B
Python
"""Chroma pipeline package.
|
|
|
|
Exports :data:`CHROMA_SPEC`. Chroma community files use BFL-style
|
|
``model.diffusion_model.``-prefixed keys that need renaming into the
|
|
diffusers naming convention, so the spec plugs in
|
|
:func:`convert_chroma_transformer_checkpoint_to_diffusers` explicitly.
|
|
"""
|
|
|
|
import diffusers
|
|
from diffusers.loaders.single_file_utils import convert_chroma_transformer_checkpoint_to_diffusers
|
|
|
|
from pipelines.native_transformer import TransformerSpec
|
|
|
|
|
|
CHROMA_SPEC = TransformerSpec(
|
|
cls=diffusers.ChromaTransformer2DModel,
|
|
converter=convert_chroma_transformer_checkpoint_to_diffusers,
|
|
)
|