Skip to content

Commit

Permalink
Fix Flux CLIP prompt embeds repeat for num_images_per_prompt > 1 (#9280)
Browse files Browse the repository at this point in the history
update
  • Loading branch information
DN6 authored and asomoza committed Aug 30, 2024
1 parent cc1e589 commit 0659784
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/diffusers/pipelines/flux/pipeline_flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def _get_clip_prompt_embeds(
prompt_embeds = prompt_embeds.to(dtype=self.text_encoder.dtype, device=device)

# duplicate text embeddings for each generation per prompt, using mps friendly method
prompt_embeds = prompt_embeds.repeat(1, num_images_per_prompt, 1)
prompt_embeds = prompt_embeds.repeat(1, num_images_per_prompt)
prompt_embeds = prompt_embeds.view(batch_size * num_images_per_prompt, -1)

return prompt_embeds
Expand Down

0 comments on commit 0659784

Please sign in to comment.