mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-06-22 10:51:33 +02:00
Merge pull request #1874 from AvidGameFan/inpaint_mask_size
Remove inpaint size limit
This commit is contained in:
commit
f737921eaa
@ -557,14 +557,17 @@ class ImageEditor {
|
|||||||
if (width == this.width && height == this.height) {
|
if (width == this.width && height == this.height) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
//The below code tries to limit the size of the image to fit within the editor window.
|
||||||
|
//However, at this time, this causes problems with a mis-match between the mask size and
|
||||||
|
//the requested image size. For now, allow the drawing/inpaint window to be as large
|
||||||
|
//as necessary.
|
||||||
if (width > height) {
|
if (width > height) {
|
||||||
var max_size = Math.min(parseInt(window.innerWidth * 0.9), width, 768)
|
var max_size = width; //Math.min(parseInt(window.innerWidth * 0.9), width)
|
||||||
var multiplier = max_size / width
|
var multiplier = max_size / width
|
||||||
width = (multiplier * width).toFixed()
|
width = (multiplier * width).toFixed()
|
||||||
height = (multiplier * height).toFixed()
|
height = (multiplier * height).toFixed()
|
||||||
} else {
|
} else {
|
||||||
var max_size = Math.min(parseInt(window.innerHeight * 0.9), height, 768)
|
var max_size = height; //Math.min(parseInt(window.innerHeight * 0.9), height)
|
||||||
var multiplier = max_size / height
|
var multiplier = max_size / height
|
||||||
width = (multiplier * width).toFixed()
|
width = (multiplier * width).toFixed()
|
||||||
height = (multiplier * height).toFixed()
|
height = (multiplier * height).toFixed()
|
||||||
|
@ -623,6 +623,13 @@ function onUseAsInputClick(req, img) {
|
|||||||
initImagePreview.src = imgData
|
initImagePreview.src = imgData
|
||||||
|
|
||||||
maskSetting.checked = false
|
maskSetting.checked = false
|
||||||
|
|
||||||
|
//Force the image settings size to match the input, as inpaint currently only works correctly
|
||||||
|
//if input image and generate sizes match.
|
||||||
|
addImageSizeOption(img.naturalWidth);
|
||||||
|
addImageSizeOption(img.naturalHeight);
|
||||||
|
widthField.value = img.naturalWidth;
|
||||||
|
heightField.value = img.naturalHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onUseForControlnetClick(req, img) {
|
function onUseForControlnetClick(req, img) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user