Nodes/ComfyUI-DaSiWa-Nodes/DaSiWa LLM Analyze
ComfyUI Node

DaSiWa LLM Analyze

Run a local chat or vision-language model in your graph

By darksidewalker·Created 4 months ago·Updated 23 days ago· 22
DaSiWa LLM Analyze
  • llm_config
  • images
  • response
  • info
system_prompt_presetcustom
system_promptYou are a concise, helpful visual and text analysis assistant.
promptFollow the selected system instruction for the connected text, image, or video input.
max_new_tokens256
max_input_tokens0
temperature0.20
top_p0.90
repetition_penalty1.00
use_kv_cachetrue
seed-1
max_frames8
frame_stride1
frame_strategyevenly_spaced
resize_max_px768
resize_algorithmlanczos
memory_cleanupoff
text_input

This is the node that actually runs your local model - DaSiWa_LLMModelSelector picks what loads, this one decides what you ask it and what you feed it. Point it at connected text, a still image, or a batch of video frames (from Load Image, a VHS frame loader, whatever produces an IMAGE batch), and it returns a plain STRING response you can route into a prompt, a metadata field, or just eyeball in a Preview node.

What it's for

The obvious use is captioning - feeding generated or reference images through a local VLM to get tags or natural-language descriptions back, the same idea as tools like JoyCaption or Florence2, except this node runs whatever chat/vision model you've pointed the Model Selector at rather than being locked to one checkpoint. The less obvious but genuinely useful case: video prompt enhancement. The pack ships built-in system prompt presets specifically tuned for LTX-2.3 and Wan2.2 - feed it your rough idea, get back a prompt written the way those models actually respond to, since both are notoriously more prompt-sensitive than most image models.

How it works

llm_config (required, from the Model Selector) tells it which model to run. system_prompt_preset is a 21-option dropdown covering custom (write your own via system_prompt), the two video-enhancement presets, and a spread of captioning presets crossed by detail level (simple/detailed/very_detailed) and style (mixed tags, tag-only, natural language) - pick the caption preset that matches how you want the output formatted rather than trying to coax a natural-language model into spitting out Danbooru tags via prompt alone. prompt is your actual instruction or question for this specific run.

For video, max_frames, frame_stride, and frame_strategy (evenly_spaced/first/middle/last/every_nth) control which frames the model actually sees - you don't need to feed it every frame of a long clip, and doing so just burns context and VRAM for no real gain in most captioning/analysis tasks. resize_max_px and resize_algorithm downscale frames before they hit the model, which matters a lot for VRAM on longer sequences.

The inputs and outputs that matter

  • prompt and system_prompt - your instruction and the model's framing; both multiline text you'll actually edit per run.
  • max_new_tokens (default 256) - cap on response length; bump it up for detailed captions, keep it low for tags or short answers.
  • temperature (default 0.2) and top_p (default 0.9) - low temperature keeps captioning consistent and literal; push it up if you want more varied, creative phrasing.
  • Optional images and text_input - at least one of these needs to be connected for the node to have anything to analyze.
  • memory_cleanup (off/before_run/after_run/before_and_after) - free VRAM around the run if you're chaining this into a heavier sampling step afterward.

Outputs: response (the actual answer) and info (diagnostic/run metadata - useful when something looks wrong and you need to know what actually got sent to the model).

How to install it

ComfyUI Manager - search DaSiWa-Nodes, install, restart. Manual: clone into custom_nodes, pip install -r requirements.txt, restart. You'll also need an actual model in ComfyUI/models/llm - see the companion DaSiWa LLM Model Selector page for how models get there. This node does nothing without one wired into llm_config.

Common issues & troubleshooting

Out of memory on a big VLM. Drop max_frames, lower resize_max_px, or set memory_cleanup to after_run so the model doesn't sit resident through the rest of your workflow. Vision-language models are considerably heavier than text-only ones for the same parameter count - budget accordingly.

Response is generic or ignores your prompt. Check system_prompt_preset isn't fighting your prompt - a captioning preset's system instruction can override or dilute a custom question. Switch to custom and write both fields yourself if you need precise control.

Slow on repeated runs. That's use_kv_cache and cache_mode (on the Model Selector) working against each other, or the model reloading every run because cache mode is set to unload. If you're iterating fast, keep the model cached rather than eating a load penalty every queue.

CategoryDaSiWa/LLM

Inputs (19)

NameTypeDefaultDescription
llm_configDASIWA_LLM_CONFIG
system_prompt_presetCOMBOcustom21 options: custom, enhance_video_ltx23, enhance_video_wan22, caption_image_simple_mixed, caption_image_simple_tag, caption_image_simple_natural, +15
system_promptSTRINGYou are a concise, helpful visual and text analysis assistant.
promptSTRINGFollow the selected system instruction for the connected text, image, or video input.
max_new_tokensINT2561–8192
max_input_tokensINT00–131072
temperatureFLOAT0.200–2
top_pFLOAT0.900.01–1
repetition_penaltyFLOAT1.000.1–3
use_kv_cacheBOOLEANtrue
seedINT-1-1–18446744073709550000
max_framesINT80–256
frame_strideINT11–4096
frame_strategyCOMBOevenly_spaced5 options: evenly_spaced, first, middle, last, every_nth
resize_max_pxINT7680–4096
resize_algorithmCOMBOlanczos6 options: lanczos, bicubic, bilinear, hamming, box, nearest
memory_cleanupCOMBOoff4 options: off, before_run, after_run, before_and_after
imagesoptIMAGE
text_inputoptSTRING

Outputs (2)

NameTypeDescription
responseSTRING
infoSTRING