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

Function addImageSizeOption

ui/media/js/main.js:3039–3052  ·  view source on GitHub ↗
(size)

Source from the content-addressed store, hash-verified

3037}
3038
3039function addImageSizeOption(size) {
3040 let sizes = Object.values(widthField.options).map((o) => o.value)
3041 if (!sizes.includes(String(size))) {
3042 sizes.push(String(size))
3043 sizes.sort((a, b) => Number(a) - Number(b))
3044
3045 let option = document.createElement("option")
3046 option.value = size
3047 option.text = `${size}`
3048
3049 widthField.add(option, sizes.indexOf(String(size)))
3050 heightField.add(option.cloneNode(true), sizes.indexOf(String(size)))
3051 }
3052}
3053
3054function setImageWidthHeight(w, h) {
3055 let step = customWidthField.step

Callers 6

dnd.jsFile · 0.85
onUseAsInputClickFunction · 0.85
controlImageLoadFunction · 0.85
setImageWidthHeightFunction · 0.85
main.jsFile · 0.85

Calls 2

pushMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected