Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
automatic1111
GitHub Repository: automatic1111/stable-diffusion-webui
Path: blob/master/javascript/hires_fix.js
3055 views
1
2
function onCalcResolutionHires(enable, width, height, hr_scale, hr_resize_x, hr_resize_y) {
3
function setInactive(elem, inactive) {
4
elem.classList.toggle('inactive', !!inactive);
5
}
6
7
var hrUpscaleBy = gradioApp().getElementById('txt2img_hr_scale');
8
var hrResizeX = gradioApp().getElementById('txt2img_hr_resize_x');
9
var hrResizeY = gradioApp().getElementById('txt2img_hr_resize_y');
10
11
gradioApp().getElementById('txt2img_hires_fix_row2').style.display = opts.use_old_hires_fix_width_height ? "none" : "";
12
13
setInactive(hrUpscaleBy, opts.use_old_hires_fix_width_height || hr_resize_x > 0 || hr_resize_y > 0);
14
setInactive(hrResizeX, opts.use_old_hires_fix_width_height || hr_resize_x == 0);
15
setInactive(hrResizeY, opts.use_old_hires_fix_width_height || hr_resize_y == 0);
16
17
return [enable, width, height, hr_scale, hr_resize_x, hr_resize_y];
18
}
19
20