When I generate an image with a long prompt in AuraFlowPipeline, it raises this error:
File "~/workspace/anaconda3/envs/diffusers/lib/python3.11/site-packages/diffusers/pipelines/aura_flow/pipeline_aura_flow.py", line 507, in __call__
) = self.encode_prompt(
^^^^^^^^^^^^^^^^^^^
File "~/workspace/anaconda3/envs/diffusers/lib/python3.11/site-packages/diffusers/pipelines/aura_flow/pipeline_aura_flow.py", line 267, in encode_prompt
if untruncated_ids.shape[-1] >= text_input_ids.shape[-1] and not torch.equal(
^^^^^^^^^^^^
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument other in method wrapper_CUDA__equal)
import torch
from diffusers import AuraFlowPipeline
pipeline = AuraFlowPipeline.from_pretrained("fal/AuraFlow", torch_dtype=torch.float16).to("cuda")
image = pipeline(
prompt="photo of a cat",
height=1024,
width=1024,
num_inference_steps=50,
generator=torch.Generator().manual_seed(666),
guidance_scale=3.5,
).images[0]
then it works.
Logs
File "~/workspace/anaconda3/envs/diffusers/lib/python3.11/site-packages/diffusers/pipelines/aura_flow/pipeline_aura_flow.py", line 507, in __call__
) = self.encode_prompt(
^^^^^^^^^^^^^^^^^^^
File "~/workspace/anaconda3/envs/diffusers/lib/python3.11/site-packages/diffusers/pipelines/aura_flow/pipeline_aura_flow.py", line 267, in encode_prompt
if untruncated_ids.shape[-1] >= text_input_ids.shape[-1] and not torch.equal(
^^^^^^^^^^^^
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument other in method wrapper_CUDA__equal)
Describe the bug
When I generate an image with a long prompt in
AuraFlowPipeline
, it raises this error:If the prompt is not that long, then it works.
Reproduction
If the prompt is short, like
then it works.
Logs
System Info
Who can help?
@yiyixuxu