(self)
| 122 | self.bind_enqueue_button(block) |
| 123 | |
| 124 | def add_enqueue_button(self): |
| 125 | id_part = "img2img" if self.is_img2img else "txt2img" |
| 126 | with gr.Row(elem_id=f"{id_part}_enqueue_wrapper") as row: |
| 127 | self.enqueue_row = row |
| 128 | hide_checkpoint = getattr(shared.opts, "queue_button_hide_checkpoint", True) |
| 129 | self.checkpoint_dropdown = gr.Dropdown( |
| 130 | choices=get_checkpoint_choices(), |
| 131 | value=checkpoint_current, |
| 132 | show_label=False, |
| 133 | interactive=True, |
| 134 | visible=not hide_checkpoint, |
| 135 | ) |
| 136 | if not hide_checkpoint: |
| 137 | create_refresh_button( |
| 138 | self.checkpoint_dropdown, |
| 139 | refresh_checkpoints, |
| 140 | lambda: {"choices": get_checkpoint_choices()}, |
| 141 | f"refresh_{id_part}_checkpoint", |
| 142 | ) |
| 143 | self.submit_button = gr.Button("Enqueue", elem_id=f"{id_part}_enqueue", variant="primary") |
| 144 | |
| 145 | def bind_enqueue_button(self, root: gr.Blocks): |
| 146 | generate = self.generate_button |
no test coverage detected