Nodes/ComfyUI-LLaMA-Mesh/Chat LLaMa Mesh
ComfyUI Node

Chat LLaMa Mesh

Chat to an 8B model that answers in 3D geometry

By Yuan-ManX·Created 2 years ago·Updated 2 years ago· 5
Chat LLaMa Mesh
  • history
  • response
  • history
  • mesh_text
message
temperature0.9
max_new_tokens4096

The one node in ComfyUI that hand-writes 3D files

Every other "3D in ComfyUI" pack works from an image - you feed in a render and hope for a mesh. Chat LLaMa Mesh does something weirder: it loads a real Llama 3.1 8B model fine-tuned to emit OBJ files as text, and lets you just talk to it. Ask for "a wooden chair, four legs, an oval seat," and it types out a complete wavefront OBJ in its reply. It's the ComfyUI port of NVIDIA and Shanghai AI Lab's LLaMA-Mesh, and it's fully local - no API key, no server, the whole 8B model runs on your machine.

Let me level with you about expectations before you clear out your disk. This is text-to-3D from 2024, and it shows. The meshes are chunky - great for greyboxing, terrible for anything that needs to survive a close-up. It was the talk of r/StableDiffusion for about two weeks in November 2024 (someone even wired it into Blender, to a lot of applause), and then Trellis and the image-to-3D wave showed up and the conversation moved on. That doesn't make it useless; it makes it a niche toy. But it's the only thing in this graph that turns a sentence into geometry, which is worth something.

How it works

The node loads Zhengyi/LLaMA-Mesh from HuggingFace through transformers (AutoModelForCausalLM.from_pretrained(..., device_map="auto")) - and here's the first thing to know: it loads the model when the node is instantiated, not when you hit Run. So the moment you drop it into a workflow and ComfyUI starts up, it's downloading ~16 GB and pulling an 8B model into VRAM. Generation then streams token-by-token through a TextIteratorStreamer in a background thread, which is why the node feels like a chat rather than a "process and return" black box.

Because it's a port of the original Gradio demo, it's not the tidiest node in your graph. The model answers in normal text with the OBJ dropped into the reply between mesh markers; the pack declares three outputs - response (the chat text), history (conversation state), and mesh_text (the OBJ). Treat response as where the whole generation lands, OBJ markers and all, and mesh_text as best-effort - this is a demo port, not production plumbing.

The inputs that actually matter

There are only three required, and you'll fiddle with two of them:

  • message - your prompt. This is the whole show. "A low-poly mushroom," "a mug with a handle," or a longer instruction to modify an existing mesh, which the model can also do.
  • temperature - default 0.95. Crank it down for consistent output; set it to 0 and it switches to greedy decoding (the code special-cases this to avoid a sampling crash).
  • max_new_tokens - default 4096, max 8192. OBJ files are long, so resist the urge to trim this. If your mesh gets cut off mid-file, this is the knob to turn up.

There's also an optional history input of type CHAT_HISTORY - wire the history output back into it and you get multi-turn conversation, which is how you iterate: "make the legs thicker," "now round the seat."

Wiring it up

response goes to a text display or a Save Text node so you can keep the output. mesh_text is meant to feed the pack's other two nodes - Visualize Mesh (writes the OBJ to disk) and Apply Gradient Color (exports a colored GLB) - and from there into Blender or whatever you actually use. That's the full intended pipeline, and it's worth setting up because a raw OBJ in a string is about as useful as a recipe written in a language you can't read.

Installing

Through ComfyUI Manager, search for LLaMA-Mesh (pack title ComfyUI-LLaMA-Mesh). Or the manual way:

cd ComfyUI/custom_nodes
git clone https://github.com/Yuan-ManX/ComfyUI-LLaMA-Mesh.git
cd ComfyUI-LLaMA-Mesh
pip install -r requirements.txt

The requirements.txt pulls transformers, accelerate, numpy, and trimesh. The model downloads itself from HuggingFace on first load. One genuine trap: the module imports gradio at the top, but gradio isn't in requirements.txt - if ComfyUI refuses to start with a gradio import error, pip install gradio and move on.

What will bite you

  • The first load is brutal. Sixteen gigabytes of download, then a model that wants ~16 GB of VRAM. device_map="auto" will offload to system RAM if you're short, but the slowdown is painful - people ran quantized versions to fit a 12 GB card, and this pack doesn't quantize anything.
  • Loading the workflow triggers the download. Because the model loads in __init__, ComfyUI fires off the HuggingFace download the moment the workflow loads, not when you run it. Don't be alarmed by a sudden 16 GB hit while you're just browsing.
  • It's abandoned, mildly. The repo is a single rough commit from late 2024, unmaintained since. Expect the code to be what it is. If you need image-to-3D instead of text-to-3D, go look at Trellis - this node is specifically for when the prompt is your geometry.
CategoryLLaMA-Mesh

Inputs (4)

NameTypeDefaultDescription
messageSTRING
temperatureFLOAT0.90–1
max_new_tokensINT4096128–8192
historyoptCHAT_HISTORY

Outputs (3)

NameTypeDescription
responseSTRING
historyCHAT_HISTORY
mesh_textSTRING