Nodes/ComfyUI-LMCQ/Lmcq Deep Gen
ComfyUI Node

Lmcq Deep Gen

Lmcq Deep Gen — run text generation with a local DeepSeek-R1 model

By sebord·Created 2 years ago·Updated 7 months ago· 108
Lmcq Deep Gen
  • deep_model
  • raw_output
  • clean_output
system_prompt
user_prompt
seed888
max_tokens500
temperature1.00
top_k50
top_p1.00

This is the node that actually generates text once LmcqDeepLoader has a DeepSeek-R1-Distill model loaded - the pair works like any two-node loader/sampler split in ComfyUI, just for language instead of images. Wire the model in, give it a system prompt and a user prompt, and it runs generation locally, with two separate outputs depending on whether you want the model's raw reasoning trace or just the final answer.

Why it's two outputs instead of one. DeepSeek-R1-family models "think out loud" - they wrap their reasoning process in <think>...</think> tags before producing a final answer, which is genuinely useful to inspect while you're debugging a prompt, but is noise if you just want the answer to feed into the next node. This node handles both: raw_output gives you everything including the thinking tags, clean_output strips them and gives you just the final text. If you're piping the result straight into a CLIP Text Encode or a filename field, use clean_output; if you're trying to understand why the model answered a certain way, check raw_output.

The inputs that matter. deep_model takes the DEEP_MODEL output from LmcqDeepLoader - this node won't run without it. system_prompt is where you set behavior rules (tone, format, constraints); user_prompt is the actual request. Both are multiline text fields, so you can template them with whatever's coming out of earlier nodes in your graph.

The generation controls are standard LLM sampling parameters, not anything LMCQ-specific: seed (default 888) for reproducibility, max_tokens (default 500) as a cap on output length, temperature (0-2, default 1) for how random the output is - push it down for consistent, literal output, up for more varied phrasing - top_k (default 50) and top_p (0-1, default 1) as the usual nucleus/top-k sampling knobs. If you've used any local LLM tooling before, these will be familiar; if you haven't, the defaults are a reasonable starting point and temperature is the one worth touching first.

Where this fits in an image workflow. The obvious use is prompt engineering inside the graph itself - feed a rough idea into user_prompt, have the model expand it into a detailed Flux or SDXL prompt, and wire clean_output straight into your CLIP Text Encode. It also works for batch captioning, generating filename metadata, or any other "I need a small local LLM step and don't want to pay for an API call" spot in a pipeline.

Installing it. This node ships with the same pack as its loader - through ComfyUI Manager (search "ComfyUI-LMCQ") or:

cd ComfyUI/custom_nodes
git clone https://github.com/sebord/ComfyUI-LMCQ

Restart ComfyUI. You'll also need an actual DeepSeek-R1-Distill model downloaded into models/deepseek/ for LmcqDeepLoader to feed this node - see that node's article for the exact folder layout the README specifies.

Troubleshooting. If generation is painfully slow or you're hitting out-of-memory errors, that's almost always the model size, not this node - the 32B/70B Distill variants need real workstation-class VRAM, and there's no quantization option exposed here, so drop down to the 7B or 1B model if you're on consumer hardware. If deep_model won't connect, double-check you're feeding it from LmcqDeepLoader specifically - DEEP_MODEL is a custom type unique to this pack and won't accept anything else. And as with every node in this pack: if LmcqDeepGen isn't showing up in your node list at all, check your ComfyUI console for a ModuleNotFoundError tied to the pack's compiled runtime-protection module - a known, reported issue that crashes the entire pack's import, unrelated to DeepSeek itself, with the fix in the README's January 2026 changelog.

CategoryLmcq/deepseek

Inputs (8)

NameTypeDefaultDescription
deep_modelDEEP_MODEL
system_promptSTRING
user_promptSTRING
seedINT8880–18446744073709550000
max_tokensINT5000–18446744073709550000
temperatureFLOAT1.000–2
top_kINT500–101
top_pFLOAT1.000–1

Outputs (2)

NameTypeDescription
raw_outputSTRING
clean_outputSTRING