control implement image measure

This commit is contained in:
Vladimir Mandic
2024-01-20 08:12:31 -05:00
parent 71654cee9c
commit ddecb8f240
3 changed files with 10 additions and 5 deletions
+6 -1
View File
@@ -419,11 +419,16 @@ function selectReference(name) {
gradioApp().getElementById('change_reference').click();
}
function currentImg2imgSourceResolution(_a, _b, scaleBy) {
function currentImageResolutionimg2img(_a, _b, scaleBy) {
const img = gradioApp().querySelector('#mode_img2img > div[style="display: block;"] img');
return img ? [img.naturalWidth, img.naturalHeight, scaleBy] : [0, 0, scaleBy];
}
function currentImageResolutioncontrol(_a, _b, scaleBy) {
const img = gradioApp().querySelector('#control-tab-input > div[style="display: block;"] img');
return img ? [img.naturalWidth, img.naturalHeight, scaleBy] : [0, 0, scaleBy];
}
function updateImg2imgResizeToTextAfterChangingImage() {
setTimeout(() => gradioApp().getElementById('img2img_update_resize_to').click(), 500);
return [];