mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
removed duplicate run_preprocess.click by creating run_preprocess_inputs list and appending deepbooru variable to input list if in scope
This commit is contained in:
parent
1f92336be7
commit
8ec069e64d
@ -1089,40 +1089,25 @@ def create_ui(wrap_gradio_gpu_call):
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
run_preprocess_inputs = [
|
||||||
|
process_src,
|
||||||
|
process_dst,
|
||||||
|
process_flip,
|
||||||
|
process_split,
|
||||||
|
process_caption,
|
||||||
|
]
|
||||||
if cmd_opts.deepdanbooru:
|
if cmd_opts.deepdanbooru:
|
||||||
# if process_caption_deepbooru is None, it will cause an error, as a result only include it if it is enabled
|
# if process_caption_deepbooru is None, it will cause an error, as a result only include it if it is enabled
|
||||||
run_preprocess.click(
|
run_preprocess_inputs.append(process_caption_deepbooru)
|
||||||
fn=wrap_gradio_gpu_call(modules.textual_inversion.ui.preprocess, extra_outputs=[gr.update()]),
|
run_preprocess.click(
|
||||||
_js="start_training_textual_inversion",
|
fn=wrap_gradio_gpu_call(modules.textual_inversion.ui.preprocess, extra_outputs=[gr.update()]),
|
||||||
inputs=[
|
_js="start_training_textual_inversion",
|
||||||
process_src,
|
inputs=run_preprocess_inputs,
|
||||||
process_dst,
|
outputs=[
|
||||||
process_flip,
|
ti_output,
|
||||||
process_split,
|
ti_outcome,
|
||||||
process_caption,
|
],
|
||||||
process_caption_deepbooru,
|
)
|
||||||
],
|
|
||||||
outputs=[
|
|
||||||
ti_output,
|
|
||||||
ti_outcome,
|
|
||||||
],
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
run_preprocess.click(
|
|
||||||
fn=wrap_gradio_gpu_call(modules.textual_inversion.ui.preprocess, extra_outputs=[gr.update()]),
|
|
||||||
_js="start_training_textual_inversion",
|
|
||||||
inputs=[
|
|
||||||
process_src,
|
|
||||||
process_dst,
|
|
||||||
process_flip,
|
|
||||||
process_split,
|
|
||||||
process_caption,
|
|
||||||
],
|
|
||||||
outputs=[
|
|
||||||
ti_output,
|
|
||||||
ti_outcome,
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
train_embedding.click(
|
train_embedding.click(
|
||||||
fn=wrap_gradio_gpu_call(modules.textual_inversion.ui.train_embedding, extra_outputs=[gr.update()]),
|
fn=wrap_gradio_gpu_call(modules.textual_inversion.ui.train_embedding, extra_outputs=[gr.update()]),
|
||||||
|
Loading…
Reference in New Issue
Block a user