mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-04 11:12:35 +00:00
Add upscale slider to img2img
This commit is contained in:
@@ -8,8 +8,8 @@ function set_theme(theme){
|
||||
}
|
||||
|
||||
function selected_gallery_index(){
|
||||
var buttons = gradioApp().querySelectorAll('[style="display: block;"].tabitem div[id$=_gallery] .gallery-item')
|
||||
var button = gradioApp().querySelector('[style="display: block;"].tabitem div[id$=_gallery] .gallery-item.\\!ring-2')
|
||||
var buttons = gradioApp().querySelectorAll('[style="display: block;"].tabitem div[id$=_gallery] .thumbnails > .thumbnail-item')
|
||||
var button = gradioApp().querySelector('[style="display: block;"].tabitem div[id$=_gallery] .thumbnails > .thumbnail-item.selected')
|
||||
|
||||
var result = -1
|
||||
buttons.forEach(function(v, i){ if(v==button) { result = i } })
|
||||
@@ -111,6 +111,14 @@ function get_img2img_tab_index() {
|
||||
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')
|
||||
debugger;
|
||||
return res
|
||||
}
|
||||
|
||||
function create_submit_args(args){
|
||||
res = []
|
||||
for(var i=0;i<args.length;i++){
|
||||
@@ -335,3 +343,16 @@ function selectCheckpoint(name){
|
||||
desiredCheckpointName = name;
|
||||
gradioApp().getElementById('change_checkpoint').click()
|
||||
}
|
||||
|
||||
|
||||
function onCalcResolutionImg2Img(init_img, scale, width, height, resize_mode){
|
||||
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 [init_img, width, height, scale, resize_mode]
|
||||
}
|
||||
|
Reference in New Issue
Block a user