Nodes/EA_LMStudio/EA LM Studio
ComfyUI Node

EA LM Studio

A ComfyUI node in EA/LMStudio with 26 inputs and 3 outputs.

By EnragedAntelope·Created 8 months ago·Updated about a month ago· 11
EA LM Studio
  • image1
  • image2
  • image3
  • image4
  • response
  • reasoning
  • troubleshooting
system_messageYou are a helpful assistant.
prompt
model_selection-- Custom (enter below) --
custom_model_name
max_tokens1024
temperature0.70
seed0
image_resizeMedium (768px)
draft_model_selection-- Custom (enter below) --
custom_draft_model
top_p1.00
top_k0
repeat_penalty1.00
min_p0.00
presence_penalty0.00
enable_thinkingModel default
reasoning_modeAuto-detect (recommended)
custom_open_tag<think>
custom_close_tag</think>
unload_llmtrue
unload_comfy_modelsfalse
refresh_modelsfalse
CategoryEA/LMStudio

Inputs (26)

NameTypeDefaultDescription
system_messageSTRINGYou are a helpful assistant.System prompt that defines the LLM's role and behavior. Sets the context for all responses.
promptSTRINGThe user prompt to send to the LLM. This is your main request or question.
model_selectionCOMBO-- Custom (enter below) --Select a model from LM Studio. Models are fetched at ComfyUI startup. Select 'Custom' to manually enter a model identifier.
custom_model_nameSTRINGManual model identifier. Only used when 'Custom' is selected above. Find identifiers in LM Studio's model list.
max_tokensINT10241–131072Maximum OUTPUT tokens for the response (default 1024). Limits reply length, not input. Raise for longer replies; lower to cap length/speed up. The model's context window (input+output) is set in LM Studio when loading and must exceed max_tokens for full output.
temperatureFLOAT0.700–2Controls randomness (default 0.7). Lower (0.1-0.3) = more focused/deterministic; higher (0.7-1.2) = more creative/varied. 0.0 = greedy/most deterministic.
seedINT00–18446744073709550000Seed for ComfyUI workflow reproducibility. Note: LM Studio SDK does not support inference-time seeding.
image_resizeoptCOMBOMedium (768px)Resize images before processing. Smaller = faster inference. 'No Resize' keeps original size. Only applies when images are connected.
image1optIMAGEFirst image input for vision models (VLMs). Leave unconnected for text-only inference.
image2optIMAGESecond image input for multi-image VLMs. Not all VLMs support multiple images.
image3optIMAGEThird image input for multi-image VLMs. Not all VLMs support multiple images.
image4optIMAGEFourth image input for multi-image VLMs. Not all VLMs support multiple images.
draft_model_selectionoptCOMBO-- Custom (enter below) --Optional draft model for speculative decoding (faster inference). Select 'Custom' and leave empty to disable.
custom_draft_modeloptSTRINGManual draft model identifier. Only used when draft 'Custom' is selected. Leave empty to disable.
top_poptFLOAT1.000–1Nucleus sampling: only consider tokens within cumulative probability top_p (default 1.0 = disabled). Lowering (e.g. 0.9-0.95) = more focused/coherent; raising toward 1.0 = more diverse.
top_koptINT00–500Top-K sampling: only consider the K most likely tokens (default 0 = disabled). Lowering (e.g. 20-40) = more focused; raising = more diverse. Recommended 20-40 for thinking models.
repeat_penaltyoptFLOAT1.000–2Penalizes tokens that already appeared, scaled by how often (default 1.0 = disabled). Raising (1.1-1.3) reduces repetition/loops; too high can hurt coherence. Below 1.0 encourages repetition.
min_poptFLOAT0.000–1Min-P sampling: drop tokens below this fraction of the top token's probability (default 0.0 = disabled). Raising (e.g. 0.05-0.1) = more focused/coherent; lowering toward 0 = more diverse. A modern alternative to top_p.
presence_penaltyoptFLOAT0.00-2–2Flat penalty on any token already used, encouraging new topics (default 0.0 = disabled). Raising (e.g. 0.3-0.8) reduces repetition / broadens topics; negative values encourage reuse. Distinct from repeat_penalty. Note: LM Studio has no frequency_penalty.
enable_thinkingoptCOMBOModel defaultForce thinking/reasoning on hybrid models like Qwen3 without the '/think' prompt hack (default 'Model default' = leave the model's own behavior untouched). 'Enabled' turns thinking on; 'Disabled' turns it off. Pairs with reasoning_mode. Ignored by models/backends that don't support it.
reasoning_modeoptCOMBOAuto-detect (recommended)How to extract reasoning/thinking from model output. Auto-detect works with DeepSeek, Qwen, QwQ, GLM, GPT-OSS and similar models. Note: Models don't always produce thinking output for simple queries. For Qwen3, add '/think' to your prompt to force thinking mode.
custom_open_tagoptSTRING<think>Custom opening tag for reasoning extraction. Only used when reasoning_mode is 'Custom tags'.
custom_close_tagoptSTRING</think>Custom closing tag for reasoning extraction. Only used when reasoning_mode is 'Custom tags'.
unload_llmoptBOOLEANtrueUnload the LLM from LM Studio after generation. Recommended to free VRAM for image generation.
unload_comfy_modelsoptBOOLEANfalseUnload ComfyUI models (SD, VAE, etc.) before LLM inference. Frees VRAM for larger LLMs.
refresh_modelsoptBOOLEANfalseToggle ON to re-fetch the model list from LM Studio and update the dropdowns instantly. Automatically toggles back off.

Outputs (3)

NameTypeDescription
responseSTRING
reasoningSTRING
troubleshootingSTRING