Skip to content
Discussion options

You must be logged in to vote

widget.element.value only changes the textarea DOM element. It does not update the LiteGraph widget value that ComfyUI serializes into the prompt.

Update the widget itself and invoke its callback if the widget has one:

const nextValue = "new text";
widget.value = nextValue;
widget.callback?.(nextValue);
node.setDirtyCanvas?.(true, true);

The important line is widget.value = nextValue. Current frontend extension guidance explicitly treats widget.value as the supported read/write surface. Writing directly to widget.element.value bypasses that state, which explains why manual typing works while the JavaScript assignment does not.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@sarashinai
Comment options

Answer selected by sarashinai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants