In order to make it easier to use the ComfyUI, I have made some optimizations and integrations to some commonly used nodes.
GNU General Public License v3.0
1.06k
stars
72
forks
source link
Error while processing rearrange-reduction pattern "b c (h ph) (w pw) -> b (h w) (c ph pw)". Input tensor shape: torch.Size([1, 16, 96, 173]). Additional info: {'ph': 2, 'pw': 2}. Shape mismatch, can't divide axis of length 173 in chunks of 2 #527
Open
zcfire2017 opened 4 days ago
2024-11-09T15:29:16.556187 - !!! Exception during processing !!! Error while processing rearrange-reduction pattern "b c (h ph) (w pw) -> b (h w) (c ph pw)". Input tensor shape: torch.Size([1, 16, 96, 173]). Additional info: {'ph': 2, 'pw': 2}. Shape mismatch, can't divide axis of length 173 in chunks of 2 2024-11-09T15:29:16.561187 - Traceback (most recent call last): File "E:\study\sd\new\python_miniconda_env\ComfyUI\Lib\site-packages\einops\einops.py", line 523, in reduce return _apply_recipe( ^^^^^^^^^^^^^^ File "E:\study\sd\new\python_miniconda_env\ComfyUI\Lib\site-packages\einops\einops.py", line 234, in _apply_recipe init_shapes, axes_reordering, reduced_axes, added_axes, final_shapes, n_axes_w_added = _reconstruct_from_shape( ^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\python_miniconda_env\ComfyUI\Lib\site-packages\einops\einops.py", line 187, in _reconstruct_from_shape_uncached raise EinopsError(f"Shape mismatch, can't divide axis of length {length} in chunks of {known_product}") einops.EinopsError: Shape mismatch, can't divide axis of length 173 in chunks of 2
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "E:\study\sd\new\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:\study\sd\new\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:\study\sd\new\ComfyUI\execution.py", line 169, in _map_node_over_list process_inputs(input_dict, i) File "E:\study\sd\new\ComfyUI\execution.py", line 158, in process_inputs results.append(getattr(obj, func)(inputs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\ComfyUI\custom_nodes\ComfyUI-Easy-Use\py\easyNodes.py", line 5538, in simple return super().run(pipe, None, None, None, None, None, image_output, link_id, save_prefix, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\ComfyUI\custom_nodes\ComfyUI-Easy-Use\py\easyNodes.py", line 5507, in run return process_sample_state(pipe, samp_model, samp_clip, samp_samples, samp_vae, samp_seed, samp_positive, samp_negative, steps, start_step, last_step, cfg, sampler_name, scheduler, denoise, image_output, link_id, save_prefix, tile_size, prompt, extra_pnginfo, my_unique_id, preview_latent, force_full_denoise, disable_noise, samp_custom, noise_device) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\ComfyUI\custom_nodes\ComfyUI-Easy-Use\py\easyNodes.py", line 5259, in process_sample_state samp_samples, samp_blend_samples = sampler.custom_advanced_ksampler(noise, _guider, _sampler, sigmas, samp_samples, preview_latent=preview_latent) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\ComfyUI\custom_nodes\ComfyUI-Easy-Use\py\libs\sampler.py", line 317, in custom_advanced_ksampler samples = guider.sample(noise.generate_noise(latent), latent_image, sampler, sigmas, denoise_mask=noise_mask, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\ComfyUI\comfy\samplers.py", line 740, in sample output = self.inner_sample(noise, latent_image, device, sampler, sigmas, denoise_mask, callback, disable_pbar, seed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\ComfyUI\comfy\samplers.py", line 719, in inner_sample samples = sampler.sample(self, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\ComfyUI\comfy\samplers.py", line 624, in sample samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, self.extra_options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\python_miniconda_env\ComfyUI\Lib\site-packages\torch\utils_contextlib.py", line 116, in decorate_context return func(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\ComfyUI\comfy\k_diffusion\sampling.py", line 155, in sample_euler denoised = model(x, sigma_hat * s_in, *extra_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\ComfyUI\comfy\samplers.py", line 299, in call out = self.inner_model(x, sigma, model_options=model_options, seed=seed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\ComfyUI\comfy\samplers.py", line 706, in call return self.predict_noise(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\ComfyUI\comfy\samplers.py", line 709, in predict_noise return sampling_function(self.inner_model, x, timestep, self.conds.get("negative", None), self.conds.get("positive", None), self.cfg, model_options=model_options, seed=seed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\ComfyUI\comfy\samplers.py", line 279, in sampling_function out = calc_cond_batch(model, conds, x, timestep, model_options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\ComfyUI\comfy\samplers.py", line 202, in calc_cond_batch c['control'] = control.get_control(inputx, timestep, c, len(cond_or_uncond)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\ComfyUI\comfy\controlnet.py", line 255, in get_control control = self.control_model(x=x_noisy.to(dtype), hint=self.cond_hint, timesteps=timestep.to(dtype), context=context.to(dtype), extra) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\python_miniconda_env\ComfyUI\Lib\site-packages\torch\nn\modules\module.py", line 1736, in _wrapped_call_impl return self._call_impl(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\python_miniconda_env\ComfyUI\Lib\site-packages\torch\nn\modules\module.py", line 1747, in _call_impl return forward_call(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\ComfyUI\comfy\ldm\flux\controlnet.py", line 190, in forward hint = rearrange(hint, "b c (h ph) (w pw) -> b (h w) (c ph pw)", ph=patch_size, pw=patch_size) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\python_miniconda_env\ComfyUI\Lib\site-packages\einops\einops.py", line 591, in rearrange return reduce(tensor, pattern, reduction="rearrange", **axes_lengths) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\study\sd\new\python_miniconda_env\ComfyUI\Lib\site-packages\einops\einops.py", line 533, in reduce raise EinopsError(message + "\n {}".format(e)) einops.EinopsError: Error while processing rearrange-reduction pattern "b c (h ph) (w pw) -> b (h w) (c ph pw)". Input tensor shape: torch.Size([1, 16, 96, 173]). Additional info: {'ph': 2, 'pw': 2}. Shape mismatch, can't divide axis of length 173 in chunks of 2
2024-11-09T15:29:16.563187 - Prompt executed in 21.85 seconds
Attached Workflow
Please make sure that workflow does not contain any sensitive information such as API keys or passwords.