This is a PR to add a new model architecture NewBie to ComfyUI. See git diff master…
- User
This is a PR to add a new model architecture NewBie to ComfyUI. See
git diff master newbiefor the diff. However, previously there was already some code to support NewBie, which is removed in this PR. Now analyze: What's the difference between Lumina and NewBie architectures? Do you think the old code should be removed? Can we minimize this PR by reusing the Lumina architecture and the existing ops such as linear and RMSNorm in ComfyUI, and follow all other ComfyUI conventions? Assistant
I will start by analyzing the changes introduced in the
newbiebranch compared tomasterand investigating the codebase to understand the NewBie and Lumina architectures.Assistant
I will list the files in
comfy/ldmto verify the directory structure, and then I will read the model files for both NewBie and Lumina to compare their architectures.Assistant
I will read the contents of
comfy/ldm/newbie/model.py,comfy/ldm/newbie/components.py, andcomfy/ldm/lumina/model.pyto compare the NewBie and Lumina architectures and identify any deleted code.Assistant
I will run a git diff command to compare the
comfy/ldm/lumina/model.pyfile between themasterandnewbiebranches to identify the deleted code and evaluate if it should be removed.Assistant
I will check
comfy/ops.pyor search forRMSNormin the codebase to determine ifcomponents.pyis necessary, and I will also inspectcomfy/model_base.pyto understand how the model is instantiated and what operations are passed.- User
You're running in PowerShell. Do not use bash commands.
Assistant
I will read
comfy/ops.pyto verify ifRMSNormis available and checkcomfy/ldm/lumina/model.pyagain to see how it uses operations.Assistant
Assistant
I will now update
comfy/ldm/lumina/model.pyto restoreclip_text_dimsupport and addclip_img_dimsupport, effectively merging the capabilities of NewBie back into the main Lumina model class.Assistant
The first replacement failed because it expected 2 occurrences but found 1. Wait, I see I used
expected_replacements:2in the first call, but theold_stringin the first call is quite large and specific to__init__. Why would I expect 2 replacements? Ah, probably a copy-paste error in my thought process or tool usage. I should have set it to 1. But looking at the tool response, it says "Failed to edit...". So the first replacement did NOT happen.The second replacement (which was separate tool call) succeeded.
I need to retry the first replacement with
expected_replacements:1.Wait, did I send two tool calls? Yes.
replace(init changes) -> Failed.replace(forward changes) -> Success.
So I need to re-apply the
__init__changes.I will retry the
__init__replacement withexpected_replacements:1.Assistant
Assistant
Now I can delete
comfy/ldm/newbie/components.pyas it is no longer used.Assistant
I have completed the refactoring:
- Modified
comfy/ldm/lumina/model.pyto includeclip_text_dimandclip_img_dimsupport, effectively mergingNewBie's requirements. - Refactored
comfy/ldm/newbie/model.pyto usecomfy.ldm.lumina.model.NextDiT. - Deleted
comfy/ldm/newbie/components.py.
I should verifying the changes. Since I don't have a specific test for NewBie, I will just check if
comfy/ldm/newbie/model.pyimports correctly and I can instantiate the model.I will write a small python script to verify instantiation.
- Modified
Assistant
I will run the verification script.
Assistant
The verification script passed. The model instantiates correctly and has the expected projections.
I'll check
comfy/model_base.py,comfy/model_detection.py, andcomfy/supported_models.pyto ensure everything is consistent. The original diff showed 88 insertions inmodel_base.py. I should check if those insertions were specific to NewBie implementation details that are now covered byLuminaor if they were generic model support things.If
model_base.pyhad a specificNewBieclass that duplicatedLuminalogic, maybe I should check it.Let's read
comfy/model_base.pyand search for "NewBie" or "Lumina".- User
Go on
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.