Commit c5f9f7c2 authored by space-nuko's avatar space-nuko

Use .success() callback on img2img preview inputs change

parent 75e7eb91
...@@ -118,14 +118,6 @@ function get_img2img_tab_index_for_res_preview() { ...@@ -118,14 +118,6 @@ function get_img2img_tab_index_for_res_preview() {
return res 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){ function create_submit_args(args){
res = [] res = []
for(var i=0;i<args.length;i++){ for(var i=0;i<args.length;i++){
......
...@@ -855,7 +855,7 @@ def create_ui(): ...@@ -855,7 +855,7 @@ def create_ui():
img2img_resolution_preview_inputs = [dummy_component, # filled in by selected img2img tab index in _js img2img_resolution_preview_inputs = [dummy_component, # filled in by selected img2img tab index in _js
scale, width, height, resize_mode, scale, width, height, resize_mode,
init_img, sketch, init_img_with_mask, inpaint_color_sketch, init_img_inpaint] init_img, sketch, init_img_with_mask, inpaint_color_sketch, init_img_inpaint]
for input in img2img_resolution_preview_inputs: for input in img2img_resolution_preview_inputs[1:]:
if isinstance(input, Releaseable): if isinstance(input, Releaseable):
input.release( input.release(
fn=calc_resolution_img2img, fn=calc_resolution_img2img,
...@@ -863,8 +863,7 @@ def create_ui(): ...@@ -863,8 +863,7 @@ def create_ui():
inputs=img2img_resolution_preview_inputs, inputs=img2img_resolution_preview_inputs,
outputs=[final_resolution], outputs=[final_resolution],
show_progress=False, show_progress=False,
) ).success(
input.release(
None, None,
_js="onCalcResolutionImg2Img", _js="onCalcResolutionImg2Img",
inputs=img2img_resolution_preview_inputs, inputs=img2img_resolution_preview_inputs,
...@@ -878,8 +877,7 @@ def create_ui(): ...@@ -878,8 +877,7 @@ def create_ui():
inputs=img2img_resolution_preview_inputs, inputs=img2img_resolution_preview_inputs,
outputs=[final_resolution], outputs=[final_resolution],
show_progress=False, show_progress=False,
) ).success(
input.change(
None, None,
_js="onCalcResolutionImg2Img", _js="onCalcResolutionImg2Img",
inputs=img2img_resolution_preview_inputs, inputs=img2img_resolution_preview_inputs,
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment