0dbe27c37 keyed the prompt cache on the negative prompt and the cfg flag
and hashed both prompts to tuples for it. The positive prompt was hashed
before the list check that builds the key, so a list prompt, which is what
every pipeline passes, was never stored or found and the text encoder ran
on every generation. Only the negative prompt needs hashing.
get_diffusers_task reports image-to-image for any class that diffusers
registers under both the text-to-image and image-to-image tables, so every
text-to-image generation on such a model (Klein, FLUX.2, Kontext,
Qwen-Image-Edit, LongCat) went through AutoPipeline.from_pipe and came back
as a new object. The prompt cache is keyed on the pipeline identity, so the
text encoder ran again on every image. set_diffuser_pipe now returns the
pipeline unchanged when its class is registered for the requested task.
The init-image snap rounds to the VAE factor, but the LLaDA pipeline needs
16 for its transformer patch and 32 when editing, since the source image is
halved for the semantic encoder. The pipeline now declares patch_size for
the shared rounding and init_image_multiple for input images, and
get_vae_scale_factor honours the latter when an init image is present.
check_inputs reads the same attributes.
Transformers recreates non-persistent buffers with torch.empty_like during
the meta-device load and leaves them to _init_weights, which here covered
only Linear and Embedding. The text encoder therefore ran with uninitialized
memory as its rotary frequencies: a different table on every load, and
non-finite embeddings whenever the garbage overflowed at longer positions.
The initializer now recomputes inv_freq for the rotary module.
A checkpoint-name key survives unload, so a reload of the same checkpoint
never printed the per-module stats block again, even with a different
quantization. Each component now carries its own reported stamp: a task
switch rebuilds the pipe around the same modules and stays quiet, while a
reload or a component swap brings new modules and reports them.
The group offload functions live in sd_offload_group, sd_offload_utils and
sd_offload_state rather than modules.sd_offload, so the tests and their
monkeypatches now import and patch those modules directly.
get_vae_scale_factor knew the ratio only for the pipeline and VAE class
names in its table and fell back to 8 for everything else. A repo that
subclasses a video autoencoder misses the table, so the request size was
rounded to a smaller multiple than the pipeline uses and the latent
preview unpack failed on heights that are not a multiple of 32.
diffusers video autoencoders carry spatial_compression_ratio on the
instance; use it before the default.
The third branch repeats `device.type == "cuda"`, so it can never run, and
it cannot be enabled by correcting the condition either: the Generator API
rejects MPS outright. The repo's other copy of this helper,
modules/hidiffusion/utils.py, has cpu/cuda/else and no third branch.
The parser no longer takes reference-name prefixes to tell bare
reference keys from bare diffusers keys. Any bare key carries the
sentinel and the arch resolver renames what it knows and passes the rest
through. Flux2 keeps its list for file-format detection only.
A bare key that matches no known prefix is parsed with the
bare-diffusers sentinel and handed to the resolver instead of being
dropped at parse time. The per-arch lists of bare diffusers prefixes are
gone, and a path that names no live module counts as unmapped.
A ChunkSpec can reorder equal row blocks of the rows it selects, so an
arch declares a swapped SwiGLU projection on the target instead of
permuting the state dict first. Only the LoRA family applies it; the
others skip a reordered target with a warning.
The reference fc1 is a fused [gate; value] SwiGLU projection and the
diffusers port stores [value; gate]. The native mapping did not swap the
halves, so gate and value deltas landed on each other's rows. The
mapping now also renames the standalone projections, reads a
metadata-only alpha, and accepts the musubi, peft dit and diffusers-named
layouts.