diff --git a/invokeai/backend/flux/denoise.py b/invokeai/backend/flux/denoise.py index 75af67505a..14fafb6e1d 100644 --- a/invokeai/backend/flux/denoise.py +++ b/invokeai/backend/flux/denoise.py @@ -61,6 +61,9 @@ def denoise( ) # Merge the ControlNet residuals from multiple ControlNets. + # TODO(ryand): We may want to alculate the sum just-in-time to keep peak memory low. Keep in mind, that the + # controlnet_residuals datastructure is efficient in that it likely contains multiple references to the same + # tensors. Calculating the sum materializes each tensor into its own instance. merged_controlnet_residuals = sum_controlnet_flux_outputs(controlnet_residuals) pred = model(