diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-10-14 17:31:49 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-10-14 17:31:49 +0000 |
commit | c344ba3b325459abbf9b0df2c1b18f7bf99805b2 (patch) | |
tree | a55413118729c0ccabb51cd4b94bbe1ada508351 /modules/ui.py | |
parent | bb295f54785ac36dc6aa6f7103a3431464440fc3 (diff) | |
download | stable-diffusion-webui-gfx803-c344ba3b325459abbf9b0df2c1b18f7bf99805b2.tar.gz stable-diffusion-webui-gfx803-c344ba3b325459abbf9b0df2c1b18f7bf99805b2.tar.bz2 stable-diffusion-webui-gfx803-c344ba3b325459abbf9b0df2c1b18f7bf99805b2.zip |
add option to read generation params for learning previews from txt2img
Diffstat (limited to 'modules/ui.py')
-rw-r--r-- | modules/ui.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/modules/ui.py b/modules/ui.py index 828bfeea..4a04c2cc 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -711,6 +711,18 @@ def create_ui(wrap_gradio_gpu_call): (firstphase_width, "First pass size-1"),
(firstphase_height, "First pass size-2"),
]
+
+ txt2img_preview_params = [
+ txt2img_prompt,
+ txt2img_negative_prompt,
+ steps,
+ sampler_index,
+ cfg_scale,
+ seed,
+ width,
+ height,
+ ]
+
token_button.click(fn=update_token_counter, inputs=[txt2img_prompt, steps], outputs=[token_counter])
with gr.Blocks(analytics_enabled=False) as img2img_interface:
@@ -1162,7 +1174,7 @@ def create_ui(wrap_gradio_gpu_call): create_image_every = gr.Number(label='Save an image to log directory every N steps, 0 to disable', value=500, precision=0)
save_embedding_every = gr.Number(label='Save a copy of embedding to log directory every N steps, 0 to disable', value=500, precision=0)
save_image_with_stored_embedding = gr.Checkbox(label='Save images with embedding in PNG chunks', value=True)
- preview_image_prompt = gr.Textbox(label='Preview prompt', value="")
+ preview_from_txt2img = gr.Checkbox(label='Read parameters (prompt, etc...) from txt2img tab when making previews', value=False)
with gr.Row():
interrupt_training = gr.Button(value="Interrupt")
@@ -1240,7 +1252,8 @@ def create_ui(wrap_gradio_gpu_call): save_embedding_every,
template_file,
save_image_with_stored_embedding,
- preview_image_prompt,
+ preview_from_txt2img,
+ *txt2img_preview_params,
],
outputs=[
ti_output,
@@ -1260,7 +1273,8 @@ def create_ui(wrap_gradio_gpu_call): create_image_every,
save_embedding_every,
template_file,
- preview_image_prompt,
+ preview_from_txt2img,
+ *txt2img_preview_params,
],
outputs=[
ti_output,
|