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

CLIP Text Encode (Advanced) errors as of new ComfyUI commit #12

Open
bazettfraga opened this issue Oct 28, 2023 · 13 comments
Open

CLIP Text Encode (Advanced) errors as of new ComfyUI commit #12

bazettfraga opened this issue Oct 28, 2023 · 13 comments

Comments

@bazettfraga
Copy link

Hi, as of ComfyUI commit comfyanonymous/ComfyUI@e60ca69 the node seems to throw out the following error down below, refusing to begin generating at all. Reverting to comfyanonymous/ComfyUI@6ec3f12 fixes this issue, leading me to believe that the changes in the tokenizer are responsible for this issue:

ERROR:root:Traceback (most recent call last):
  File "/mnt/2TBDa/SDSoftware/ComfyUI/execution.py", line 153, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/2TBDa/SDSoftware/ComfyUI/execution.py", line 83, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/2TBDa/SDSoftware/ComfyUI/execution.py", line 76, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/2TBDa/SDSoftware/ComfyUI/nodes.py", line 1237, in sample
    return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/2TBDa/SDSoftware/ComfyUI/nodes.py", line 1207, in common_ksampler
    samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/2TBDa/SDSoftware/ComfyUI/comfy/sample.py", line 100, in sample
    samples = sampler.sample(noise, positive_copy, negative_copy, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/2TBDa/SDSoftware/ComfyUI/comfy/samplers.py", line 728, in sample
    return sample(self.model, noise, positive, negative, cfg, self.device, sampler(), sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/2TBDa/SDSoftware/ComfyUI/comfy/samplers.py", line 633, in sample
    samples = sampler.sample(model_wrap, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/2TBDa/SDSoftware/ComfyUI/comfy/samplers.py", line 589, in sample
    samples = getattr(k_diffusion_sampling, "sample_{}".format(sampler_name))(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **extra_options)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/salt/.local/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/2TBDa/SDSoftware/ComfyUI/comfy/k_diffusion/sampling.py", line 580, in sample_dpmpp_2m
    denoised = model(x, sigmas[i] * s_in, **extra_args)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/salt/.local/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/salt/.local/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/2TBDa/SDSoftware/ComfyUI/comfy/samplers.py", line 287, in forward
    out = self.inner_model(x, sigma, cond=cond, uncond=uncond, cond_scale=cond_scale, model_options=model_options, seed=seed)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/salt/.local/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/salt/.local/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/2TBDa/SDSoftware/ComfyUI/comfy/k_diffusion/external.py", line 129, in forward
    eps = self.get_eps(input * c_in, self.sigma_to_t(sigma), **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/2TBDa/SDSoftware/ComfyUI/comfy/k_diffusion/external.py", line 155, in get_eps
    return self.inner_model.apply_model(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/2TBDa/SDSoftware/ComfyUI/comfy/samplers.py", line 275, in apply_model
    out = sampling_function(self.inner_model.apply_model, x, timestep, uncond, cond, cond_scale, model_options=model_options, seed=seed)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/2TBDa/SDSoftware/ComfyUI/comfy/samplers.py", line 253, in sampling_function
    cond, uncond = calc_cond_uncond_batch(model_function, cond, uncond, x, timestep, max_total_area, model_options)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/2TBDa/SDSoftware/ComfyUI/comfy/samplers.py", line 229, in calc_cond_uncond_batch
    output = model_function(input_x, timestep_, **c).chunk(batch_chunks)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/2TBDa/SDSoftware/ComfyUI/comfy/model_base.py", line 62, in apply_model
    context = context.to(dtype)
              ^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'to'

Thank you for your help in advance!

@HaydenReeve
Copy link

I'm finding a similar issue with the regular KSampler too.

Error occurred when executing KSampler:

'NoneType' object has no attribute 'to'

File "E:\AI\ComfyUI\execution.py", line 153, in recursive_execute

Reverted back to the native Text Encoder (New) and the workflow runs without issue.

@925-Studio
Copy link

925-Studio commented Oct 30, 2023

Same problem here. I'm using Efficiency custom nodes, I set positive and negative input from text and they work fine til the last update of ComfyUI.

Error occurred when executing KSampler (Efficient):

'NoneType' object has no attribute 'cpu'

File "/root/sd-comfyui/execution.py", line 153, in recursive_execute

Switch to regular text encode works no problem.

@Martillo9
Copy link

Same problems... first, I got some color noise corrupt images, then KSampler stop working and gave me those errors...
Please help, somebody save us!

@BlenderNeko
Copy link
Owner

should be fixed now

@liulsg
Copy link

liulsg commented Oct 30, 2023

should be fixed now

@BlenderNeko
I just tested it, and it's still wrong.

@BlenderNeko
Copy link
Owner

@liulsg I can't really do anything with that. Are these my nodes or someone else's? what are the current commit short hashes of both ComfyUI and ComfyUI_ADV_CLIP_emb? (you can check this by running git rev-parse --short HEAD in the respective folders), what is the error message that it throws?

@0xmihutao
Copy link

works for me now

@Martillo9
Copy link

Yeah, I updated it by running those 2 bat files in the update folder.
And now I was able to make a simple image, the Ksampler didn´t crash...

@momognu
Copy link

momognu commented Nov 14, 2023

list indices must be integers or slices, not str

@jhlchu
Copy link

jhlchu commented Nov 23, 2023

Latest ComfyUI gives this error:

Error occurred when executing BNK_CLIPTextEncodeAdvanced:

The expanded size of the tensor (308) must match the existing size (154) at non-singleton dimension 1. Target sizes: [1, 308, 768]. Tensor sizes: [1, 154, 1]

for comfy++ and A1111 option.

@momognu
Copy link

momognu commented Nov 25, 2023

update comfyui, be kill 99% of problems

@lizhuting9229
Copy link

I'm finding a similar issue with the regular KSampler too.

Error occurred when executing KSampler:

'NoneType' object has no attribute 'to'

File "E:\AI\ComfyUI\execution.py", line 153, in recursive_execute

Reverted back to the native Text Encoder (New) and the workflow runs without issue.

Hi, have you solved it? I met the same problem.

@cinos777
Copy link

cinos777 commented Mar 5, 2024

I'm finding a similar issue with the regular KSampler too.

Error occurred when executing KSampler:

'NoneType' object has no attribute 'to'

File "E:\AI\ComfyUI\execution.py", line 153, in recursive_execute

Reverted back to the native Text Encoder (New) and the workflow runs without issue.

Hello! Please tell me how to switch to this encoder in ComfyUI

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