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

Error(s) in loading state_dict for SanaMS: size mismatch for pos_embed: copying a param with shape torch.Size([1, 256, 1152]) from checkpoint, the shape in current model is torch.Size([1, 1024, 1152]). #123

Open
VeteranXT opened this issue Dec 31, 2024 · 5 comments
Labels
Answered Answered the question bug Something isn't working fixed fix a bug

Comments

@VeteranXT
Copy link

E:\Storage\Apps\AI_Geneartor\ComfyUI\venv\lib\site-packages\timm\models\layers\__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.layers", FutureWarning) !!! Exception during processing !!! Error(s) in loading state_dict for SanaMS: size mismatch for pos_embed: copying a param with shape torch.Size([1, 256, 1152]) from checkpoint, the shape in current model is torch.Size([1, 1024, 1152]). Traceback (most recent call last): File "E:\Storage\Apps\AI_Geneartor\ComfyUI\execution.py", line 323, in execute output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "E:\Storage\Apps\AI_Geneartor\ComfyUI\execution.py", line 198, in get_output_data return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "E:\Storage\Apps\AI_Geneartor\ComfyUI\execution.py", line 169, in _map_node_over_list process_inputs(input_dict, i) File "E:\Storage\Apps\AI_Geneartor\ComfyUI\execution.py", line 158, in process_inputs results.append(getattr(obj, func)(**inputs)) File "E:\Storage\Apps\AI_Geneartor\ComfyUI\custom_nodes\ComfyUI_ExtraModels\Sana\nodes.py", line 86, in load_checkpoint model = load_sana( File "E:\Storage\Apps\AI_Geneartor\ComfyUI\custom_nodes\ComfyUI_ExtraModels\Sana\loader.py", line 88, in load_sana m, u = model.diffusion_model.load_state_dict(state_dict, strict=False) File "E:\Storage\Apps\AI_Geneartor\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 2189, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for SanaMS: size mismatch for pos_embed: copying a param with shape torch.Size([1, 256, 1152]) from checkpoint, the shape in current model is torch.Size([1, 1024, 1152]).

image

Did i do something wrong?

@shaun-ba
Copy link

@VeteranXT I don't even know what repo the fix is being pushed to...

@VeteranXT
Copy link
Author

Last commit was 2-3 weeks old. Efficent/City96 repos.

@lawrence-cj
Copy link
Collaborator

lawrence-cj commented Jan 2, 2025

The 2K model and size mismatch problem is solved here: https://github.com/Efficient-Large-Model/ComfyUI_ExtraModels
@shaun-ba @VeteranXT

@lawrence-cj lawrence-cj added bug Something isn't working fixed fix a bug Answered Answered the question labels Jan 2, 2025
@VeteranXT
Copy link
Author

What about 512/1024 models or just 2k models are fixed?

@lawrence-cj
Copy link
Collaborator

all fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Answered Answered the question bug Something isn't working fixed fix a bug
Projects
None yet
Development

No branches or pull requests

3 participants