{"record":{"id":"a1e5bc6f73d08028","repo":"Comfy-Org/ComfyUI","slug":"mergesplat-no-gaussians-to-merge","errorCode":null,"errorMessage":"MergeSplat: no gaussians to merge","messagePattern":"MergeSplat: no gaussians to merge","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_gaussian_splat.py","lineNumber":1182,"sourceCode":"        if cls.hidden.unique_id:  # show the count inline on the node\n            PromptServer.instance.send_progress_text(f\"{count:,} splats\", cls.hidden.unique_id)\n        return IO.NodeOutput(splat, count)\n\n\ndef _pad_stack(items, n):\n    # Stack a list of (Lᵢ, *tail) tensors into (B, n, *tail), zero-padding each row up to n.\n    tail = items[0].shape[1:]\n    out = items[0].new_zeros((len(items), n, *tail))\n    for i, t in enumerate(items):\n        out[i, :t.shape[0]] = t\n    return out\n\n\ndef _merge_gaussians(gaussians: list) -> Types.SPLAT:\n    # Concatenate SPLAT batches along the splat dimension (per item), padding SH to the highest degree.\n    gs = [g for g in gaussians if g is not None]\n    if not gs:\n        raise ValueError(\"MergeSplat: no gaussians to merge\")\n    b = gs[0].positions.shape[0]\n    for g in gs:\n        if g.positions.shape[0] != b:\n            raise ValueError(f\"MergeSplat: batch size mismatch ({b} vs {g.positions.shape[0]}).\")\n    max_k = max(g.sh.shape[2] for g in gs)\n\n    pos_b, scl_b, rot_b, op_b, sh_b, lengths = [], [], [], [], [], []\n    for i in range(b):\n        pos_i, scl_i, rot_i, op_i, sh_i = [], [], [], [], []\n        for g in gs:\n            end = _real_len(g, i)\n            pos_i.append(g.positions[i, :end])\n            scl_i.append(g.scales[i, :end])\n            rot_i.append(g.rotations[i, :end])\n            op_i.append(g.opacities[i, :end])\n            sh = g.sh[i, :end]       # (end, K, 3)\n            if sh.shape[1] < max_k:  # zero-pad lower-degree SH\n                sh = torch.cat([sh, sh.new_zeros(sh.shape[0], max_k - sh.shape[1], sh.shape[2])], dim=1)","sourceCodeStart":1164,"sourceCodeEnd":1200,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_gaussian_splat.py#L1164-L1200","documentation":"Raised by _merge_gaussians when every element of the incoming gaussian list is None (after filtering). The merge helper is expected at least one real SPLAT to determine the output batch size and SH degree; with nothing connected it has no shape information and cannot construct a result. It is the internal backstop behind the MergeSplat node's own input check.","triggerScenarios":"MergeSplat with all Autogrow inputs unconnected (caught one level up at line 1237), or a caller invoking _merge_gaussians directly with a list of Nones — e.g., optional upstream nodes that returned None on their empty path.","commonSituations":"Workflow branches where every upstream splat node was bypassed/muted; optional inputs that all evaluated to None; programmatic misuse of the private helper.","solutions":["Connect at least one splat input to MergeSplat.","Unmute/unbypass the upstream nodes feeding the merge.","If merging conditionally in code, filter Nones first and ensure the list is non-empty before calling."],"exampleFix":"// before\nmerged = _merge_gaussians([None, None])\n\n// after\ngs = [g for g in splats if g is not None]\nmerged = _merge_gaussians(gs) if gs else None","handlingStrategy":"validation","validationCode":"gs = [g for g in gaussians if g is not None]\nif not gs:\n    raise ValueError('MergeSplat: connect at least one splat')\nmerged = _merge_gaussians(gs)","typeGuard":"def has_any_splat(gaussians: list) -> bool:\n    return any(g is not None for g in gaussians)","tryCatchPattern":"try:\n    merged = _merge_gaussians(gs)\nexcept ValueError as e:\n    if 'no gaussians to merge' in str(e):\n        merged = None  # or wire a default splat\n    else:\n        raise","preventionTips":["Filter None inputs before merging.","Ensure at least one upstream splat node is active (not muted/bypassed)."],"tags":["gaussian-splatting","empty-input","node","merge"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}