图像翻转丨方向
Mirror an image (or a whole batch) in one click
- image
- image
Flipping an image is the kind of thing you assume ComfyUI does natively. And it kind of does - but not as a clean batch-aware node with a horizontal/vertical toggle. ImageFlipping is the QING pack's take: feed it an image (or a whole batch), pick a direction, get the mirrored result back with RGBA transparency handled properly.
It's from ComfyUI-QING (display name "图像翻转丨方向"), the Chinese-authored utility pack that's quietly good at "the boring image ops done right." Display names are bilingual, so in the node menu you'll see the Chinese title.
How it works
Under the hood it converts each frame to a PIL image and runs FLIP_LEFT_RIGHT or FLIP_TOP_BOTTOM, then converts back. The batch is handled frame-by-frame, so a 16-image tensor comes out mirrored as 16 images - no manual per-image looping. It also keeps alpha: RGBA in, RGBA out, so a transparent PNG flipped stays transparent instead of getting its transparency flattened. Single-channel inputs get promoted to RGB on the way through.
Two inputs and one output - that's the whole node:
image- the tensor to flip.flip_mode- 水平翻转 (horizontal) or 垂直翻转 (vertical). Horizontal is the mirror you're used to from a selfie; vertical flips it upside down.interpolation- lanczos / bicubic / hamming / bilinear / box / nearest, defaulting to lanczos.image(out) - the flipped tensor.
The honest take on the interpolation menu
Here's the thing the author's own code admits: flipping doesn't need interpolation at all. A mirror is a pure pixel permutation - every pixel just moves, nothing gets resampled - so the interpolation dropdown is effectively decorative on this node. The parameter exists for API consistency with the pack's other transform nodes, not because lanczos flips "smoother" than nearest. Pick one and forget it. I'd rather the dropdown weren't there, but it costs you nothing.
Where it fits
Three real jobs:
- Batch augmentation. Training or prepping a dataset and want mirrored copies for free variety? This is the node - flip a whole batch in one step, no per-item nodes.
- Fixing handedness. Text or logos that came out backwards, a scan loaded wrong, a mirror-image composition - one toggle and it's sorted.
- Symmetric workflows. If you're compositing a mirrored version of a generation for a kaleidoscope or a symmetrical layout, this is the mirror step you'd otherwise fake with image-math gymnastics.
It's a leaf node - nothing else in the graph cares that a flip happened, so it slots in anywhere between a loader and a preview.
Installing
Part of ComfyUI-QING, so it installs with the whole pack (79 nodes). ComfyUI Manager: search "ComfyUI-QING". Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/GAO-SHIQING/ComfyUI-QING
cd ComfyUI-QING
python install_dependencies.py # or: pip install -r requirements.txt
Restart ComfyUI. Dependencies are all plain pip packages (Pillow, opencv-python, scipy, scikit-image, cairosvg) - nothing to download beyond that. China mirror flag if you need it: --mirror --auto. Python ≥ 3.9, recent ComfyUI.
Gotchas
Honestly, this is the least trouble-prone node in the pack. One behavior to know: if something upstream hands it a malformed tensor it catches the error and returns the original image unchanged, with a line printed to the console - so an un-flipped output is its failure mode, not a crash. If you flip and nothing visibly changes, check the console for 图像翻转错误. And remember that a horizontal flip is not the same as rotating 180° - if your goal was "turn it around," you want rotation, not this.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| flip_mode | COMBO | 水平翻转 | 2 options: 水平翻转, 垂直翻转 |
| interpolation | COMBO | lanczos | 6 options: lanczos, bicubic, hamming, bilinear, box, nearest |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |