mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-06-23 19:31:38 +02:00
Prevent invalid size settings for Use As Input
Images larger than the window size show up as blank sizes when setting the field. Retain previous (presumably valid) size rather than set an invalid one.
This commit is contained in:
parent
33ca04b916
commit
572b0329cf
@ -626,8 +626,15 @@ function onUseAsInputClick(req, img) {
|
|||||||
|
|
||||||
//Force the image settings size to match the input, as inpaint currently only works correctly
|
//Force the image settings size to match the input, as inpaint currently only works correctly
|
||||||
//if input image and generate sizes match.
|
//if input image and generate sizes match.
|
||||||
|
var tempWidth = widthField.value;
|
||||||
|
var tempHeight = heightField.value;
|
||||||
widthField.value = img.naturalWidth;
|
widthField.value = img.naturalWidth;
|
||||||
heightField.value = img.naturalHeight;
|
heightField.value = img.naturalHeight;
|
||||||
|
//If it's unhappy with the new values, restore the original values.
|
||||||
|
if (widthField.value=="" || heightField.value=="") {
|
||||||
|
widthField.value = tempWidth;
|
||||||
|
heightField.value = tempHeight;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onUseForControlnetClick(req, img) {
|
function onUseForControlnetClick(req, img) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user