Repository: huggingface/diffusers
Issue category: Bug Report

Issue:
Some bugs in FLUX pipeline
### Describe the bug

1. missing self.theta in get_1d_rotary_pos_embed:
https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/embeddings.py#L961-L963
2. if prompt_embeds is None, pooled_prompt_embeds will never be computed:
https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/flux/pipeline_flux.py#L348-L363

### Reproduction

.

### Logs

_No response_

### System Info

.

### Who can help?

@yiyixuxu @sayakpaul @DN6 @asomoza


Hints:
`pooled_prompt_embeds` has to be passed when `prompt_embeds` is used so that's ok
https://github.com/huggingface/diffusers/blob/8421c1461bf4ab7801070d04d6ec1e6b28ee5b59/src/diffusers/pipelines/flux/pipeline_flux.py#L422-L425

Would you like to open a PR that passes `self.theta` to `get_1d_rotary_pos_embed`?

Patch:
diff --git a/src/diffusers/models/embeddings.py b/src/diffusers/models/embeddings.py
index 91451fa9aac2..8f8f1073da74 100644
--- a/src/diffusers/models/embeddings.py
+++ b/src/diffusers/models/embeddings.py
@@ -959,7 +959,12 @@ def forward(self, ids: torch.Tensor) -> torch.Tensor:
         freqs_dtype = torch.float32 if is_mps else torch.float64
         for i in range(n_axes):
             cos, sin = get_1d_rotary_pos_embed(
-                self.axes_dim[i], pos[:, i], repeat_interleave_real=True, use_real=True, freqs_dtype=freqs_dtype
+                self.axes_dim[i],
+                pos[:, i],
+                theta=self.theta,
+                repeat_interleave_real=True,
+                use_real=True,
+                freqs_dtype=freqs_dtype,
             )
             cos_out.append(cos)
             sin_out.append(sin)


Test patch: