Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Fix Flux2 reference image mem estimation. (#10905)

comfyanonymous58b85746618e
diff --git a/comfy/model_base.py b/comfy/model_base.py
index cc21b1de9..9b76c285e 100644
--- a/comfy/model_base.py
+++ b/comfy/model_base.py
@@ -926,7 +926,7 @@ class Flux(BaseModel):
out = {}
ref_latents = kwargs.get("reference_latents", None)
if ref_latents is not None:
- out['ref_latents'] = list([1, 16, sum(map(lambda a: math.prod(a.size()), ref_latents)) // 16])
+ out['ref_latents'] = list([1, 16, sum(map(lambda a: math.prod(a.size()[2:]), ref_latents))])
return out
class Flux2(Flux):