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 occurred when executing KSampler using Preview mode "auto" or RGB #711

Closed
traugdor opened this issue May 25, 2024 · 8 comments
Closed

Comments

@traugdor
Copy link

!!! Exception during processing!!! Cannot handle this data type: (1, 1, 3), <f4
Traceback (most recent call last):
File "D:\Stable Diffusion\ComfyUI\venv\lib\site-packages\PIL\Image.py", line 3089, in fromarray
mode, rawmode = _fromarray_typemap[typekey]
KeyError: ((1, 1, 3), '<f4')

Traceback (most recent call last):
File "D:\Stable Diffusion\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "D:\Stable Diffusion\ComfyUI\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "D:\Stable Diffusion\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "D:\Stable Diffusion\ComfyUI\nodes.py", line 1344, in sample
return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
File "D:\Stable Diffusion\ComfyUI\nodes.py", line 1314, in common_ksampler
samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
File "D:\Stable Diffusion\ComfyUI\comfy\sample.py", line 37, in sample
samples = sampler.sample(noise, positive, negative, 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 "D:\Stable Diffusion\ComfyUI\comfy\samplers.py", line 761, 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 "D:\Stable Diffusion\ComfyUI\comfy\samplers.py", line 663, in sample
return cfg_guider.sample(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
File "D:\Stable Diffusion\ComfyUI\comfy\samplers.py", line 650, in sample
output = self.inner_sample(noise, latent_image, device, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
File "D:\Stable Diffusion\ComfyUI\comfy\samplers.py", line 629, in inner_sample
samples = sampler.sample(self, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
File "D:\Stable Diffusion\ComfyUI\comfy\samplers.py", line 534, in sample
samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **self.extra_options)
File "D:\Stable Diffusion\ComfyUI\venv\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "D:\Stable Diffusion\ComfyUI\comfy\k_diffusion\sampling.py", line 140, in sample_euler
callback({'x': x, 'i': i, 'sigma': sigmas[i], 'sigma_hat': sigma_hat, 'denoised': denoised})
File "D:\Stable Diffusion\ComfyUI\comfy\samplers.py", line 532, in
k_callback = lambda x: callback(x["i"], x["denoised"], x["x"], total_steps)
File "D:\Stable Diffusion\ComfyUI\latent_preview.py", line 94, in callback
preview_bytes = previewer.decode_latent_to_preview_image(preview_format, x0)
File "D:\Stable Diffusion\ComfyUI\latent_preview.py", line 19, in decode_latent_to_preview_image
preview_image = self.decode_latent_to_preview(x0)
File "D:\Stable Diffusion\ComfyUI\latent_preview.py", line 48, in decode_latent_to_preview
return Image.fromarray(latents_ubyte.numpy())
File "D:\Stable Diffusion\ComfyUI\venv\lib\site-packages\PIL\Image.py", line 3092, in fromarray
raise TypeError(msg) from e
TypeError: Cannot handle this data type: (1, 1, 3), <f4

@traugdor
Copy link
Author

This error occurs when only the ComfyUI-Manager is installed

@ltdrdata
Copy link
Owner

Make sure up to date. ComfyUI.
I have confirmed that the issue does not occur in my current updated environment.

@traugdor
Copy link
Author

I am using the latest version:

ComfyUI master* $ git status
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        AddPromptToImage.ps1
        comfyui.log
        comfyui.prev.log
        comfyui.prev2.log
        config.json
        pysssss-workflows/
        qmSmartNodesConfig.json
        run.bat
        run.ps1

nothing added to commit but untracked files present (use "git add" to track)

I also updated the ComfyUI-Manager as well and got the same issue.

TypeError: Cannot handle this data type: (1, 1, 3), <f4

Prompt executed in 11.89 seconds

Stopped server
(venv) ComfyUI master* $ cd .\custom_nodes\
(venv) custom_nodes master* $ cd .\ComfyUI-Manager\
(venv) ComfyUI-Manager main $ git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean
(venv) ComfyUI-Manager main $

I am using a Radeon 6600XT, I don't know if that makes any difference...

@ltdrdata
Copy link
Owner

Execute pip freeze.
What is displayed?

@ltdrdata
Copy link
Owner

You should check this issue thread.
comfyanonymous/ComfyUI#3539

@traugdor
Copy link
Author

Execute pip freeze. What is displayed?

Since you asked, but looking at that other thread I see it's no longer relevant, but do you still need this information?

@ltdrdata
Copy link
Owner

Execute pip freeze. What is displayed?

Since you asked, but looking at that other thread I see it's no longer relevant, but do you still need this information?

No, that's not necessary. You can just keep checking until a solution is posted in that thread.

@traugdor
Copy link
Author

A solution was posted, and I have a pending PR on the main ComfyUI repo for it.

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