Fixed ControlNet extension for saving batch dir

pull/77/head
ilian.iliev 2024-10-07 21:37:32 +03:00
parent bd957412eb
commit ef4ca45118
1 changed files with 18 additions and 0 deletions

View File

@ -161,6 +161,23 @@ state.extensions['control-net'] = (function () {
}); });
} }
function handleTextareas() {
handleContext((container, store) => {
let textareas = container.querySelectorAll('textarea');
textareas.forEach(function (textarea) {
let label = textarea.previousElementSibling;
let id = state.utils.txtToId(label.textContent);
let value = store.get(id);
if (value) {
state.utils.setValue(textarea, value, 'change');
}
textarea.addEventListener('change', function () {
store.set(id, this.value);
});
});
});
}
function load() { function load() {
setTimeout(function () { setTimeout(function () {
handleTabs(); handleTabs();
@ -168,6 +185,7 @@ state.extensions['control-net'] = (function () {
handleSelects(); handleSelects();
handleSliders(); handleSliders();
handleRadioButtons(); handleRadioButtons();
handleTextareas();
}, 500); }, 500);
} }