better detect input source

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-11-11 16:07:57 -05:00
parent ec7bcd7202
commit 385de2f0af
5 changed files with 9 additions and 7 deletions
+3 -3
View File
@@ -4,14 +4,14 @@ function controlInputMode(inputMode, ...args) {
const tab = gradioApp().querySelector('#control-tab-input button.selected');
if (!tab) return ['Image', ...args];
let inputTab = tab.innerText;
log('controlInputMode', inputMode, inputTab);
if ((inputTab === 'Image') && ('kanvas' in window)) {
log('controlInputMode', { mode: inputMode, tab: inputTab, kanvas: typeof Kanvas });
if ((inputTab === 'Image') && (typeof 'Kanvas' !== 'undefined')) {
inputTab = 'Kanvas';
// const imageData = window.kanvas.getImageData();
const imageData = window.kanvas.getImage();
args[0] = imageData;
}
return [inputMode, ...args];
return [inputTab, ...args];
}
async function setupControlUI() {