(req, img)
| 624 | } |
| 625 | |
| 626 | function onUseAsInputClick(req, img) { |
| 627 | const imgData = img.src |
| 628 | |
| 629 | initImageSelector.value = null |
| 630 | initImagePreview.src = imgData |
| 631 | |
| 632 | maskSetting.checked = false |
| 633 | |
| 634 | //Force the image settings size to match the input, as inpaint currently only works correctly |
| 635 | //if input image and generate sizes match. |
| 636 | addImageSizeOption(img.naturalWidth); |
| 637 | addImageSizeOption(img.naturalHeight); |
| 638 | widthField.value = img.naturalWidth; |
| 639 | heightField.value = img.naturalHeight; |
| 640 | } |
| 641 | |
| 642 | function onUseForControlnetClick(req, img) { |
| 643 | controlImagePreview.src = img.src |
no test coverage detected