Fix Image Dimensions
When ComfyUI hands you a grayscale tensor that should be RGB — Fix Image Dimensions
- image1
- image
Every now and then an image shows up in your graph with the wrong number of channels, and the node downstream just explodes. ComfyUI's convention is a 4D tensor - batch, height, width, and 3 color channels - but not every reader honors that. Export a mask from Houdini's COPs, feed in a grayscale frame, or let a sloppy loader produce an unbatched tensor, and you get a 3-channel problem with a 1-channel tensor. HouCuiFixImageFix (display name "Fix Image Dimensions") is the one-input, one-output referee that normalizes all that before it reaches anything fragile.
It's part of the Houdini ComfyUI Bridge pack, and it exists because the bridge's image path is the wild west: images coming over from Houdini's compositing context aren't guaranteed to arrive as a tidy RGB batch. Slap this node on the input side and downstream nodes stop caring what shape they were handed.
What it actually does
The code is a small shape router over a single image1 input (IMAGE type, image output):
- 4D, 3 channels - already a standard RGB batch, passed through untouched.
- 4D, 1 channel - grayscale batch; the single channel is repeated 3× to fake an RGB image.
- 3D (unbatched) - a channel dimension is appended and repeated to 3 channels.
- Anything else - raises a
ValueErrornaming the unexpected shape, so you know immediately that something upstream is genuinely broken rather than slightly mis-shaped.
Worth knowing: the repeat is a copy, not a conversion. A grayscale mask becomes three identical channels, which is exactly what you want if a downstream node insists on RGB but only cares about the first channel's content. If you needed a real color-space conversion you'd want a dedicated node - this one just makes the shape legal.
The honest caveat
The class docstring claims it "batches exactly 5 images together." It does not - it fixes channel counts, and there's no batching anywhere in the code. So either the docstring predates the behavior or the author left the comment as a monument. The 4D branches are solid. The 3D branch is the one to be suspicious of: it appends the new dimension at the end of the tensor rather than adding a batch dimension at the front, which is the ComfyUI convention. Feed it a genuinely unbatched RGB image and you may get back a shape that's legal but not what you think it is. In practice, most things that reach this node are 4D already, so the common cases work - but if you see a weird shape on the image output, the 3D path is the usual culprit.
Install and context
You get this node by installing the houdini-comfyui-bridge pack (CapybaraCrowporation/houdini-comfyui-bridge), the community project by Rafael Drelich Valentim and Anatolii Iudanov that brings ComfyUI into Houdini - not a SideFX project, GPL-3.0, open-sourced late 2025 and shown at SIGGRAPH Asia 2025.
cd ComfyUI/custom_nodes
git clone https://github.com/CapybaraCrowporation/houdini-comfyui-bridge
Restart ComfyUI after cloning (or grab it via ComfyUI Manager). No Python dependencies, no model files - the ComfyUI half of the pack is lightweight; the install weight lives in the Houdini plugin side, which needs Houdini 20.5.613+ or 21.0.465+, plus ComfyUI 0.3.33+.
When you'd actually reach for it
In a graph that never touches Houdini, this is mostly a defensive utility - you'd only add it when a specific loader hands you a bad shape and you're tired of debugging the node after it. In the bridge's world it's genuinely useful on the input side of any node that's picky about channel counts. It's a small, dumb, honest fixer: it makes the shape legal, nothing more, and knowing that's the whole job is exactly what you need to decide where to drop it.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image1 | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |