Skip to content
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

Pixart sigma model loading errors after update comfyui #79

Open
dalcefo opened this issue Aug 4, 2024 · 14 comments
Open

Pixart sigma model loading errors after update comfyui #79

dalcefo opened this issue Aug 4, 2024 · 14 comments

Comments

@dalcefo
Copy link

dalcefo commented Aug 4, 2024

There were no problem before, but i had update comfyui and ExtraModels node, then i got erroor like this.
Did I do something wrong? Or is there a problem with the extramodel code?

Error occurred when executing PixArtCheckpointLoader:

'EXM_PixArt_Model' object has no attribute 'diffusion_model'

File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_ExtraModels\PixArt\nodes.py", line 29, in load_checkpoint
model = load_pixart(
^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_ExtraModels\PixArt\loader.py", line 78, in load_pixart
model = EXM_PixArt_Model( # same as comfy.model_base.BaseModel
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_ExtraModels\PixArt\loader.py", line 30, in init
super().init(*args, **kwargs)
File "C:\ComfyUI_windows_portable\ComfyUI\comfy\model_base.py", line 97, in init
logging.info("model weight dtype {}, manual cast: {}".format(self.get_dtype(), self.manual_cast_dtype))
^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\ComfyUI\comfy\model_base.py", line 127, in get_dtype
return self.diffusion_model.dtype
^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1729, in getattr
raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")

@city96
Copy link
Owner

city96 commented Aug 4, 2024

Update ComfyUI itself, it should be fixed now.

@Creepybits
Copy link

I just had the same issue as the OP. Updated Comfy and the problem is still there. There's just no way to use Pixart, no matter what I try.

@city96
Copy link
Owner

city96 commented Aug 5, 2024

@Creepybits Did you do a fresh git pull?

@Creepybits
Copy link

I updated through manager. From which folder should I do git pull? I'm not very familiar with that.

@Creepybits
Copy link

@Creepybits Did you do a fresh git pull?

Nevermind, figured it out. I have done a git pull and it says everything is already up to date. The full error message I'm getting is this:

!!! Exception during processing!!! 'EXM_PixArt_Model' object has no attribute 'diffusion_model' Traceback (most recent call last): File "C:\AI Stuff\ComfyUI\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\AI Stuff\ComfyUI\ComfyUI\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\AI Stuff\ComfyUI\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\AI Stuff\ComfyUI\ComfyUI\custom_nodes\ComfyUI_ExtraModels\PixArt\nodes.py", line 29, in load_checkpoint model = load_pixart( ^^^^^^^^^^^^ File "C:\AI Stuff\ComfyUI\ComfyUI\custom_nodes\ComfyUI_ExtraModels\PixArt\loader.py", line 78, in load_pixart model = EXM_PixArt_Model( # same as comfy.model_base.BaseModel ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\AI Stuff\ComfyUI\ComfyUI\custom_nodes\ComfyUI_ExtraModels\PixArt\loader.py", line 30, in __init__ super().__init__(*args, **kwargs) File "C:\AI Stuff\ComfyUI\ComfyUI\comfy\model_base.py", line 97, in __init__ logging.info("model weight dtype {}, manual cast: {}".format(self.get_dtype(), self.manual_cast_dtype)) ^^^^^^^^^^^^^^^^ File "C:\AI Stuff\ComfyUI\ComfyUI\comfy\model_base.py", line 127, in get_dtype return self.diffusion_model.dtype ^^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\Lib\site-packages\torch\nn\modules\module.py", line 1729, in __getattr__ raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'") AttributeError: 'EXM_PixArt_Model' object has no attribute 'diffusion_model'

@city96
Copy link
Owner

city96 commented Aug 5, 2024

From your error:

File "C:\AI Stuff\ComfyUI\ComfyUI\comfy\model_base.py", line 97, in __init__ logging.info("model weight dtype {}, manual cast: {}".format(self.get_dtype(), self.manual_cast_dtype)) 

On the latest ComfyUI that line is completely different i.e. it shouldn't produce the error anymore. It was removed yesterday in this commit: comfyanonymous/ComfyUI@0a6b008

For some reason your local ComfyUI install isn't actually being updated.

@Creepybits
Copy link

From your error:

File "C:\AI Stuff\ComfyUI\ComfyUI\comfy\model_base.py", line 97, in __init__ logging.info("model weight dtype {}, manual cast: {}".format(self.get_dtype(), self.manual_cast_dtype)) 

On the latest ComfyUI that line is completely different i.e. it shouldn't produce the error anymore. It was removed yesterday in this commit: comfyanonymous/ComfyUI@0a6b008

For some reason your local ComfyUI install isn't actually being updated.

Weird. Thanks though, All try to figure out why it doesn't update correctly then.

@city96
Copy link
Owner

city96 commented Aug 5, 2024

Yeah, not sure what could cause that. What do you get when you run git status in the main ComfyUI folder (I assume C:\AI Stuff\ComfyUI\ComfyUI\)

Edit: also try update_comfyui.bat if you're on the standalone, assuming that's still a thing lol

@Creepybits
Copy link

Creepybits commented Aug 6, 2024

Yeah, not sure what could cause that. What do you get when you run git status in the main ComfyUI folder (I assume C:\AI Stuff\ComfyUI\ComfyUI\)

Edit: also try update_comfyui.bat if you're on the standalone, assuming that's still a thing lol

I've just reinstalled comfy, and I get this from Git status

` PS C:\AI Stuff\ComfyUI\ComfyUI> git status
fatal: detected dubious ownership in repository at 'C:/AI Stuff/ComfyUI/ComfyUI'
'C:/AI Stuff/ComfyUI/ComfyUI' is owned by:
BUILTIN/Administrat�rer (S-1-5-32-544)
but the current user is:
CREEPYBITS/zanno (S-1-5-21-1515907332-654993848-3974-1003)
To add an exception for this directory, call:

    git config --global --add safe.directory 'C:/AI Stuff/ComfyUI/ComfyUI'

PS C:\AI Stuff\ComfyUI\ComfyUI> `

It seems to be working so far at least.

@pallavnawani
Copy link

Hello, the PixArt checkpoint loader node is failing in ComfyUI with the following text:

Error occurred when executing PixArtCheckpointLoader:

ModelPatcher.__init__() got an unexpected keyword argument 'current_device'

  File "D:\Diffusion_Auto_F111\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "D:\Diffusion_Auto_F111\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 82, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "D:\Diffusion_Auto_F111\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "D:\Diffusion_Auto_F111\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_ExtraModels\PixArt\nodes.py", line 29, in load_checkpoint
    model = load_pixart(
  File "D:\Diffusion_Auto_F111\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_ExtraModels\PixArt\loader.py", line 114, in load_pixart
    model_patcher = comfy.model_patcher.ModelPatcher(
Queue size: 0
Extra options

Any suggestions on what could be going wrong? (ComfyUI is already updated)
Is it because I am trying to load the wrong model?

@city96
Copy link
Owner

city96 commented Aug 20, 2024

@pallavnawani It looks like your ExtraModels repo isn't on the latest version. That line no longer has the current_device option there

@doogyhatts
Copy link

doogyhatts commented Oct 24, 2024

After updating ComfyUI for SD35L, it appears that the t5_attention_mask attribute cannot be accessed in SD3ClipModel.
So the PixArt T5 from SD3 Clip, which outputs T5, cannot be used to input into the CLIP Text Encode, which previously worked.
I am using the T5xxl gguf text-encoder model.

This is the error.
'SD3ClipModel' object has no attribute 't5_attention_mask'

I checked the SD3ClipModel code for the versions v0.2.3 and v0.2.4.
The version for v0.2.4 has the t5_attention_mask attribute, which it was assigned during the object's initialisation, while the v0.2.3 does not have.

I will use an older version of ComfyUI instead separately.

@city96
Copy link
Owner

city96 commented Oct 24, 2024

@doogyhatts should be good on both versions now, do a git pull on the extra models repo.

@doogyhatts
Copy link

doogyhatts commented Nov 20, 2024

Ok I found out what the error was now, after checking the latest sd.py.
It used "if clip_type == CLIPType.SD3:" as the conditional.
So I had to select 'sd3' as the type in the gguf clip loader, then it works again.

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

No branches or pull requests

5 participants