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.