Small flux optimization. (#8611)

This commit is contained in:
comfyanonymous 2025-06-20 02:37:32 -07:00 committed by GitHub
parent 7e9267fa77
commit f7fb193712
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -118,7 +118,7 @@ class Modulation(nn.Module):
def apply_mod(tensor, m_mult, m_add=None, modulation_dims=None): def apply_mod(tensor, m_mult, m_add=None, modulation_dims=None):
if modulation_dims is None: if modulation_dims is None:
if m_add is not None: if m_add is not None:
return tensor * m_mult + m_add return torch.addcmul(m_add, tensor, m_mult)
else: else:
return tensor * m_mult return tensor * m_mult
else: else: