mirror of
https://github.com/modelscope/DiffSynth-Studio.git
synced 2026-03-18 22:08:13 +00:00
Fix AttributeError when pipe.dit is None
When using split training with 'sft:data_process' task, the DiT model is not loaded but the attribute 'dit' exists with value None. The existing hasattr check returns True but then accessing siglip_embedder fails. Add an explicit None check before accessing pipe.dit.siglip_embedder. Fixes #1246
This commit is contained in:
@@ -296,7 +296,7 @@ class ZImageUnit_PromptEmbedder(PipelineUnit):
|
||||
|
||||
def process(self, pipe: ZImagePipeline, prompt, edit_image):
|
||||
pipe.load_models_to_device(self.onload_model_names)
|
||||
if hasattr(pipe, "dit") and pipe.dit.siglip_embedder is not None:
|
||||
if hasattr(pipe, "dit") and pipe.dit is not None and pipe.dit.siglip_embedder is not None:
|
||||
# Z-Image-Turbo and Z-Image-Omni-Base use different prompt encoding methods.
|
||||
# We determine which encoding method to use based on the model architecture.
|
||||
# If you are using two-stage split training,
|
||||
|
||||
Reference in New Issue
Block a user