File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
src/diffusers/pipelines/stable_diffusion_3 Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -907,11 +907,7 @@ def __call__(
907907 continue
908908
909909 # expand the latents if we are doing classifier free guidance
910- latent_model_input = (
911- torch .cat ([latents ] * 2 )
912- if self .do_classifier_free_guidance and skip_guidance_layers is None
913- else latents
914- )
910+ latent_model_input = torch .cat ([latents ] * 2 ) if self .do_classifier_free_guidance else latents
915911 # broadcast to batch dimension in a way that's compatible with ONNX/Core ML
916912 timestep = t .expand (latent_model_input .shape [0 ])
917913
@@ -935,6 +931,8 @@ def __call__(
935931 else False
936932 )
937933 if skip_guidance_layers is not None and should_skip_layers :
934+ timestep = t .expand (latents .shape [0 ])
935+ latent_model_input = latents
938936 noise_pred_skip_layers = self .transformer (
939937 hidden_states = latent_model_input ,
940938 timestep = timestep ,
You can’t perform that action at this time.
0 commit comments