Skip to content

Commit

Permalink
feat: make textboxes (incl. positive prompt) resizable (lllyasviel#3074)
Browse files Browse the repository at this point in the history
* feat: make textboxes (incl. positive prompt) resizable again

* wip: auto-resize positive prompt on new line

dirty approach as container is hidden and 1px padding is applied for border shadow to actually work

* feat: set row height to 84, exactly matching 3 lines for positive prompt

eliminate need for JS to resize positive prompt onUiLoaded
  • Loading branch information
mashb1t authored and csokun committed Jun 16, 2024
1 parent 1ed8bb7 commit 0395997
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
22 changes: 13 additions & 9 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,31 +74,35 @@ progress::after {
text-align: right;
width: 215px;
}
div:has(> #positive_prompt) {
border: none;
}

.type_row{
height: 80px !important;
#positive_prompt {
padding: 1px;
background: var(--background-fill-primary);
}

.type_row_half{
height: 32px !important;
.type_row {
height: 84px !important;
}

.scroll-hide{
resize: none !important;
.type_row_half {
height: 34px !important;
}

.refresh_button{
.refresh_button {
border: none !important;
background: none !important;
font-size: none !important;
box-shadow: none !important;
}

.advanced_check_row{
.advanced_check_row {
width: 250px !important;
}

.min_check{
.min_check {
min-width: min(1px, 100%) !important;
}

Expand Down
4 changes: 2 additions & 2 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ def generate_clicked(task: worker.AsyncTask):
gallery = gr.Gallery(label='Gallery', show_label=False, object_fit='contain', visible=True, height=768,
elem_classes=['resizable_area', 'main_view', 'final_gallery', 'image_gallery'],
elem_id='final_gallery')
with gr.Row(elem_classes='type_row'):
with gr.Row():
with gr.Column(scale=17):
prompt = gr.Textbox(show_label=False, placeholder="Type prompt here or paste parameters.", elem_id='positive_prompt',
container=False, autofocus=True, elem_classes='type_row', lines=1024)
autofocus=True, lines=3)

default_prompt = modules.config.default_prompt
if isinstance(default_prompt, str) and default_prompt != '':
Expand Down

0 comments on commit 0395997

Please sign in to comment.