Skip to content

Incompatibility between FlashAttention and ERNIE Image #13801

@SamuelTallet

Description

@SamuelTallet

Hello,

When I enable FlashAttention backend on an ErnieImagePipeline, it crashes with following error:

ValueError: attn_mask is not supported for flash-attn 2.

But same Python code (see below) doesn't crash with ZImagePipeline and Flux2KleinPipeline.

Reproduction

pipeline.transformer.set_attention_backend("flash")

System Info

  • OS: Windows
  • Python: 3.13.11
  • Diffusers: 9c4e201
  • FlashAttention: 2.8.3+cu130torch2.10
  • SDNQ: 0.1.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions