ZML_圆柱投影
Flatten a panorama into a cylinder — for VR-ready images
- 图像
- 全景图像
If you've ever generated a 360° panorama with an equirectangular LoRA and noticed the horizon bends in a way that makes VR viewers wince, this is the fix. It remaps your image onto a cylindrical projection - the projection VR and 360° viewers actually expect - so the scene reads as if you're standing inside a cylinder looking out, instead of a flat equirect blob stretched across your face.
How it works
The math is straightforward and the source spells it out. You give it an input image plus an output width, height, and a 水平视角_度 (horizontal field of view, default 90°). It computes a per-pixel remap - for every output pixel, where does it come from in the input - and runs it through OpenCV's cv2.remap, which is the workhorse of every image-warp operation in existence. The "cylinder" here is that pixels are sampled along a cylindrical surface, which is what makes verticals stay straight while the horizontal view wraps around you.
Two flags change the outcome:
- 无缝水平循环 (seamless horizontal loop) - on, the left and right edges wrap to meet, so the result tiles horizontally without a visible seam. This is what you want for an actual 360° loop.
- 透明背景 - on, the area outside the source image is transparent (OpenCV's
BORDER_TRANSPARENT); off, it's filled black. If you're compositing the result onto something, keep it on.
The inputs that matter
- 图像 - the source panorama.
- 输出宽度 / 输出高度 - target canvas, 64–4096 in steps of 8. Defaults 1024×512, a sensible 2:1 panorama ratio.
- 水平视角_度 - 1–360, default 90. Lower = tighter view with more visible distortion; 90 is a good safe start.
Output is a single 全景图像 (IMAGE). Wire it into the pack's panorama preview node (which also does VR preview) or any save node.
Installing
The pack install, unchanged:
cd ComfyUI/custom_nodes
git clone https://github.com/zml-w/ComfyUI-ZML-Image
restart or Manager. This node needs opencv-python - in the pack's requirements.txt and preinstalled in most ComfyUI setups. English labels come from the translation patch at https://github.com/zml-w/ZZZ_ZML_English_Patch.
Where people get burned
Feed it a tiny image and the remap upscales garbage - generate or load your source at the output resolution you actually want. And the author flagged the panorama tooling as "still testing" in the changelog; the preview node came out early precisely because someone hit a bug in the released version. So: check the output once, especially the seam if you enable seamless loop - a mismatched horizon at the wrap point is the tell that your input wasn't actually equirectangular to begin with. If you're pairing this with a panorama LoRA, generate the source in the equirect layout first, then project. It's a niche tool, but when you need a VR-ready cylinder there isn't a more direct path in stock ComfyUI.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| 图像 | IMAGE | — | |
| 输出宽度 | INT | 102464–4096 | — |
| 输出高度 | INT | 51264–4096 | — |
| 水平视角_度 | FLOAT | 901–360 | — |
| 无缝水平循环 | BOOLEAN | false | — |
| 透明背景 | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 全景图像 | IMAGE | — |