Skip to content

Commit

Permalink
Merge pull request #2558 from lllyasviel/develop
Browse files Browse the repository at this point in the history
release 2.3.0
  • Loading branch information
mashb1t authored Mar 18, 2024
2 parents d057f2f + 3efce58 commit a1bda88
Show file tree
Hide file tree
Showing 30 changed files with 639 additions and 302 deletions.
6 changes: 3 additions & 3 deletions args_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from tempfile import gettempdir

args_parser.parser.add_argument("--share", action='store_true', help="Set whether to share on Gradio.")

args_parser.parser.add_argument("--preset", type=str, default=None, help="Apply specified UI preset.")
args_parser.parser.add_argument("--disable-preset-selection", action='store_true',
help="Disables preset selection in Gradio.")

args_parser.parser.add_argument("--language", type=str, default='default',
help="Translate UI using json files in [language] folder. "
Expand Down Expand Up @@ -49,7 +52,4 @@
if args_parser.args.disable_in_browser:
args_parser.args.in_browser = False

if args_parser.args.temp_path is None:
args_parser.args.temp_path = os.path.join(gettempdir(), 'Fooocus')

args = args_parser.args
176 changes: 176 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,136 @@
/* based on https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/v1.6.0/style.css */

.loader-container {
display: flex; /* Use flex to align items horizontally */
align-items: center; /* Center items vertically within the container */
white-space: nowrap; /* Prevent line breaks within the container */
}

.loader {
border: 8px solid #f3f3f3; /* Light grey */
border-top: 8px solid #3498db; /* Blue */
border-radius: 50%;
width: 30px;
height: 30px;
animation: spin 2s linear infinite;
}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

/* Style the progress bar */
progress {
appearance: none; /* Remove default styling */
height: 20px; /* Set the height of the progress bar */
border-radius: 5px; /* Round the corners of the progress bar */
background-color: #f3f3f3; /* Light grey background */
width: 100%;
}

/* Style the progress bar container */
.progress-container {
margin-left: 20px;
margin-right: 20px;
flex-grow: 1; /* Allow the progress container to take up remaining space */
}

/* Set the color of the progress bar fill */
progress::-webkit-progress-value {
background-color: #3498db; /* Blue color for the fill */
}

progress::-moz-progress-bar {
background-color: #3498db; /* Blue color for the fill in Firefox */
}

/* Style the text on the progress bar */
progress::after {
content: attr(value '%'); /* Display the progress value followed by '%' */
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white; /* Set text color */
font-size: 14px; /* Set font size */
}

/* Style other texts */
.loader-container > span {
margin-left: 5px; /* Add spacing between the progress bar and the text */
}

.progress-bar > .generating {
display: none !important;
}

.progress-bar{
height: 30px !important;
}

.type_row{
height: 80px !important;
}

.type_row_half{
height: 32px !important;
}

.scroll-hide{
resize: none !important;
}

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

.advanced_check_row{
width: 250px !important;
}

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

.resizable_area {
resize: vertical;
overflow: auto !important;
}

.aspect_ratios label {
width: 140px !important;
}

.aspect_ratios label span {
white-space: nowrap !important;
}

.aspect_ratios label input {
margin-left: -5px !important;
}

.lora_enable label {
height: 100%;
}

.lora_enable label input {
margin: auto;
}

.lora_enable label span {
display: none;
}

@-moz-document url-prefix() {
.lora_weight input[type=number] {
width: 80px;
}
}

#context-menu{
z-index:9999;
position:absolute;
Expand Down Expand Up @@ -218,3 +349,48 @@
#stylePreviewOverlay.lower-half {
transform: translate(-140px, -140px);
}

/* scrollable box for style selections */
.contain .tabs {
height: 100%;
}

.contain .tabs .tabitem.style_selections_tab {
height: 100%;
}

.contain .tabs .tabitem.style_selections_tab > div:first-child {
height: 100%;
}

.contain .tabs .tabitem.style_selections_tab .style_selections {
min-height: 200px;
height: 100%;
}

.contain .tabs .tabitem.style_selections_tab .style_selections .wrap[data-testid="checkbox-group"] {
position: absolute; /* remove this to disable scrolling within the checkbox-group */
overflow: auto;
padding-right: 2px;
max-height: 100%;
}

.contain .tabs .tabitem.style_selections_tab .style_selections .wrap[data-testid="checkbox-group"] label {
/* max-width: calc(35% - 15px) !important; */ /* add this to enable 3 columns layout */
flex: calc(50% - 5px) !important;
}

.contain .tabs .tabitem.style_selections_tab .style_selections .wrap[data-testid="checkbox-group"] label span {
/* white-space:nowrap; */ /* add this to disable text wrapping (better choice for 3 columns layout) */
overflow: hidden;
text-overflow: ellipsis;
}

/* styles preview tooltip */
.preview-tooltip {
background-color: #fff8;
font-family: monospace;
text-align: center;
border-radius-top: 5px;
display: none; /* remove this to enable tooltip in preview image */
}
2 changes: 1 addition & 1 deletion fooocus_colab.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"%cd /content\n",
"!git clone https://github.com/lllyasviel/Fooocus.git\n",
"%cd /content/Fooocus\n",
"!python entry_with_update.py --share\n"
"!python entry_with_update.py --share --always-high-vram\n"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion fooocus_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '2.2.1'
version = '2.3.0'
16 changes: 11 additions & 5 deletions javascript/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,12 @@ function initStylePreviewOverlay() {
let overlayVisible = false;
const samplesPath = document.querySelector("meta[name='samples-path']").getAttribute("content")
const overlay = document.createElement('div');
const tooltip = document.createElement('div');
tooltip.className = 'preview-tooltip';
overlay.appendChild(tooltip);
overlay.id = 'stylePreviewOverlay';
document.body.appendChild(overlay);
document.addEventListener('mouseover', function(e) {
document.addEventListener('mouseover', function (e) {
const label = e.target.closest('.style_selections label');
if (!label) return;
label.removeEventListener("mouseout", onMouseLeave);
Expand All @@ -162,18 +165,21 @@ function initStylePreviewOverlay() {
const originalText = label.querySelector("span").getAttribute("data-original-text");
const name = originalText || label.querySelector("span").textContent;
overlay.style.backgroundImage = `url("${samplesPath.replace(
"fooocus_v2",
name.toLowerCase().replaceAll(" ", "_")
"fooocus_v2",
name.toLowerCase().replaceAll(" ", "_")
).replaceAll("\\", "\\\\")}")`;

tooltip.textContent = name;

function onMouseLeave() {
overlayVisible = false;
overlay.style.opacity = "0";
overlay.style.backgroundImage = "";
label.removeEventListener("mouseout", onMouseLeave);
}
});
document.addEventListener('mousemove', function(e) {
if(!overlayVisible) return;
document.addEventListener('mousemove', function (e) {
if (!overlayVisible) return;
overlay.style.left = `${e.clientX}px`;
overlay.style.top = `${e.clientY}px`;
overlay.className = e.clientY > window.innerHeight / 2 ? "lower-half" : "upper-half";
Expand Down
8 changes: 6 additions & 2 deletions language/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@
"* \"Inpaint or Outpaint\" is powered by the sampler \"DPMPP Fooocus Seamless 2M SDE Karras Inpaint Sampler\" (beta)": "* \"Inpaint or Outpaint\" is powered by the sampler \"DPMPP Fooocus Seamless 2M SDE Karras Inpaint Sampler\" (beta)",
"Setting": "Setting",
"Style": "Style",
"Preset": "Preset",
"Performance": "Performance",
"Speed": "Speed",
"Quality": "Quality",
"Extreme Speed": "Extreme Speed",
"Lightning": "Lightning",
"Aspect Ratios": "Aspect Ratios",
"width \u00d7 height": "width \u00d7 height",
"Image Number": "Image Number",
Expand All @@ -50,6 +53,7 @@
"Seed": "Seed",
"Disable seed increment": "Disable seed increment",
"Disable automatic seed increment when image number is > 1.": "Disable automatic seed increment when image number is > 1.",
"Read wildcards in order": "Read wildcards in order",
"\ud83d\udcda History Log": "\uD83D\uDCDA History Log",
"Image Style": "Image Style",
"Fooocus V2": "Fooocus V2",
Expand Down Expand Up @@ -367,7 +371,6 @@
"B2": "B2",
"S1": "S1",
"S2": "S2",
"Extreme Speed": "Extreme Speed",
"\uD83D\uDD0E Type here to search styles ...": "\uD83D\uDD0E Type here to search styles ...",
"Type prompt here.": "Type prompt here.",
"Outpaint Expansion Direction:": "Outpaint Expansion Direction:",
Expand All @@ -381,5 +384,6 @@
"Metadata Scheme": "Metadata Scheme",
"Image Prompt parameters are not included. Use png and a1111 for compatibility with Civitai.": "Image Prompt parameters are not included. Use png and a1111 for compatibility with Civitai.",
"fooocus (json)": "fooocus (json)",
"a1111 (plain text)": "a1111 (plain text)"
"a1111 (plain text)": "a1111 (plain text)",
"Unsupported image type in input": "Unsupported image type in input"
}
Loading

0 comments on commit a1bda88

Please sign in to comment.