Merge pull request #7931 from space-nuko/img2img-enhance

Add `Upscale by` and `Upscaler` options to img2img
This commit is contained in:
AUTOMATIC1111
2023-03-28 20:21:25 +03:00
committed by GitHub
7 changed files with 131 additions and 13 deletions

View File

@@ -132,7 +132,14 @@ function create_tab_index_args(tabId, args){
function get_img2img_tab_index() {
let res = args_to_array(arguments)
res.splice(-2)
res.splice(-2) // gradio also sends outputs to the arguments, pop them off
res[0] = get_tab_index('mode_img2img')
return res
}
function get_img2img_tab_index_for_res_preview() {
let res = args_to_array(arguments)
res.splice(-1) // gradio also sends outputs to the arguments, pop them off
res[0] = get_tab_index('mode_img2img')
return res
}
@@ -361,3 +368,16 @@ function selectCheckpoint(name){
desiredCheckpointName = name;
gradioApp().getElementById('change_checkpoint').click()
}
function onCalcResolutionImg2Img(mode, scale, width, height, resize_mode, init_img, sketch, init_img_with_mask, inpaint_color_sketch, init_img_inpaint){
i2iScale = gradioApp().getElementById('img2img_scale')
i2iWidth = gradioApp().getElementById('img2img_width')
i2iHeight = gradioApp().getElementById('img2img_height')
setInactive(i2iScale, scale == 1)
setInactive(i2iWidth, scale > 1)
setInactive(i2iHeight, scale > 1)
return [];
}