You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error(s) in loading state_dict for SanaMS: size mismatch for pos_embed: copying a param with shape torch.Size([1, 4096, 2240]) from checkpoint, the shape in current model is torch.Size([1, 1024, 2240])
#3
Open
Johnz86 opened this issue
Jan 8, 2025
· 2 comments
Exception Message: Error(s) in loading state_dict for SanaMS:
size mismatch for pos_embed: copying a param with shape torch.Size([1, 4096, 2240]) from checkpoint, the shape in current model is torch.Size([1, 1024, 2240]).
Stack Trace
File "D:\Programovanie\Python\stable-diffusion-web\ComfyUI\execution.py", line 327, 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 "D:\Programovanie\Python\stable-diffusion-web\ComfyUI\execution.py", line 202, 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 "D:\Programovanie\Python\stable-diffusion-web\ComfyUI\execution.py", line 174, in _map_node_over_list
process_inputs(input_dict, i)
File "D:\Programovanie\Python\stable-diffusion-web\ComfyUI\execution.py", line 163, in process_inputs
results.append(getattr(obj, func)(**inputs))
File "D:\Programovanie\Python\stable-diffusion-web\ComfyUI\custom_nodes\ComfyUI_ExtraModels\Sana\nodes.py", line 33, in load_checkpoint
model = load_sana(
File "D:\Programovanie\Python\stable-diffusion-web\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 "D:\Programovanie\Python\stable-diffusion-web\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(
Please make sure that workflow does not contain any sensitive information such as API keys or passwords.
{"last_node_id":176,"last_link_id":317,"nodes":[{"id":168,"type":"SanaTextEncode","pos":[200,460],"size":[340,90],"flags":{},"order":5,"mode":0,"inputs":[{"name":"GEMMA","type":"GEMMA","link":307}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[304],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"SanaTextEncode"},"widgets_values":["photo, depth of field"]},{"id":65,"type":"VAEDecode","pos":[1000,80],"size":[200,50],"flags":{},"order":8,"mode":0,"inputs":[{"name":"samples","type":"LATENT","link":292},{"name":"vae","type":"VAE","link":308}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[313],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"VAEDecode"},"widgets_values":[]},{"id":155,"type":"KSampler","pos":[600,30],"size":[300,480],"flags":{},"order":7,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":300},{"name":"positive","type":"CONDITIONING","link":305},{"name":"negative","type":"CONDITIONING","link":304},{"name":"latent_image","type":"LATENT","link":317,"slot_index":3}],"outputs":[{"name":"LATENT","type":"LATENT","links":[292],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"KSampler"},"widgets_values":[20,"fixed",20,4,"euler","normal",1]},{"id":66,"type":"SaveImage","pos":[1000,170],"size":[610,490],"flags":{},"order":9,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":313}],"outputs":[],"properties":{"Node name for S&R":"SaveImage"},"widgets_values":["ComfyUI_Sana"]},{"id":167,"type":"SanaTextEncode","pos":[200,290],"size":[340,130],"flags":{},"order":4,"mode":0,"inputs":[{"name":"GEMMA","type":"GEMMA","link":306,"slot_index":0}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[305],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"SanaTextEncode"},"widgets_values":["pixelart drawing of a tank with a blue camo pattern"]},{"id":176,"type":"EmptySanaLatentImage","pos":[237.799072265625,136.52313232421875],"size":[210,80],"flags":{},"order":6,"mode":0,"inputs":[{"name":"width","type":"INT","link":315,"widget":{"name":"width"}},{"name":"height","type":"INT","link":316,"widget":{"name":"height"}}],"outputs":[{"name":"LATENT","type":"LATENT","links":[317],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"EmptySanaLatentImage"},"widgets_values":[512,512,1]},{"id":169,"type":"GemmaLoader","pos":[-187.1352081298828,288.4422302246094],"size":[335.4521179199219,110.77887725830078],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"GEMMA","type":"GEMMA","links":[306,307],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"GemmaLoader"},"widgets_values":["Efficient-Large-Model/gemma-2-2b-it","cuda","BF16"]},{"id":165,"type":"SanaResolutionSelect","pos":[-177.9899444580078,133.77259826660156],"size":[280,102],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"width","type":"INT","links":[315],"slot_index":0,"shape":3},{"name":"height","type":"INT","links":[316],"slot_index":1,"shape":3}],"properties":{"Node name for S&R":"SanaResolutionSelect"},"widgets_values":["1024px","1.00"]},{"id":164,"type":"SanaCheckpointLoader","pos":[-185.7548065185547,-53.31159210205078],"size":[320,82],"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[{"name":"model","type":"MODEL","links":[300],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"SanaCheckpointLoader"},"widgets_values":["SANA\\Sana_1600M_2Kpx_BF16.pth","SanaMS_1600M_P1_D20"]},{"id":171,"type":"ExtraVAELoader","pos":[544.422607421875,578.8182373046875],"size":[422.05926513671875,106.10562133789062],"flags":{},"order":3,"mode":0,"inputs":[],"outputs":[{"name":"VAE","type":"VAE","links":[308],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"ExtraVAELoader"},"widgets_values":["mit-han-lab\\dc-ae-f32c32-sana-1.0-diffusers.safetensors","dcae-f32c32-sana-1.0","BF16"]}],"links":[[292,155,0,65,0,"LATENT"],[300,164,0,155,0,"MODEL"],[304,168,0,155,2,"CONDITIONING"],[305,167,0,155,1,"CONDITIONING"],[306,169,0,167,0,"GEMMA"],[307,169,0,168,0,"GEMMA"],[308,171,0,65,1,"VAE"],[313,65,0,66,0,"IMAGE"],[315,165,0,176,0,"INT"],[316,165,1,176,1,"INT"],[317,176,0,155,3,"LATENT"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.8769226950000905,"offset":[1077.7490957436844,230.60726550576078]},"ue_links":[]},"version":0.4}
Same error for me trying to use Sana 2K model in Comfyui. The Sana Checkpoint Loader Node is not showing "SanaMS_1600M_P1_D20_2K" in Model list, only the same options of 1600M_P1_D20 and 600M_P1_D28. Everything is up to date. Any help appreciated.
Same error for me trying to use Sana 2K model in Comfyui. The Sana Checkpoint Loader Node is not showing "SanaMS_1600M_P1_D20_2K" in Model list, only the same options of 1600M_P1_D20 and 600M_P1_D28. Everything is up to date. Any help appreciated.
ComfyUI Error Report
Error Details
size mismatch for pos_embed: copying a param with shape torch.Size([1, 4096, 2240]) from checkpoint, the shape in current model is torch.Size([1, 1024, 2240]).
Stack Trace
System Information
Devices
Logs
Attached Workflow
Please make sure that workflow does not contain any sensitive information such as API keys or passwords.
Additional Context
Used model checkpoint: https://huggingface.co/Efficient-Large-Model/Sana_1600M_2Kpx_BF16
Used text_encoders: https://huggingface.co/Efficient-Large-Model/gemma-2-2b-it
Used vae:https://huggingface.co/mit-han-lab/dc-ae-f32c32-sana-1.0-diffusers
The text was updated successfully, but these errors were encountered: