MCPcopy Create free account
hub / github.com/easydiffusion/easydiffusion / onUpscaleClick

Function onUpscaleClick

ui/media/js/main.js:1007–1026  ·  view source on GitHub ↗
(req, img, e, tools)

Source from the content-addressed store, hash-verified

1005}
1006
1007function onUpscaleClick(req, img, e, tools) {
1008 let path = upscaleModelField.value
1009 let scale = parseInt(upscaleAmountField.value)
1010
1011 let filterName = null
1012 const FILTERS = ["realesrgan", "latent_upscaler", "esrgan_4x", "lanczos", "nearest", "scunet", "swinir"]
1013 for (let idx in FILTERS) {
1014 let f = FILTERS[idx]
1015 if (path.toLowerCase().includes(f)) {
1016 filterName = f
1017 break
1018 }
1019 }
1020
1021 if (!filterName) {
1022 return
1023 }
1024 let statusText = "Upscaling by " + scale + "x using " + filterName
1025 applyInlineFilter(filterName, path, { scale: scale }, img, statusText, tools)
1026}
1027
1028function onFixFacesClick(req, img, e, tools) {
1029 let path = gfpganModelField.value

Callers

nothing calls this directly

Calls 1

applyInlineFilterFunction · 0.85

Tested by

no test coverage detected