mirror of
https://github.com/vladmandic/automatic
synced 2026-09-07 21:40:46 +02:00
better detect input source
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user