Skip to content

Commit

Permalink
finally solve wide image inpaint UI problem, curse gradio
Browse files Browse the repository at this point in the history
  • Loading branch information
lllyasviel committed Oct 20, 2023
1 parent 7075fd3 commit df93f73
Showing 7 changed files with 853 additions and 17 deletions.
67 changes: 67 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
@@ -26,3 +26,70 @@
.context-menu-items a:hover{
background: #a55000;
}

.canvas-tooltip-info {
position: absolute;
top: 10px;
left: 10px;
cursor: help;
background-color: rgba(0, 0, 0, 0.3);
width: 20px;
height: 20px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;

z-index: 100;
}

.canvas-tooltip-info::after {
content: '';
display: block;
width: 2px;
height: 7px;
background-color: white;
margin-top: 2px;
}

.canvas-tooltip-info::before {
content: '';
display: block;
width: 2px;
height: 2px;
background-color: white;
}

.canvas-tooltip-content {
display: none;
background-color: #f9f9f9;
color: #333;
border: 1px solid #ddd;
padding: 15px;
position: absolute;
top: 40px;
left: 10px;
width: 250px;
font-size: 16px;
opacity: 0;
border-radius: 8px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);

z-index: 100;
}

.canvas-tooltip:hover .canvas-tooltip-content {
display: block;
animation: fadeIn 0.5s;
opacity: 1;
}

@keyframes fadeIn {
from {opacity: 0;}
to {opacity: 1;}
}

.styler {
overflow:inherit !important;
}
2 changes: 1 addition & 1 deletion fooocus_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '2.1.719'
version = '2.1.720'
26 changes: 11 additions & 15 deletions javascript/script.js
Original file line number Diff line number Diff line change
@@ -105,7 +105,7 @@ var executedOnLoaded = false;

document.addEventListener("DOMContentLoaded", function() {
var mutationObserver = new MutationObserver(function(m) {
if (!executedOnLoaded && gradioApp().querySelector('#txt2img_prompt')) {
if (!executedOnLoaded && gradioApp().querySelector('#generate_button')) {
executedOnLoaded = true;
executeCallbacks(uiLoadedCallbacks);
}
@@ -125,20 +125,16 @@ document.addEventListener("DOMContentLoaded", function() {
* Add a ctrl+enter as a shortcut to start a generation
*/
document.addEventListener('keydown', function(e) {
const isEnter = e.key === 'Enter' || e.keyCode === 13;
const isModifierKey = e.metaKey || e.ctrlKey || e.altKey;

const interruptButton = get_uiCurrentTabContent().querySelector('button[id$=_interrupt]');
const generateButton = get_uiCurrentTabContent().querySelector('button[id$=_generate]');

if (isEnter && isModifierKey) {
if (interruptButton.style.display === 'block') {
interruptButton.click();
setTimeout(function() {
generateButton.click();
}, 500);
} else {
generateButton.click();
var handled = false;
if (e.key !== undefined) {
if ((e.key == "Enter" && (e.metaKey || e.ctrlKey || e.altKey))) handled = true;
} else if (e.keyCode !== undefined) {
if ((e.keyCode == 13 && (e.metaKey || e.ctrlKey || e.altKey))) handled = true;
}
if (handled) {
var button = gradioApp().querySelector('button[id=generate_button]');
if (button) {
button.click();
}
e.preventDefault();
}
Loading

0 comments on commit df93f73

Please sign in to comment.