kohya-ss / kohya-ss/sd-scripts

usage of xformers in gen_img_diffusers.py

Open
#321 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7.2k
Forks
1.2k
Avg merge
11m
Merged PRs (30d)
2

Description

Hi, I appreciate the clever structure of the inference script!

I notice that you only change the forward method in CrossAttention but not in other AttentionBlock when uising the xformers, which is difference from the diffusers. [code](https://github.com/kohya-ss/sd-scripts/blob/main/gen_img_diffusers.py#L384). And it seems works better than diffusers too.

Why it works better? Thanks a lot!

Contributor guide

No contributing guide indexed for this repository

Research direction

Read gen_img_diffusers.py around line 384, then compare the CrossAttention forward path with the other AttentionBlock usage mentioned in the issue and the linked diffusers implementation. Reproduce or inspect the xformers paths to identify the behavioral difference; done means documenting a supported explanation of why the results differ, if one can be established.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.