Skip to content

Fix --use-flash-attention ignored when xformers installed.#14083

Merged
comfyanonymous merged 1 commit into
masterfrom
comfyanonymous-patch-1
May 24, 2026
Merged

Fix --use-flash-attention ignored when xformers installed.#14083
comfyanonymous merged 1 commit into
masterfrom
comfyanonymous-patch-1

Conversation

@comfyanonymous

Copy link
Copy Markdown
Member

No description provided.

@coderabbitai

coderabbitai Bot commented May 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a7411185-c757-40ff-b4da-a73d24d7759a

📥 Commits

Reviewing files that changed from the base of the PR and between 0af1230 and 62396b5.

📒 Files selected for processing (1)
  • comfy/ldm/modules/attention.py

📝 Walkthrough

Walkthrough

This PR reorders the conditional logic in the optimized_attention function within the attention module. The change modifies the backend selection sequence to prioritize Flash Attention over xFormers when both backends are available and enabled. Previously, xFormers was evaluated first in the conditional chain; now Flash Attention is checked first, altering which backend is selected when both conditions are true.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No description was provided by the author, making it impossible to assess whether any description relates to the changeset. Add a pull request description explaining the issue being fixed, the solution, and any testing performed.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: reordering backend selection logic to prioritize Flash Attention over xFormers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant