Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

Merge remote-tracking branch 'upstream/main' into fix/9416-rebase

Alexander Eichhorncb826ffc0278
diff --cc invokeai/backend/model_manager/load/load_default.py
index 170f111787,d646d4466d..409ec81db6
--- a/invokeai/backend/model_manager/load/load_default.py
+++ b/invokeai/backend/model_manager/load/load_default.py
@@@ -308,20 -344,11 +370,16 @@@ class ModelLoader(ModelLoaderBase)
def _should_use_fp8(self, config: AnyModelConfig, submodel_type: Optional[SubModelType] = None) -> bool:
"""Check if FP8 layerwise casting should be applied to a model."""
- # FP8 storage only works on CUDA
- if self._torch_device.type != "cuda":
- return False
- # Z-Image has dtype mismatch issues with diffusers' layerwise casting
- # (skipped modules produce bf16, hooked modules expect fp16).
- from invokeai.backend.model_manager.taxonomy import BaseModelType, ModelType
--
- if hasattr(config, "base") and config.base == BaseModelType.ZImage:
+ from invokeai.backend.model_manager.taxonomy import ModelType
+
+ # Already-quantized models are excluded. Their weights are packed integer payloads, not
+ # values we may re-encode, and every quantized-format loader reaches this helper. Casting
+ # them is not a no-op:
+ # - GGUF raises `Operation changed the dtype of GGMLTensor unexpectedly` at load time.
+ # - bnb NF4 corrupts *silently* — `bnb.nn.LinearNF4` subclasses `nn.Linear`, so the packed
+ # uint8 payload is cast to float8, inference still returns finite numbers, and the model
+ # just produces garbage.
+ if hasattr(config, "format") and config.format in _QUANTIZED_MODEL_FORMATS:
return False
# VAEs are excluded — fp8 storage causes noticeable quality degradation in decode.