diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-03-28 17:21:25 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-28 17:21:25 +0000 |
commit | 426875937048e21305ac24bea53df06523bdaa81 (patch) | |
tree | 6fdfb92d7d466b3b641b0cfd3cff8ab69ecde380 /javascript/ui.js | |
parent | 1b63afbedc7789c0eb9a4742b780ab304d7a9caf (diff) | |
parent | 4414d36bf6e4f64cb6eac871c89c2e0daa4c5338 (diff) | |
download | stable-diffusion-webui-gfx803-426875937048e21305ac24bea53df06523bdaa81.tar.gz stable-diffusion-webui-gfx803-426875937048e21305ac24bea53df06523bdaa81.tar.bz2 stable-diffusion-webui-gfx803-426875937048e21305ac24bea53df06523bdaa81.zip |
Merge pull request #7931 from space-nuko/img2img-enhance
Add `Upscale by` and `Upscaler` options to img2img
Diffstat (limited to 'javascript/ui.js')
-rw-r--r-- | javascript/ui.js | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/javascript/ui.js b/javascript/ui.js index 4a440193..a73eeaa2 100644 --- a/javascript/ui.js +++ b/javascript/ui.js @@ -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 []; +} |