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

TypeError: exceptions must derive from BaseException 加载有些模型如anythingxl 和majicmix都出现报错 #120

Open
solihe opened this issue Dec 4, 2024 · 1 comment

Comments

@solihe
Copy link

solihe commented Dec 4, 2024

Prompt executed in 1.01 seconds
got prompt
Process using 2 roles,mode is txt2img....
total_vram is 16379.5,aggressive_offload is True,offload is True
start story-diffusion mode processing...
Loading pipeline components...: 0%| | 0/7 [00:00<?, ?it/s]Some weights of the model checkpoint were not used when initializing CLIPTextModel:
['text_model.embeddings.position_ids']
Loading pipeline components...: 29%|██████████████▊ | 2/7 [00:00<00:00, 9.91it/s]
Loading pipeline components...: 0%| | 0/7 [00:00<?, ?it/s]Some weights of the model checkpoint were not used when initializing CLIPTextModel:
['text_model.embeddings.position_ids']
Loading pipeline components...: 29%|██████████████▊ | 2/7 [00:00<00:00, 9.72it/s]
!!! Exception during processing !!! exceptions must derive from BaseException
Traceback (most recent call last):
File "D:\AI\ComfyUI02\ComfyUI\custom_nodes\ComfyUI_StoryDiffusion\utils\load_models_utils.py", line 47, in load_models
pipe = StableDiffusionXLPipeline.from_single_file(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\AI\ComfyUI02\venv\Lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "D:\AI\ComfyUI02\venv\Lib\site-packages\diffusers\loaders\single_file.py", line 495, in from_single_file
loaded_sub_model = load_single_file_sub_model(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\AI\ComfyUI02\venv\Lib\site-packages\diffusers\loaders\single_file.py", line 113, in load_single_file_sub_model
loaded_sub_model = create_diffusers_clip_model_from_ldm(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\AI\ComfyUI02\venv\Lib\site-packages\diffusers\loaders\single_file_utils.py", line 1471, in create_diffusers_clip_model_from_ldm
unexpected_keys = load_model_dict_into_meta(model, diffusers_format_checkpoint, dtype=torch_dtype)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\AI\ComfyUI02\venv\Lib\site-packages\diffusers\models\model_loading_utils.py", line 223, in load_model_dict_into_meta
raise ValueError(
ValueError: Cannot load because text_model.embeddings.position_embedding.weight expected shape tensor(..., device='meta', size=(77, 1280)), but got torch.Size([77, 768]). If you want to instead overwrite randomly initialized weights, please make sure to pass both low_cpu_mem_usage=False and ignore_mismatched_sizes=True. For more information, see also: huggingface/diffusers#1619 (comment) as an example.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\AI\ComfyUI02\ComfyUI\custom_nodes\ComfyUI_StoryDiffusion\utils\load_models_utils.py", line 51, in load_models
pipe = StableDiffusionXLPipeline.from_single_file(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\AI\ComfyUI02\venv\Lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "D:\AI\ComfyUI02\venv\Lib\site-packages\diffusers\loaders\single_file.py", line 495, in from_single_file
loaded_sub_model = load_single_file_sub_model(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\AI\ComfyUI02\venv\Lib\site-packages\diffusers\loaders\single_file.py", line 113, in load_single_file_sub_model
loaded_sub_model = create_diffusers_clip_model_from_ldm(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\AI\ComfyUI02\venv\Lib\site-packages\diffusers\loaders\single_file_utils.py", line 1471, in create_diffusers_clip_model_from_ldm
unexpected_keys = load_model_dict_into_meta(model, diffusers_format_checkpoint, dtype=torch_dtype)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\AI\ComfyUI02\venv\Lib\site-packages\diffusers\models\model_loading_utils.py", line 223, in load_model_dict_into_meta
raise ValueError(
ValueError: Cannot load because text_model.embeddings.position_embedding.weight expected shape tensor(..., device='meta', size=(77, 1280)), but got torch.Size([77, 768]). If you want to instead overwrite randomly initialized weights, please make sure to pass both low_cpu_mem_usage=False and ignore_mismatched_sizes=True. For more information, see also: huggingface/diffusers#1619 (comment) as an example.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\AI\ComfyUI02\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 "D:\AI\ComfyUI02\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 "D:\AI\ComfyUI02\ComfyUI\execution.py", line 169, in _map_node_over_list
process_inputs(input_dict, i)
File "D:\AI\ComfyUI02\ComfyUI\execution.py", line 158, in process_inputs
results.append(getattr(obj, func)(**inputs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\AI\ComfyUI02\ComfyUI\custom_nodes\ComfyUI_StoryDiffusion\Storydiffusion_node.py", line 1506, in story_model_loader
pipe = load_models(ckpt_path, model_type=model_type, single_files=True, use_safetensors=True,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\AI\ComfyUI02\ComfyUI\custom_nodes\ComfyUI_StoryDiffusion\utils\load_models_utils.py", line 56, in load_models
raise "load pipe error"
TypeError: exceptions must derive from BaseException

Prompt executed in 0.53 seconds

@smthemex
Copy link
Owner

smthemex commented Dec 4, 2024

因为这些模型不包含clip或者vae,如果不行就换一个

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

2 participants