Compare the implementation of Lumina NextDiT model in C:\ComfyUI and C:\diffusers .…
Private research annotation
Sign in to add a private research label or note.
- User
Compare the implementation of Lumina NextDiT model in C:\ComfyUI and C:\diffusers . Assuming Diffusers is the source of truth, is there any problem in ComfyUI's implementation?
Assistant
I will search for files related to "Lumina" in both
C:\diffusersandC:\ComfyUIto identify the relevant implementations for comparison.- User
You're running in PowerShell. Use PowerShell commands.
- User
You're running in PowerShell. Use PowerShell commands. You may use ripgrep at C:\ripgrep\rg.exe .
Assistant
I will search for files containing "Lumina" in their names in both
C:\diffusersandC:\ComfyUIusing PowerShell commands.Assistant
I will list the files in
C:\ComfyUI\comfy\ldm\luminato identify the specific model implementation files.Assistant
I will read the initial content of the Lumina NextDiT model files in both ComfyUI and Diffusers to understand their structure and imports.
Assistant
I will read the next segment of the Lumina NextDiT model files to inspect the
forwardmethods and block definitions, looking forLuminaNextDiTBlock.forwardin Diffusers and the corresponding block class in ComfyUI.Assistant
I will read the next segment of the ComfyUI Lumina model file to inspect the
JointTransformerBlockclass and itsforwardmethod.Assistant
I will read the later sections of the ComfyUI Lumina model file to examine the main
Luminamodel class and how it utilizes the transformer blocks.Assistant
I will read
C:\ComfyUI\comfy_extras\nodes_lumina2.pyto investigate its imports and determine if it utilizes thecomfy.ldm.luminamodule, which will help clarify the versioning of the Lumina implementation.Assistant
I will search for "Lumina" in
C:\ComfyUI\comfy\supported_models.pyto identify how the model is supported and instantiated.Assistant
I will read
C:\ComfyUI\comfy\model_base.pyto examine theLumina2class definition and check for any other Lumina-related classes.Assistant
I will search for the definition of the
Luminaclass inC:\ComfyUI\comfy\model_base.pyto check for a version 1 implementation.Assistant
I will search for all class definitions in
C:\ComfyUI\comfy\ldm\lumina\model.pyto better understand the available components and architecture.Assistant
I will read the
NextDiTclass definition inC:\ComfyUI\comfy\ldm\lumina\model.pyto understand its implementation and how it relates to theJointTransformerBlock.Assistant
I will read
C:\diffusers\src\diffusers\models\transformers\transformer_lumina2.pyto determine if its implementation matches ComfyUI's Lumina model, which appears to be version 2.0.Assistant
I will read
C:\diffusers\src\diffusers\models\transformers\lumina_nextdit2d.pyto confirm if theLuminaNextDiT2DModelincludes refiner layers, which helps distinguish between Lumina 1.0 and 2.0 architectures.Assistant
I will search for "Lumina" in
C:\ComfyUI\nodes.pyto ensure I haven't missed any other Lumina implementations or loaders that might reference a version 1 model.Assistant
Based on the comparison between
C:\diffusers\src\diffusers\models\transformers\lumina_nextdit2d.py(assuming this is the source of truth for Lumina NextDiT) andC:\ComfyUI\comfy\ldm\lumina\model.py, there is a significant architectural mismatch.ComfyUI appears to be implementing Lumina-Image 2.0 under the
NextDiTclass name, whereas Diffusers implements the original .- User
Is there any difference between the implementation of Lumina 2 in ComfyUI and Diffusers?
Assistant
I will read
C:\diffusers\src\diffusers\models\transformers\transformer_lumina2.pyandC:\ComfyUI\comfy\ldm\lumina\model.pyto perform a detailed comparison of the Lumina 2 implementations, focusing on class structures, attention mechanisms, and block definitions.Assistant
I will continue reading
C:\diffusers\src\diffusers\models\transformers\transformer_lumina2.pyto get a complete view of theLumina2Transformer2DModelclass, especially itsforwardmethod and how it handles inputs.Assistant
I will read the
forwardmethod of theNextDiTclass inC:\ComfyUI\comfy\ldm\lumina\model.pyto compare its structure and logic with the Diffusers implementation.Assistant
I will read
C:\ComfyUI\comfy\ldm\lumina\controlnet.pyto check for any ControlNet-specific implementations that might reveal further differences or features present in ComfyUI but absent in the DiffusersLumina2model.Assistant
- User
Is
axes_lensused in the RoPE in Lumina 2 in ComfyUI and Diffusers? Assistant
I will read
C:\ComfyUI\comfy\ldm\flux\layers.pyto inspect theEmbedNDclass and determine if it accepts or utilizes anaxes_lensparameter.Assistant
I will search for usage of
axes_lensinC:\ComfyUI\comfy\ldm\lumina\model.pyto determine if it's utilized anywhere in the code.Assistant
I will now examine the
C:\diffusers\src\diffusers\models\transformers\transformer_lumina2.pyfile again, focusing on theLumina2RotaryPosEmbedclass and its_precompute_freqs_cismethod to see howaxes_lensis used there.Assistant
I need to scroll up in the previous file to see
_precompute_freqs_cis.Assistant
I've confirmed that Diffusers'
Lumina2RotaryPosEmbedusesaxes_lensto precompute frequencies:pythondef _precompute_freqs_cis(self, axes_dim: List[int], axes_lens: List[int], theta: int) -> List[torch.Tensor]: freqs_cis = [] freqs_dtype = torch.float32 if torch.backends.mps.is_available() else torch.float64 for i, (d, e) in enumerate(zip(axes_dim, axes_lens)): emb = get_1d_rotary_pos_embed(d, e, theta=self.theta, freqs_dtype=freqs_dtype) freqs_cis.append(emb) return freqs_cis
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.