Nodes/ComfyUI-zyd232-Nodes/LLM Text Generator
ComfyUI Node

LLM Text Generator

Generate text from any OpenAI-compatible server. Supports multiple reference images, videos and audio.

By zyd232·Created 2 years ago·Updated about 12 hours ago· 4
LLM Text Generator
  • images
  • videos
  • video_audios
  • audios
  • text
  • reasoning
config_select
config_nameDefault
base_urlhttp://127.0.0.1:8080
api_keysk-no-key-required
model_select
model
model_NoVision_select
model_NoVision
system_promptYou are a helpful AI assistant.
user_promptDescribe this image or answer my question.
temperature0.70
top_k40
seed-1
context_length2048
timeout180
thinkingfalse
think_start_tag<think>
think_end_tag</think>
clean_comfy_vram_before_genfalse
unload_after_genfalse
unload_endpoint/v1/models/unload
llama_cpp_unloadfalse
llama_endpoint/models/unload
cache_prompttrue
auto_lockfalse
video_fps1.0
max_video_frames-1
enable_audiofalse
use_lockedfalse
locked_text
locked_reasoning
Categoryzyd232 Nodes/LLM

Inputs (35)

NameTypeDefaultDescription
config_selectCOMBOChoose a saved server preset
config_nameSTRINGDefaultName for this preset; illegal characters are removed automatically
base_urlSTRINGhttp://127.0.0.1:8080AI service URL, e.g. Ollama or vLLM endpoint
api_keySTRINGsk-no-key-requiredAPI key, or ENV:var_name to read from environment
model_selectCOMBODropdown to select a vision model. Selection will fill the 'model' field below.
modelSTRINGVision model name (free input). Can be typed manually or selected from the dropdown above.
model_NoVision_selectCOMBODropdown to select a text-only model. Selection will fill the 'model_NoVision' field below.
model_NoVisionSTRINGText-only model name (free input). Used when no image/video/audio is provided.
system_promptSTRINGYou are a helpful AI assistant.System prompt that defines the AI's role and behavior
user_promptSTRINGDescribe this image or answer my question.Your question or instruction for the AI
temperatureFLOAT0.700–2Randomness: higher is more creative, lower is more stable
top_kINT401–100Pick next word from top K candidates
seedINT-1-1–18446744073709550000Random seed for reproducibility, -1 for random
context_lengthINT2048-1–128000Context window size. Set to -1 or 0 to omit num_ctx/n_ctx and let the server use its default context length
timeoutINT1801–3600Timeout in seconds for the LLM generation request
thinkingBOOLEANfalseSeparate AI's thinking process from final answer
think_start_tagSTRING<think>Opening tag to mark the start of thinking content
think_end_tagSTRING</think>Closing tag to mark the end of thinking content
clean_comfy_vram_before_genBOOLEANfalseClear ComfyUI VRAM before generation to avoid OOM
unload_after_genBOOLEANfalseUnload model after generation to free VRAM
unload_endpointSTRING/v1/models/unloadAPI endpoint path for unloading the model
llama_cpp_unloadBOOLEANfalseUnload model via llama.cpp-specific endpoint
llama_endpointSTRING/models/unloadllama.cpp unload API endpoint path
cache_promptBOOLEANtrueCache prompts to speed up repeated requests
auto_lockBOOLEANfalseWhen enabled, the Streaming Text panel automatically locks the result once generation completes
video_fpsFLOAT1.00.1–30Sampling density per reference video. Assumes the source video is 24fps: keeps video_fps frames per 24 source frames (n = total * video_fps/24), then capped by max_video_frames. Default 1.0.
max_video_framesINT-1Maximum number of frames sent per video (to avoid exceeding context length). Set to -1 or 0 to disable the cap and send all frames.
enable_audioBOOLEANfalseEncode and send audio references to the API (only if the model supports audio)
use_lockedBOOLEANfalseWhen true, skip LLM generation and return the locked result
locked_textSTRINGLocked final text returned when use_locked is true
locked_reasoningSTRINGLocked reasoning text returned when use_locked is true
imagesoptCOMFY_AUTOGROW_V3
videosoptCOMFY_AUTOGROW_V3
video_audiosoptCOMFY_AUTOGROW_V3
audiosoptCOMFY_AUTOGROW_V3

Outputs (2)

NameTypeDescription
textSTRING
reasoningSTRING