Route krea-2 through its per-component loader on the transformer-quant fast path
_assemble_pipe used Pipeline.from_pretrained for every family, but the krea repo ships transformers-5.x configs and no top-level tokenizer files, so the tokenizer dies with vocab_file=None. The pre-quantized checkpoint loaded fine and then the assembly crashed, dropping the load to the GGUF build, which krea-2 cannot take (Krea2Transformer2DModel has no from_single_file). Assemble per-component via load_krea2_pipeline like the pipeline-kind and single-file paths already do. Verified live: Krea-2-Turbo int8 and fp8 hosted prequant loads now assemble and render through the Studio images tab.
This commit is contained in:
parent
5e1614259c
commit
91be795a9b
2 changed files with 52 additions and 2 deletions
|
|
@ -1716,7 +1716,8 @@ class DiffusionBackend:
|
|||
)
|
||||
if transformer is not None:
|
||||
pipe = self._assemble_pipe(
|
||||
pipeline_cls, base, transformer, dtype, hf_token, device, base_local_dir
|
||||
pipeline_cls, base, transformer, dtype, hf_token, device, base_local_dir,
|
||||
fam = fam,
|
||||
)
|
||||
return pipe, scheme
|
||||
|
||||
|
|
@ -1731,7 +1732,7 @@ class DiffusionBackend:
|
|||
base, subfolder = "transformer", torch_dtype = dtype, token = hf_token
|
||||
)
|
||||
pipe = self._assemble_pipe(
|
||||
pipeline_cls, base, transformer, dtype, hf_token, device, base_local_dir
|
||||
pipeline_cls, base, transformer, dtype, hf_token, device, base_local_dir, fam = fam
|
||||
)
|
||||
scheme = quantize_transformer(
|
||||
pipe,
|
||||
|
|
@ -1754,9 +1755,19 @@ class DiffusionBackend:
|
|||
hf_token: Optional[str],
|
||||
device: str,
|
||||
base_local_dir: Optional[str] = None,
|
||||
fam: Optional[DiffusionFamily] = None,
|
||||
) -> Any:
|
||||
"""Assemble the diffusers pipeline around ``transformer`` and place it on ``device``
|
||||
(a no-op for an already-placed pre-quantized transformer; it moves the companions)."""
|
||||
if getattr(fam, "name", None) == KREA2_FAMILY_NAME:
|
||||
# krea ships transformers-5.x configs and no top-level tokenizer files, so
|
||||
# Pipeline.from_pretrained dies in the tokenizer (vocab_file = None); assemble
|
||||
# per-component like every other krea load path (see diffusion_krea2.py).
|
||||
pipe = load_krea2_pipeline(
|
||||
base_local_dir or base, dtype, hf_token = hf_token, transformer = transformer
|
||||
)
|
||||
pipe.to(device)
|
||||
return pipe
|
||||
pipe_kwargs: dict[str, Any] = {"torch_dtype": dtype, "transformer": transformer}
|
||||
if hf_token:
|
||||
pipe_kwargs["token"] = hf_token
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue