Skip to content

Commit

Permalink
fix merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
anapnoe committed May 13, 2023
1 parent a1a0b74 commit ddd44e4
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 84 deletions.
File renamed without changes.
67 changes: 18 additions & 49 deletions javascript/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,6 @@ function restoreProgressImg2img() {
return id;
}

onUiLoaded(function () {
showRestoreProgressButton("txt2img", localStorage.getItem("txt2img_task_id"));
showRestoreProgressButton("img2img", localStorage.getItem("img2img_task_id"));
});

function modelmerger() {
var id = randomId();
requestProgress(
Expand Down Expand Up @@ -334,16 +329,13 @@ function recalculate_prompts_img2img() {
return args_to_array(arguments);
}

function recalculate_prompts_inpaint() {
recalculatePromptTokens("img2img_prompt");
recalculatePromptTokens("img2img_neg_prompt");
return args_to_array(arguments);
}

let selectedTabItemId = "tab_txt2img";
let opts = {};

onUiUpdate(function () {
onUiLoaded(function () {
showRestoreProgressButton("txt2img", localStorage.getItem("txt2img_task_id"));
showRestoreProgressButton("img2img", localStorage.getItem("img2img_task_id"));

if (Object.keys(opts).length != 0) return;

var json_elem = gradioApp().getElementById("settings_json");
Expand Down Expand Up @@ -515,7 +507,6 @@ onUiUpdate(function () {
//window.dispatchEvent(resizeEvent);
}


function mouseUpHandler() {
resizer.style.removeProperty("cursor");
container.style.removeProperty("cursor");
Expand All @@ -526,30 +517,6 @@ onUiUpdate(function () {
container.removeEventListener("mousemove", mouseMoveHandler);
container.removeEventListener("mouseup", mouseUpHandler);
//window.dispatchEvent(resizeEvent);

prompt.parentElement.insertBefore(counter, prompt)
prompt.parentElement.style.position = "relative"

promptTokecountUpdateFuncs[id] = function(){ update_token_counter(id_button); }
textarea.addEventListener("input", promptTokecountUpdateFuncs[id]);
}

registerTextarea('txt2img_prompt', 'txt2img_token_counter', 'txt2img_token_button')
registerTextarea('txt2img_neg_prompt', 'txt2img_negative_token_counter', 'txt2img_negative_token_button')
registerTextarea('img2img_prompt', 'img2img_token_counter', 'img2img_token_button')
registerTextarea('img2img_neg_prompt', 'img2img_negative_token_counter', 'img2img_negative_token_button')

var show_all_pages = gradioApp().getElementById('settings_show_all_pages')
var settings_tabs = gradioApp().querySelector('#settings div')
if(show_all_pages && settings_tabs){
settings_tabs.appendChild(show_all_pages)
show_all_pages.onclick = function(){
gradioApp().querySelectorAll('#settings > div').forEach(function(elem){
if(elem.id == "settings_tab_licenses")
return;

elem.style.display = "block";
})
}

container.addEventListener("mousemove", mouseMoveHandler);
Expand Down Expand Up @@ -1936,7 +1903,6 @@ function update_token_counter(button_id) {
);
}


function restart_reload() {
let bg_color = window
.getComputedStyle(gradioApp().querySelector("#header-top"))
Expand All @@ -1948,8 +1914,6 @@ function restart_reload() {
.getComputedStyle(gradioApp().querySelector(".gradio-box"))
.getPropertyValue("--ae-panel-bg-color");



localStorage.setItem("bg_color", bg_color);
localStorage.setItem("primary_color", primary_color);
localStorage.setItem("panel_color", panel_color);
Expand Down Expand Up @@ -1977,15 +1941,20 @@ function restart_reload() {
document.body.innerHTML =
'<div class="loader"><div class="circles"><span class="one"></span><span class="two"></span><span class="three"></span></div><div class="pacman"><span class="top"></span><span class="bottom"></span><span class="left"></span><div class="eye"></div></div></div>';

var requestPing = function(){
requestGet("./internal/ping", {}, function(data){
location.reload();
}, function(){
setTimeout(requestPing, 500);
})
}

setTimeout(requestPing, 2000);
var requestPing = function () {
requestGet(
"./internal/ping",
{},
function (data) {
location.reload();
},
function () {
setTimeout(requestPing, 500);
}
);
};

setTimeout(requestPing, 2000);

return [];
}
Expand Down
2 changes: 1 addition & 1 deletion modules/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2075,7 +2075,7 @@ def versions_html():
<li><span>torch: </span> {getattr(torch, '__long_version__',torch.__version__)}</li>
<li><span>xformers: </span> {xformers_version}</li>
<li><span>gradio: </span> {gr.__version__}</li>
<li><span>commit: <a href="https://github.com/anapnoe/stable-diffusion-webui-ux/commit/{commit}"></span>{short_commit}</a></li>
<li><span>commit: <a href="https://github.com/anapnoe/stable-diffusion-webui-ux/commit/{commit}"></span>{tag}</a></li>
<li><span>checkpoint: </span><a id="sd_checkpoint_hash">N/A</a></li>
</ul>
"""
Expand Down
126 changes: 92 additions & 34 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ License: GNU General Public License
(
var(--ae-top-header-height) + var(--ae-footer-height) +
var(--ae-accordion-header-height) + var(--ae-outside-gap-size) * 4 +
38px
34px
)
);
}

@media only screen and (max-width: 860px) {
@media only screen and (max-width: 680px) {
:root {
--ae-outside-gap-size: var(--ae-mobile-outside-gap-size);
--ae-inside-padding-size: var(--ae-mobile-inside-padding-size);
Expand Down Expand Up @@ -776,7 +776,7 @@ div.float {
min-height: auto;
width: 100%;
min-width: 100%;
max-height: calc(var(--container-height) - 4px);
max-height: calc(var(--ae-container-height) - 4px);
}

[id$="2img_override_settings_row"] > div.form.show,
Expand Down Expand Up @@ -1017,16 +1017,31 @@ div.token-remove {
border-radius: var(--ae-panel-border-radius);
line-height: var(--ae-accordion-line-height);
color: var(--ae-label-color);
padding-left: max(8px, var(--ae-accordion-horizontal-padding));
padding-right: max(8px, var(--ae-accordion-horizontal-padding));
/*pointer-events: none !important;*/
}

.tab-nav {
padding: 4px 4px 0;
}
#extras_params,
#extras_metadata {
padding: 0px 4px 4px !important;
}

#pnginfo_html2_info > div > b {
color: var(--ae-primary-color);
text-transform: capitalize;
}

.block.gradio-accordion .hide + .open.label-wrap {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}

.block.gradio-accordion .label-wrap.open {
/*margin-bottom: var(--ae-inside-padding-size);*/
margin-bottom: var(--ae-inside-padding-size);
/*margin-bottom:0;*/
}

Expand All @@ -1038,6 +1053,10 @@ div.token-remove {
margin-top: 0 !important;
}

#extras_resize_mode {
flex-wrap: nowrap;
}

/* [id$="_subdirs"] select{
width:100%;
background-color:var(--ae-input-bg-color);
Expand All @@ -1054,7 +1073,7 @@ div.token-remove {
}

.block.gradio-accordion > div.wrap {
pointer-events: all !important;
pointer-events: none !important;
cursor: pointer;
width: auto !important;
height: var(--ae-accordion-header-height) !important;
Expand Down Expand Up @@ -1161,7 +1180,7 @@ button.secondary {
text-align: center !important;
}

.gradio-container-3-28-1 .prose * {
.gradio-container-3-29-0 .prose * {
color: var(--ae-label-color);
}

Expand All @@ -1176,34 +1195,34 @@ button.secondary {

.wrap.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt label,
.wrap.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04 label,
.gradio-container-3-28-1 [type="text"],
.gradio-container-3-28-1 [type="email"],
.gradio-container-3-28-1 [type="url"],
.gradio-container-3-28-1 [type="password"],
.gradio-container-3-28-1 [type="number"],
.gradio-container-3-28-1 [type="date"],
.gradio-container-3-28-1 [type="datetime-local"],
.gradio-container-3-28-1 [type="month"],
.gradio-container-3-28-1 [type="search"],
.gradio-container-3-28-1 [type="tel"],
.gradio-container-3-28-1 [type="time"],
.gradio-container-3-28-1 [type="week"],
.gradio-container-3-28-1 [multiple],
.gradio-container-3-28-1 textarea,
.gradio-container-3-28-1 select {
.gradio-container-3-29-0 [type="text"],
.gradio-container-3-29-0 [type="email"],
.gradio-container-3-29-0 [type="url"],
.gradio-container-3-29-0 [type="password"],
.gradio-container-3-29-0 [type="number"],
.gradio-container-3-29-0 [type="date"],
.gradio-container-3-29-0 [type="datetime-local"],
.gradio-container-3-29-0 [type="month"],
.gradio-container-3-29-0 [type="search"],
.gradio-container-3-29-0 [type="tel"],
.gradio-container-3-29-0 [type="time"],
.gradio-container-3-29-0 [type="week"],
.gradio-container-3-29-0 [multiple],
.gradio-container-3-29-0 textarea,
.gradio-container-3-29-0 select {
line-height: 1.5rem;
padding: 4px 8px;
}

.gradio-container-3-28-1 [type="checkbox"],
.gradio-container-3-28-1 [type="radio"] {
.gradio-container-3-29-0 [type="checkbox"],
.gradio-container-3-29-0 [type="radio"] {
background-color: var(--ae-input-bg-color);
border: 1px solid var(--ae-input-border-color);
border-radius: var(--ae-panel-border-radius);
}

.gradio-container-3-28-1 [type="checkbox"]:checked,
.gradio-container-3-28-1 [type="radio"]:checked {
.gradio-container-3-29-0 [type="checkbox"]:checked,
.gradio-container-3-29-0 [type="radio"]:checked {
background-color: var(--ae-primary-color);
}

Expand Down Expand Up @@ -1573,7 +1592,7 @@ span.ml-2 {
padding: var(--ae-inside-padding-size) !important;
}

.gradio-container-3-28-1 .prose {
.gradio-container-3-29-0 .prose {
min-height: unset !important;
}

Expand Down Expand Up @@ -1916,7 +1935,7 @@ button.primary:hover {
pointer-events: none;
content: "";
position: absolute;
z-index: 1;
z-index: 999;
height: calc(
var(--ae-container-height-gap) - var(--ae-generate-button-height)
);
Expand All @@ -1929,8 +1948,8 @@ button.primary:hover {
background: linear-gradient(
0deg,
var(--ae-main-bg-color),
transparent 2%,
transparent 98%,
transparent 0%,
transparent 99%,
var(--ae-main-bg-color) 100%
);
}
Expand Down Expand Up @@ -2928,7 +2947,7 @@ pre {
opacity: 0.98;
}

@media only screen and (max-width: 860px) {
@media only screen and (max-width: 680px) {
/* For tablets: */
[id$="_splitter"] {
display: none !important;
Expand Down Expand Up @@ -3378,11 +3397,50 @@ li.coffee-circle {
margin-right: 5px;
}

.coffee-circle .tooltip-html .top {
width: 320px;
max-width: 320px;
text-align: left;
padding: 16px;
}

li.coffee-circle p {
font-size: 12px;
line-height: 18px;
text-align: center;
padding-top: 8px;
color: var(--ae-text-color);
float: inherit;
padding: 0;
font-size: 14px;
line-height: 16px !important;
/*text-align: justify;*/
padding-bottom: 4px;
}
li.coffee-circle p b {
color: var(--ae-primary-color) !important;
font-weight: normal;
}
.coffee-circle .tooltip-html .top > svg,
.coffee-circle .tooltip-html .top > img {
/*float: left;
margin-right: 5px;*/
margin-bottom: 8px;
width: 60%;
}
.coffee-circle .tooltip-html .top blockquote {
background: var(--ae-frame-bg-color);
padding: 10px;
quotes: "\201C""\201D""\2018""\2019";
border: 0;
margin: 8px 0 !important;
}
.coffee-circle .tooltip-html .top blockquote:before {
opacity: 0.5;
content: open-quote;
font-size: 3em;
line-height: 0.1em;
margin-right: 0.15em;
vertical-align: -0.4em;
}
.coffee-circle .tooltip-html .top blockquote p {
display: inline;
}

.coffee svg path {
Expand Down

1 comment on commit ddd44e4

@fu4dh4s4n
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just at the previous commit and it was failing, didn't know what to do so kept refreshing the history and here it is 😂, thank you.

Please sign in to comment.