From d44b5f86e613518bb47be8ec5a020df967cb9c4b Mon Sep 17 00:00:00 2001 From: Sayak Paul Date: Sat, 10 Jan 2026 10:34:25 +0530 Subject: [PATCH] fix how `is_fsdp` is determined (#12960) up --- examples/dreambooth/train_dreambooth_lora_flux2.py | 2 +- examples/dreambooth/train_dreambooth_lora_flux2_img2img.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/dreambooth/train_dreambooth_lora_flux2.py b/examples/dreambooth/train_dreambooth_lora_flux2.py index 6bba0b94b1..317ed2c2b2 100644 --- a/examples/dreambooth/train_dreambooth_lora_flux2.py +++ b/examples/dreambooth/train_dreambooth_lora_flux2.py @@ -1228,7 +1228,7 @@ def main(args): else {"device": accelerator.device, "dtype": weight_dtype} ) - is_fsdp = accelerator.state.fsdp_plugin is not None + is_fsdp = getattr(accelerator.state, "fsdp_plugin", None) is not None if not is_fsdp: transformer.to(**transformer_to_kwargs) diff --git a/examples/dreambooth/train_dreambooth_lora_flux2_img2img.py b/examples/dreambooth/train_dreambooth_lora_flux2_img2img.py index 5f6a1afb41..419821e8a8 100644 --- a/examples/dreambooth/train_dreambooth_lora_flux2_img2img.py +++ b/examples/dreambooth/train_dreambooth_lora_flux2_img2img.py @@ -1178,7 +1178,7 @@ def main(args): else {"device": accelerator.device, "dtype": weight_dtype} ) - is_fsdp = accelerator.state.fsdp_plugin is not None + is_fsdp = getattr(accelerator.state, "fsdp_plugin", None) is not None if not is_fsdp: transformer.to(**transformer_to_kwargs)