Set Flux models to eval mode to restore FP8 performance

Fixes performance regression introduced in #9854 where the fp8_linear
optimization path was being skipped during inference because Flux models
were not explicitly set to eval mode.
This commit is contained in:
matthew 2025-10-13 14:34:36 -04:00
parent d68ece7301
commit f87480188a

View File

@ -834,6 +834,7 @@ class PixArt(BaseModel):
class Flux(BaseModel):
def __init__(self, model_config, model_type=ModelType.FLUX, device=None, unet_model=comfy.ldm.flux.model.Flux):
super().__init__(model_config, model_type, device=device, unet_model=unet_model)
self.diffusion_model.eval().requires_grad_(False)
self.memory_usage_factor_conds = ("ref_latents",)
def concat_cond(self, **kwargs):