Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Can't use Conditioning (Combine) when latent batch 1 #31

Open
h3clikejava opened this issue Sep 21, 2023 · 2 comments
Open

Can't use Conditioning (Combine) when latent batch 1 #31

h3clikejava opened this issue Sep 21, 2023 · 2 comments

Comments

@h3clikejava
Copy link

It's fine when latent batch more then 1,
It's fine when only one CLIPTextEncode.

But when i use two CLIPTextEncode combine pass Conditioning will crash:

Error occurred when executing KSampler:

shape '[3, -1, 8, 40]' is invalid for input of size 2560

File "/home/h3c/Documents/ComfyUI/execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "/home/h3c/Documents/ComfyUI/execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "/home/h3c/Documents/ComfyUI/execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "/home/h3c/Documents/ComfyUI/nodes.py", line 1236, in sample
return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
File "/home/h3c/Documents/ComfyUI/nodes.py", line 1206, in common_ksampler
samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
File "/home/h3c/Documents/ComfyUI/custom_nodes/ComfyUI-Impact-Pack/modules/impact/hacky.py", line 22, in informative_sample
raise e
File "/home/h3c/Documents/ComfyUI/custom_nodes/ComfyUI-Impact-Pack/modules/impact/hacky.py", line 9, in informative_sample
return original_sample(*args, **kwargs)
File "/home/h3c/Documents/ComfyUI/comfy/sample.py", line 93, 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 "/home/h3c/Documents/ComfyUI/comfy/samplers.py", line 742, in sample
samples = getattr(k_diffusion_sampling, "sample_{}".format(self.sampler))(self.model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar)
File "/home/h3c/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/home/h3c/Documents/ComfyUI/comfy/k_diffusion/sampling.py", line 580, in sample_dpmpp_2m
denoised = model(x, sigmas[i] * s_in, **extra_args)
File "/home/h3c/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/h3c/Documents/ComfyUI/comfy/samplers.py", line 323, in forward
out = self.inner_model(x, sigma, cond=cond, uncond=uncond, cond_scale=cond_scale, cond_concat=cond_concat, model_options=model_options, seed=seed)
File "/home/h3c/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in call_impl
return forward_call(*args, **kwargs)
File "/home/h3c/Documents/ComfyUI/comfy/k_diffusion/external.py", line 125, in forward
eps = self.get_eps(input * c_in, self.sigma_to_t(sigma), **kwargs)
File "/home/h3c/Documents/ComfyUI/comfy/k_diffusion/external.py", line 151, in get_eps
return self.inner_model.apply_model(*args, **kwargs)
File "/home/h3c/Documents/ComfyUI/comfy/samplers.py", line 311, in apply_model
out = sampling_function(self.inner_model.apply_model, x, timestep, uncond, cond, cond_scale, cond_concat, model_options=model_options, seed=seed)
File "/home/h3c/Documents/ComfyUI/comfy/samplers.py", line 289, in sampling_function
cond, uncond = calc_cond_uncond_batch(model_function, cond, uncond, x, timestep, max_total_area, cond_concat, model_options)
File "/home/h3c/Documents/ComfyUI/comfy/samplers.py", line 265, in calc_cond_uncond_batch
output = model_function(input_x, timestep
, **c).chunk(batch_chunks)
File "/home/h3c/Documents/ComfyUI/comfy/model_base.py", line 63, in apply_model
return self.diffusion_model(xc, t, context=context, y=c_adm, control=control, transformer_options=transformer_options).float()
File "/home/h3c/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/h3c/Documents/ComfyUI/comfy/ldm/modules/diffusionmodules/openaimodel.py", line 626, in forward
h = forward_timestep_embed(module, h, emb, context, transformer_options)
File "/home/h3c/Documents/ComfyUI/comfy/ldm/modules/diffusionmodules/openaimodel.py", line 56, in forward_timestep_embed
x = layer(x, context, transformer_options)
File "/home/h3c/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/h3c/Documents/ComfyUI/comfy/ldm/modules/attention.py", line 693, in forward
x = block(x, context=context[i], transformer_options=transformer_options)
File "/home/h3c/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/h3c/Documents/ComfyUI/comfy/ldm/modules/attention.py", line 525, in forward
return checkpoint(self._forward, (x, context, transformer_options), self.parameters(), self.checkpoint)
File "/home/h3c/Documents/ComfyUI/comfy/ldm/modules/diffusionmodules/util.py", line 123, in checkpoint
return func(*inputs)
File "/home/h3c/Documents/ComfyUI/comfy/ldm/modules/attention.py", line 622, in _forward
n = attn2_replace_patch[block_attn2](n, context_attn2, value_attn2, extra_options)
File "/home/h3c/Documents/ComfyUI/custom_nodes/IPAdapter-ComfyUI/ip_adapter.py", line 287, in call
ip_out = attention(q, ip_k, ip_v, extra_options)
File "/home/h3c/Documents/ComfyUI/custom_nodes/IPAdapter-ComfyUI/ip_adapter.py", line 42, in attention
q, k, v = map(
File "/home/h3c/Documents/ComfyUI/custom_nodes/IPAdapter-ComfyUI/ip_adapter.py", line 43, in
lambda t: t.view(b, -1, extra_options["n_heads"], extra_options["dim_head"]).transpose(1, 2),

image

@laksjdjf
Copy link
Owner

maybe fixed it.

@h3clikejava
Copy link
Author

maybe fixed it.

In the latest version it still doesn't work

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants