{"record":{"id":"3c5a99e01579d66e","repo":"Comfy-Org/ComfyUI","slug":"mogepanoramainference-takes-a-single-image-got-ba","errorCode":null,"errorMessage":"MoGePanoramaInference takes a single image (got batch of {image.shape[0]})","messagePattern":"MoGePanoramaInference takes a single image \\(got batch of (.+?)\\)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_moge.py","lineNumber":116,"sourceCode":"                MoGeModelType.Input(\"moge_model\"),\n                io.Image.Input(\"image\", tooltip=\"Equirectangular panorama (any aspect).\"),\n                io.Int.Input(\"resolution_level\", default=9, min=0, max=9,\n                             tooltip=\"Per-view detail (0 = fastest, 9 = most detailed).\"),\n                io.Int.Input(\"split_resolution\", default=512, min=256, max=1024,\n                             tooltip=\"Resolution of each perspective split.\"),\n                io.Int.Input(\"merge_resolution\", default=1920, min=256, max=8192,\n                             tooltip=\"Long-side resolution of the merged equirect distance map.\"),\n                io.Int.Input(\"batch_size\", default=4, min=1, max=12,\n                             tooltip=\"Views per inference batch (12 splits total).\"),\n            ],\n            outputs=[MoGeGeometry.Output(display_name=\"moge_geometry\")],\n        )\n\n    @classmethod\n    def execute(cls, moge_model, image, resolution_level, split_resolution, merge_resolution, batch_size) -> io.NodeOutput:\n\n        if image.shape[0] != 1:\n            raise ValueError(f\"MoGePanoramaInference takes a single image (got batch of {image.shape[0]})\")\n\n        image = image[..., :3]\n        H, W = int(image.shape[1]), int(image.shape[2])\n        scale = min(merge_resolution / max(H, W), 1.0)\n        merge_h, merge_w = max(int(H * scale), 32), max(int(W * scale), 32)\n\n        extrinsics, intrinsics = get_panorama_cameras()\n\n        comfy.model_management.load_model_gpu(moge_model.patcher)\n        device = moge_model.load_device\n        img_chw = image[0].movedim(-1, -3).to(device=device, dtype=moge_model.dtype)\n        splits = split_panorama_image(img_chw, extrinsics, intrinsics, split_resolution)\n\n        n_views = splits.shape[0]\n\n        # Weight each lsmr solve by 4^level so the final-resolution solve doesn't leave the bar idle.\n        merge_levels: list[tuple[int, int]] = []\n        w_, h_ = merge_w, merge_h","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_moge.py#L98-L134","documentation":"MoGePanoramaInference generates a 360 panorama from exactly one perspective image by splitting it into 12 view directions and batched inference. A batch of images has no meaningful panorama semantics, so anything other than batch size 1 is rejected up front.","triggerScenarios":"Feeding an image tensor with shape[0] > 1, e.g. a video frame batch, a multi-image batch node output, or an animated batch, into the panorama node.","commonSituations":"Reusing the same image source that feeds batch-aware nodes; LoadImage with a batch format (e.g. APNG/WebP); assuming the node iterates over batches like other MoGe nodes do.","solutions":["Select a single frame before the node, e.g. with an image-index/batch-select node so shape[0] == 1.","Process batches in a loop, calling the node once per image.","Check the upstream loader's settings to avoid importing animations as batches."],"exampleFix":"// before\ngeo = MoGePanoramaInference.execute(model, video_frames)  # batch of N\n\n// after\nfrom comfy_extras.nodes_images import GetImageSizeAndBatch  # or any batch selector\ngeo = MoGePanoramaInference.execute(model, video_frames[i:i+1])","handlingStrategy":"validation","validationCode":"if image.shape[0] != 1:\n    raise UserFacingError('panorama inference needs exactly one image')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Select a single frame before the panorama node.","Loop over batches, calling once per image.","Disable animated/batch import in the image loader."],"tags":["moge","panorama","batch-size","validation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}