huchenlei / sd-webui-api-payload-display

Display the corresponding API payload after each generation on WebUI
MIT License
160 stars 18 forks source link

Prompt is not filled back #11

Closed PagziTechInc closed 8 months ago

PagziTechInc commented 8 months ago

Hello, trying latest version I can not get the payload, here is the issue faced:

api_payload_display.js?1700761827.0880964:94 Uncaught TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'. at HTMLButtonElement. (api_payload_display.js?1700761827.0880964:94:20) (anonymous) @ api_payload_display.js?1700761827.0880964:94

Code snippet: generateButton.addEventListener('click', () => { // There is id conflict on the page. So apply class selector // as well. const resultElement = gradioApp().querySelector( #${processType}_results_panel);

            new MutationObserver((_, observer) => {
                // The click is only triggered when
                // - generation button is clicked
                // - progress bar appears
                const dataPromise = waitForData(payloadTextbox);
                pullButton.click();
                dataPromise.then(data => updateJsonTree(wrapper, data));

                observer.disconnect();
            }).observe(resultElement, { childList: true });
        });
huchenlei commented 8 months ago

Fixed in https://github.com/huchenlei/sd-webui-api-payload-display/commit/2d3332d94ffac0943bd35a1943924ed4650c6e63. Sorry I thought the DOM structure change has landed in master.