Nodes/comfy-ovum/LMStudio Prompt Ovum
ComfyUI Node

LMStudio Prompt Ovum

LM Studio Prompt Node with Dynamic Model Management This node connects to LM Studio's local server to generate text using various language models. It supports dynamic model loading/unloading, automatic model management, and various prompt modes. Features: • Multiple prompt modes (prompt, pixelwave, style, descriptor, character, custom) • Dynamic model loading and selection from available models • Automatic model unloading after specified timeout (a hack) • Model list caching between sessions • Wildcard support with {option1|option2} syntax • Custom conversation history support Requirements: • LM Studio running with server enabled • Models downloaded in LM Studio • Server accessible at specified address:port

By sfinktah·Created 12 months ago·Updated 9 months ago· 6
LMStudio Prompt Ovum
  • image
  • text
  • context
input_promptPrompt Text Here
modeprompt
custom_historypath to history.json
server_addresslocalhost
server_port1234
selected_modelNo models available
unload_timeout_seconds0
seed0
CategoryOvum/LLM

Inputs (9)

NameTypeDefaultDescription
input_promptSTRINGPrompt Text HereThe main prompt text to send to the LM Studio model. Supports wildcard syntax like {option1|option2} for random selection.
modeCOMBOpromptPrompt processing mode: • prompt: Direct prompt • descriptor: Adds random descriptive words • pixelwave/style/character: Uses predefined conversation templates • custom: Uses custom history file
custom_historySTRINGpath to history.jsonPath to custom conversation history JSON file (only used when mode is set to "custom"). File should contain message history in OpenAI chat format.
server_addressSTRINGlocalhostLM Studio server address (hostname or IP). Default is localhost for local installations.
server_portINT12340–65535LM Studio server port number. Default is 1234 which is the standard LM Studio server port.
selected_modelCOMBONo models availableChoose which model to use for generation. List is automatically populated from LM Studio and cached between sessions. Enable dynamic loading to automatically load the selected model.
unload_timeout_secondsINT0You MUST have the liquid/lfm2-1.2b model installed for this to work. Automatic model unload timeout in seconds. Set to 0 to disable. When > 0, the model will be automatically unloaded after this many seconds of inactivity to free up memory.
seedINT00–18446744073709550000Random seed for reproducible generation and wildcard selection. Use 0 for random seed, or set a specific number for consistent results.
imageoptIMAGEOptional image to include with the prompt. The image will be encoded and sent to the vision-capable LM Studio model along with the text prompt.

Outputs (2)

NameTypeDescription
textSTRING
contextLLM_CONTEXT