VAE Encode for Inpaint Error
Your question
I'm getting this issue when trying to regenerate a background for an image.
My workflow is currently Image gen > Latent from Batch > Inspyrenet Rembg > Invert Mask > VAE Encode for Inpainting. It fails at the inpainting node
PonyXL using t-ponynai3
Error occurred when executing VAEEncodeForInpaint:
Given groups=1, weight of size [128, 3, 3, 3], expected input[1, 4, 1216, 832] to have 3 channels, but got 4 channels instead
File "/home/ComfyUI/execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "/home/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/ComfyUI/execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "/home/ComfyUI/nodes.py", line 349, in encode t = vae.encode(pixels) File "/home/ComfyUI/comfy/sd.py", line 340, in encode samples[x:x+batch_number] = self.first_stage_model.encode(pixels_in).to(self.output_device).float() File "/home/ComfyUI/comfy/ldm/models/autoencoder.py", line 179, in encode z = self.encoder(x) File "/home/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/home/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(*args, **kwargs) File "/home/ComfyUI/comfy/ldm/modules/diffusionmodules/model.py", line 520, in forward h = self.conv_in(x) File "/home/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/home/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(*args, **kwargs) File "/home/ComfyUI/comfy/ops.py", line 80, in forward return super().forward(*args, **kwargs) File "/home/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 460, in forward return self._conv_forward(input, self.weight, self.bias) File "/home/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 456, in _conv_forward return F.conv2d(input, weight, bias, self.stride,
Logs
Error occurred when executing VAEEncodeForInpaint:
Given groups=1, weight of size [128, 3, 3, 3], expected input[1, 4, 1216, 832] to have 3 channels, but got 4 channels instead
File "/home/ComfyUI/execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "/home/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/ComfyUI/execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "/home/ComfyUI/nodes.py", line 349, in encode
t = vae.encode(pixels)
File "/home/ComfyUI/comfy/sd.py", line 340, in encode
samples[x:x+batch_number] = self.first_stage_model.encode(pixels_in).to(self.output_device).float()
File "/home/ComfyUI/comfy/ldm/models/autoencoder.py", line 179, in encode
z = self.encoder(x)
File "/home/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/home/ComfyUI/comfy/ldm/modules/diffusionmodules/model.py", line 520, in forward
h = self.conv_in(x)
File "/home/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/home/ComfyUI/comfy/ops.py", line 80, in forward
return super().forward(*args, **kwargs)
File "/home/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 460, in forward
return self._conv_forward(input, self.weight, self.bias)
File "/home/.local/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 456, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
Other
No response
Try without Inspyrenet Rembg node.
This issue is being marked stale because it has not had any activity for 30 days. Reply below within 7 days if your issue still isn't solved, and it will be left open. Otherwise, the issue will be closed automatically.