Nodes/ComfyUI-JakeUpgrade/Mesh Input Switch JK๐Ÿ‰
ComfyUI Node

Mesh Input Switch JK๐Ÿ‰

Route between two 3D meshes โ€” for img2mesh workflows that compare geometry

By jakechaiยทCreated 2 years agoยทUpdated 3 months agoยท 147
Mesh Input Switch JK๐Ÿ‰
  • mesh_false
  • mesh_true
  • mesh_output
  • boolean
โ—„boolean_valuefalseโ–บ

If you've ever run an img2mesh workflow, you know the graph is a chain of 3D transforms - load, reconstruct, remesh, texture - and sometimes you want to compare two meshes without rebuilding the chain. Mesh Input Switch JK๐Ÿ‰ is the switch-family node that routes between two MESH wires based on a boolean.

JakeUpgrade is one of the packs that made img2mesh mainstream in ComfyUI - the README is basically a tour of 3D-Pack, Hunyuan3D, and mesh pipelines - and the 3D switches like this one are part of the house style: one graph, several geometry options, toggle to choose. A mesh switch is how "try the Hunyuan3D output" vs "try the Trellis output" becomes a checkbox instead of a reconnect.

How it works

if mesh_true is not None and boolean_value:
    return (mesh_true, boolean_value)
else:
    return (mesh_false, boolean_value)
  • boolean_value - True โ†’ the "true" mesh, False โ†’ the "false" one.
  • mesh_false - required.
  • mesh_true - optional; unplugged = pass-through.

Outputs: mesh_output (MESH) and boolean.

MESH is the type used by the 3D node ecosystem - ComfyUI-3D-Pack, the Hunyuan3D wrappers, the pack's own mesh nodes. It's an opaque object (vertices, faces, and the pipeline-specific data), and this switch just routes it. Both mesh producers run each execution, so it's a router, not a lazy branch - keep that in mind if one side is an expensive reconstruction you'd rather not pay for when unselected.

Where you'd use it

  • A/B two reconstruction methods feeding the same down-stream remesh/texture steps.
  • Switching between a generated mesh and a loaded mesh (from a loader node) on one boolean.
  • In the pack's img2mesh workflows, the "switch between sub-step results" philosophy means these switches appear wherever you'd otherwise have two parallel chains.

Install

Ships with ComfyUI-JakeUpgrade. ComfyUI Manager โ†’ search ComfyUI-JakeUpgrade, or:

cd ComfyUI/custom_nodes
git clone https://github.com/jakechai/ComfyUI-JakeUpgrade
cd ComfyUI-JakeUpgrade && pip install -r requirements.txt

The meshes come from whatever 3D nodes you've wired upstream - this switch adds nothing of its own. Menu: ๐Ÿ‰ JK/๐Ÿ”€ Switch. And a real note for 3D work: JakeUpgrade recommends running 3D-Pack in a separate ComfyUI install, so if your 3D graph feels fragile, that's the pack's own advice, not paranoia.

Category๐Ÿ‰ JK/๐Ÿ”€ Switch

Inputs (3)

NameTypeDefaultDescription
boolean_valueBOOLEANfalseCondition to select between inputs (True=mesh_true, False=mesh_false)
mesh_falseMESHMesh to return when condition is False
mesh_trueoptMESHMesh to return when condition is True (optional)

Outputs (2)

NameTypeDescription
mesh_outputMESHโ€”
booleanBOOLEANโ€”