Add '--flipflop-offload' startup argument

This commit is contained in:
Jedrzej Kosinski 2025-10-13 21:10:44 -07:00
parent 586a8de8da
commit 61133af772
3 changed files with 6 additions and 0 deletions

View File

@ -132,6 +132,8 @@ parser.add_argument("--reserve-vram", type=float, default=None, help="Set the am
parser.add_argument("--async-offload", action="store_true", help="Use async weight offloading.")
parser.add_argument("--flipflop-offload", action="store_true", help="Use async flipflop weight offloading for supported DiT models.")
parser.add_argument("--force-non-blocking", action="store_true", help="Force ComfyUI to use non-blocking operations for all applicable tensors. This may improve performance on some non-Nvidia systems but can cause issues with some workflows.")
parser.add_argument("--default-hashing-function", type=str, choices=['md5', 'sha1', 'sha256', 'sha512'], default='sha256', help="Allows you to choose the hash function to use for duplicate filename / contents comparison. Default is sha256.")

View File

@ -1001,6 +1001,8 @@ def force_channels_last():
#TODO
return False
def flipflop_enabled():
return args.flipflop_offload
STREAMS = {}
NUM_STREAMS = 1

View File

@ -624,6 +624,8 @@ class ModelPatcher:
def supports_flipflop(self):
# flipflop requires diffusion_model, explicit flipflop support, NVIDIA CUDA streams, and loading/offloading VRAM
if not comfy.model_management.flipflop_enabled():
return False
if not hasattr(self.model, "diffusion_model"):
return False
if not getattr(self.model.diffusion_model, "enable_flipflop", False):