Skip to content

[refactor] Flux single file implementation #11881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: attn-refactor
Choose a base branch
from

Conversation

a-r-r-o-w
Copy link
Member

@a-r-r-o-w a-r-r-o-w commented Jul 8, 2025

Question: should we remove all intermediate imports of norm/embed layers, implement within the file, and make the entire implementation truly single file?

The minimal flux inference code does not run yet. The code from upstream branch is not fully completed and type hints are done with classes that don't exist.

@a-r-r-o-w a-r-r-o-w requested a review from DN6 July 8, 2025 02:10
@@ -1244,31 +1244,21 @@ class FluxPosEmbed(nn.Module):
# modified from https://github.com/black-forest-labs/flux/blob/c00d7c60b085fce8058b9df845e036090873f2ce/src/flux/modules/layers.py#L11
def __init__(self, theta: int, axes_dim: List[int]):
super().__init__()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think here you can patch __new__ with the correct import and return the new object. Similar to

class FluxSingleAttnProcessor2_0:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants