- Add optional `enabled` BOOLEAN; off returns prompt as response without contacting LM Studio
- Move `prompt` above `system_message` so a bypassed node feeds response from the prompt
- Frontend: migratePromptFirst remaps 2.0-2.3 widgets_values by name (V2_ORDER table, ea_prompt_first property)
- Share remapByName between the v1 and 2.x migrations
- Update example workflows to the new order
- Tests for passthrough, prompt-first order and the V2_ORDER table
- README and AGENTS.md notes; bump to 2.4.0
Layout was incoherent: image_resize sat between seed and the draft model, two
empty textareas broke up the sampling rows, and json_schema showed even in Text
mode. Widgets are now grouped most-used first:
prompts -> model -> generation -> sampling -> output shaping -> reasoning
-> vision -> speculative decoding -> management
Reordering is safe precisely now: no v2 workflow exists yet, and the v1
migration writes values onto current widgets by name, so it is order
independent. Verified in a browser - a v1 workflow lands correctly on the
regrouped widgets, including image_resize and custom_draft_model.
Also fixes a real defect this surfaced: a workflow stores the node's size and
LiteGraph restores it verbatim without re-checking that the widgets still fit.
v2.0.0 has a net two more widgets than v1.5.x, so every upgraded workflow was
restored too short and the overflow drew outside the node frame.
growToFitWidgets grows (never shrinks) the node on configure and after
execution; a v1 node stored at 700px now grows to 820px on load.
For the record: a stock ComfyUI Note node's textarea overhangs its own frame by
~13 units at any size. That is upstream behaviour, measured against a freshly
created Note, and is not something this pack causes or should chase.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The lmstudio SDK silently discards prediction-config keys it does not
recognise instead of raising. v1.x relied on that not happening, and shipped
two widgets that never did anything:
* presence_penalty -> sent as presencePenalty
* enable_thinking -> sent as enableThinking
Neither key exists in LlmPredictionConfigDict, so both were dropped before the
request left the machine. Confirmed against a live server: the prediction_config
LM Studio echoes back contains neither. LM Studio has no presence penalty, no
frequency penalty, no inference-time seed and no thinking on/off flag.
Both widgets are removed. Because ComfyUI serialises widgets_values
positionally, removing two mid-list widgets would shift every later value, so
web/ea_lmstudio.js detects the v1.5.x layout and realigns by widget name on
load (verified in a browser: without it reasoning_mode loads as "[[/R]]").
To stop this class of bug recurring, generate() now diffs the config it sent
against the config the server reports as applied and warns about anything
dropped.
Fixes
* A successful generation could be reported as "Generation failed":
LlmPredictionStats fields are Optional and formatting None with :.2f raised
TypeError after the model had already produced its text.
* New nodes defaulted to the "Custom" sentinel with an empty identifier, so
the first run always failed even when discovery worked.
* Models whose identifier fails validation (LM Studio serves ids like
"model@?") vanished from the dropdown with no explanation.
* requires-python said >=3.9; the lmstudio dependency needs >=3.10.
Added
* Streamed prediction: ComfyUI's cancel button now actually stops generation,
and the queue progress bar tracks tokens.
* Reasoning is taken from LM Studio's own reasoning_type fragment tagging
when available, with the tag regexes kept as fallback.
* stop_strings, context_overflow, and structured JSON output (schema-
constrained, with automatic ```json fence recovery).
* OUTPUT_NODE now carries a ui payload: the response renders in the node.
* Speculative-decoding acceptance stats and a low-acceptance hint.
* example_workflows/ (discoverable via ComfyUI's template browser), AGENTS.md,
and a CI workflow running the suite on 3.10 and 3.13.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>