MCPcopy Index your code
hub / github.com/easydiffusion/easydiffusion / onUseAsInputClick

Function onUseAsInputClick

ui/media/js/main.js:626–640  ·  view source on GitHub ↗
(req, img)

Source from the content-addressed store, hash-verified

624}
625
626function 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
642function onUseForControlnetClick(req, img) {
643 controlImagePreview.src = img.src

Callers 1

createInitImageHoverFunction · 0.85

Calls 1

addImageSizeOptionFunction · 0.85

Tested by

no test coverage detected