ComfyUI Node

FlipImage

Mirror a batch of frames — one axis, both directions, no widget

By morino-kumasan·Created 2 years ago·Updated a day ago· 1
FlipImage
  • images
  • IMAGE

FlipImage flips every frame in an IMAGE batch along a single axis. No dropdown, no toggle, no mask - you put it in the chain and it flips. I'd call it the most opinionated node in this pack, and the argument for it is that a mirror is usually a thing you want applied to everything passing through a wire: the conditioning image, the decoded video, the whole batch, all at once.

The author's own i2v.sample.json wires two of them: one on the LoadImage output feeding the video model, one on the VAEDecode output coming back out. Flip in, flip out.

How it works

def flip(self, images: Any) -> tuple[Any]:
    return (torch.flip(images, [1]),)

One torch.flip on axis 1. ComfyUI image tensors are shaped (batch, height, width, channels), so axis 1 is the height axis - meaning this is a top-to-bottom flip, the image turned upside down, not the left-right mirror most people mean by "flip." (Axis 2 would be the horizontal one, and the pack doesn't offer it.)

Test it once with a picture of text or a face before you build a workflow that assumes a mirror, then you'll know what you've got. Because it operates on the tensor it works identically on a single still and on a 121-frame video batch, and it costs nothing meaningful.

Inputs and outputs

images in, IMAGE out. Flip it twice and you're back where you started, which is why a symmetric pre/post pair like the author's is orientation-neutral overall: it changes what the model is fed, not what you see at the end. If that's not you, the node is a one-shot transform.

Install

Manager search for the pack name, or:

cd ComfyUI/custom_nodes
git clone https://github.com/morino-kumasan/comfyui-toml-prompt

then restart ComfyUI. Nothing to install - requirements.txt is empty; the callback into torch is ComfyUI's own. The README's install block is stale (it still says comfyui-utils and uses an SSH clone URL), so ignore it and use the HTTPS command above.

Where people get burned

Assuming "flip" means mirror. It doesn't here. If you're pre-processing reference images to fix a left-right bias and the output looks wrong, that's the axes mismatch, not the model.

Flipping after the text/watermark stage. Obviously, but people do it: flip a batch that's already had text burned in and it comes out backwards. Flip early, burn later.

Forgetting it's a batch op. FlipImage on a 100-frame clip is free. FlipImage on a 100-frame clip you also wanted untouched at the original orientation is a bug you'll spot in the preview, not in the console.

Categoryutils

Inputs (1)

NameTypeDefaultDescription
imagesIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGEIMAGE.