Skip to content

Commit

Permalink
Merge pull request ArtVentureX#226 from MMP0/compact-layout-fix
Browse files Browse the repository at this point in the history
Fix Enqueue button not appearing in compact prompt layout
  • Loading branch information
artventuredev authored Mar 7, 2024
2 parents d23a705 + 20bed84 commit 721a36f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
13 changes: 9 additions & 4 deletions scripts/task_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def on_checkpoint_changed(self, checkpoint):

def after_component(self, component, **_kwargs):
generate_id = "txt2img_generate" if self.is_txt2img else "img2img_generate"
generate_box = "txt2img_generate_box" if self.is_txt2img else "img2img_generate_box"
actions_column_id = "txt2img_actions_column" if self.is_txt2img else "img2img_actions_column"
neg_id = "txt2img_neg_prompt" if self.is_txt2img else "img2img_neg_prompt"
toprow_id = "txt2img_toprow" if self.is_txt2img else "img2img_toprow"
Expand All @@ -106,11 +107,15 @@ def add_enqueue_row(elem_id):

if component.elem_id == generate_id:
self.generate_button = component
if getattr(shared.opts, "queue_button_placement", placement_under_generate) == placement_under_generate:
add_enqueue_row(actions_column_id)
if getattr(shared.opts, "compact_prompt_box", False):
add_enqueue_row(generate_box)
else:
if getattr(shared.opts, "queue_button_placement", placement_under_generate) == placement_under_generate:
add_enqueue_row(actions_column_id)
elif component.elem_id == neg_id:
if getattr(shared.opts, "queue_button_placement", placement_under_generate) == placement_between_prompt_and_generate:
add_enqueue_row(toprow_id)
if not getattr(shared.opts, "compact_prompt_box", False):
if getattr(shared.opts, "queue_button_placement", placement_under_generate) == placement_between_prompt_and_generate:
add_enqueue_row(toprow_id)

def on_app_started(self, block):
if self.generate_button is not None:
Expand Down
2 changes: 1 addition & 1 deletion style.css

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions ui/src/extension/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -375,22 +375,20 @@ button.ts-btn-action {
min-width: 210px;
display: flex;
flex-direction: column;
gap: 0;
gap: calc(var(--layout-gap) / 2);

> div:first-child {
flex-direction: row;
flex-wrap: nowrap;
align-items: stretch;
flex: 0 0 auto;
flex-grow: unset !important;
margin-bottom: calc(var(--layout-gap) / 2);
}
}

.gradio-button,
.gradio-dropdown .wrap-inner {
min-height: 36px;
max-height: 42px;
}
:not(#txt2img_generate_box) > #txt2img_enqueue_wrapper,
:not(#img2img_generate_box) > #img2img_enqueue_wrapper {
align-self: flex-start;
}

#img2img_toprow .interrogate-col.has-queue-button {
Expand Down

0 comments on commit 721a36f

Please sign in to comment.