Skip to content

Commit a1bda88

Browse files
authored
Merge pull request #2558 from lllyasviel/develop
release 2.3.0
2 parents d057f2f + 3efce58 commit a1bda88

30 files changed

+639
-302
lines changed

args_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
from tempfile import gettempdir
55

66
args_parser.parser.add_argument("--share", action='store_true', help="Set whether to share on Gradio.")
7+
78
args_parser.parser.add_argument("--preset", type=str, default=None, help="Apply specified UI preset.")
9+
args_parser.parser.add_argument("--disable-preset-selection", action='store_true',
10+
help="Disables preset selection in Gradio.")
811

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

52-
if args_parser.args.temp_path is None:
53-
args_parser.args.temp_path = os.path.join(gettempdir(), 'Fooocus')
54-
5555
args = args_parser.args

css/style.css

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,136 @@
11
/* based on https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/v1.6.0/style.css */
22

3+
.loader-container {
4+
display: flex; /* Use flex to align items horizontally */
5+
align-items: center; /* Center items vertically within the container */
6+
white-space: nowrap; /* Prevent line breaks within the container */
7+
}
8+
9+
.loader {
10+
border: 8px solid #f3f3f3; /* Light grey */
11+
border-top: 8px solid #3498db; /* Blue */
12+
border-radius: 50%;
13+
width: 30px;
14+
height: 30px;
15+
animation: spin 2s linear infinite;
16+
}
17+
18+
@keyframes spin {
19+
0% { transform: rotate(0deg); }
20+
100% { transform: rotate(360deg); }
21+
}
22+
23+
/* Style the progress bar */
24+
progress {
25+
appearance: none; /* Remove default styling */
26+
height: 20px; /* Set the height of the progress bar */
27+
border-radius: 5px; /* Round the corners of the progress bar */
28+
background-color: #f3f3f3; /* Light grey background */
29+
width: 100%;
30+
}
31+
32+
/* Style the progress bar container */
33+
.progress-container {
34+
margin-left: 20px;
35+
margin-right: 20px;
36+
flex-grow: 1; /* Allow the progress container to take up remaining space */
37+
}
38+
39+
/* Set the color of the progress bar fill */
40+
progress::-webkit-progress-value {
41+
background-color: #3498db; /* Blue color for the fill */
42+
}
43+
44+
progress::-moz-progress-bar {
45+
background-color: #3498db; /* Blue color for the fill in Firefox */
46+
}
47+
48+
/* Style the text on the progress bar */
49+
progress::after {
50+
content: attr(value '%'); /* Display the progress value followed by '%' */
51+
position: absolute;
52+
top: 50%;
53+
left: 50%;
54+
transform: translate(-50%, -50%);
55+
color: white; /* Set text color */
56+
font-size: 14px; /* Set font size */
57+
}
58+
59+
/* Style other texts */
60+
.loader-container > span {
61+
margin-left: 5px; /* Add spacing between the progress bar and the text */
62+
}
63+
64+
.progress-bar > .generating {
65+
display: none !important;
66+
}
67+
68+
.progress-bar{
69+
height: 30px !important;
70+
}
71+
72+
.type_row{
73+
height: 80px !important;
74+
}
75+
76+
.type_row_half{
77+
height: 32px !important;
78+
}
79+
80+
.scroll-hide{
81+
resize: none !important;
82+
}
83+
84+
.refresh_button{
85+
border: none !important;
86+
background: none !important;
87+
font-size: none !important;
88+
box-shadow: none !important;
89+
}
90+
91+
.advanced_check_row{
92+
width: 250px !important;
93+
}
94+
95+
.min_check{
96+
min-width: min(1px, 100%) !important;
97+
}
98+
99+
.resizable_area {
100+
resize: vertical;
101+
overflow: auto !important;
102+
}
103+
104+
.aspect_ratios label {
105+
width: 140px !important;
106+
}
107+
108+
.aspect_ratios label span {
109+
white-space: nowrap !important;
110+
}
111+
112+
.aspect_ratios label input {
113+
margin-left: -5px !important;
114+
}
115+
116+
.lora_enable label {
117+
height: 100%;
118+
}
119+
120+
.lora_enable label input {
121+
margin: auto;
122+
}
123+
124+
.lora_enable label span {
125+
display: none;
126+
}
127+
128+
@-moz-document url-prefix() {
129+
.lora_weight input[type=number] {
130+
width: 80px;
131+
}
132+
}
133+
3134
#context-menu{
4135
z-index:9999;
5136
position:absolute;
@@ -218,3 +349,48 @@
218349
#stylePreviewOverlay.lower-half {
219350
transform: translate(-140px, -140px);
220351
}
352+
353+
/* scrollable box for style selections */
354+
.contain .tabs {
355+
height: 100%;
356+
}
357+
358+
.contain .tabs .tabitem.style_selections_tab {
359+
height: 100%;
360+
}
361+
362+
.contain .tabs .tabitem.style_selections_tab > div:first-child {
363+
height: 100%;
364+
}
365+
366+
.contain .tabs .tabitem.style_selections_tab .style_selections {
367+
min-height: 200px;
368+
height: 100%;
369+
}
370+
371+
.contain .tabs .tabitem.style_selections_tab .style_selections .wrap[data-testid="checkbox-group"] {
372+
position: absolute; /* remove this to disable scrolling within the checkbox-group */
373+
overflow: auto;
374+
padding-right: 2px;
375+
max-height: 100%;
376+
}
377+
378+
.contain .tabs .tabitem.style_selections_tab .style_selections .wrap[data-testid="checkbox-group"] label {
379+
/* max-width: calc(35% - 15px) !important; */ /* add this to enable 3 columns layout */
380+
flex: calc(50% - 5px) !important;
381+
}
382+
383+
.contain .tabs .tabitem.style_selections_tab .style_selections .wrap[data-testid="checkbox-group"] label span {
384+
/* white-space:nowrap; */ /* add this to disable text wrapping (better choice for 3 columns layout) */
385+
overflow: hidden;
386+
text-overflow: ellipsis;
387+
}
388+
389+
/* styles preview tooltip */
390+
.preview-tooltip {
391+
background-color: #fff8;
392+
font-family: monospace;
393+
text-align: center;
394+
border-radius-top: 5px;
395+
display: none; /* remove this to enable tooltip in preview image */
396+
}

fooocus_colab.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"%cd /content\n",
1313
"!git clone https://github.com/lllyasviel/Fooocus.git\n",
1414
"%cd /content/Fooocus\n",
15-
"!python entry_with_update.py --share\n"
15+
"!python entry_with_update.py --share --always-high-vram\n"
1616
]
1717
}
1818
],

fooocus_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = '2.2.1'
1+
version = '2.3.0'

javascript/script.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,12 @@ function initStylePreviewOverlay() {
150150
let overlayVisible = false;
151151
const samplesPath = document.querySelector("meta[name='samples-path']").getAttribute("content")
152152
const overlay = document.createElement('div');
153+
const tooltip = document.createElement('div');
154+
tooltip.className = 'preview-tooltip';
155+
overlay.appendChild(tooltip);
153156
overlay.id = 'stylePreviewOverlay';
154157
document.body.appendChild(overlay);
155-
document.addEventListener('mouseover', function(e) {
158+
document.addEventListener('mouseover', function (e) {
156159
const label = e.target.closest('.style_selections label');
157160
if (!label) return;
158161
label.removeEventListener("mouseout", onMouseLeave);
@@ -162,18 +165,21 @@ function initStylePreviewOverlay() {
162165
const originalText = label.querySelector("span").getAttribute("data-original-text");
163166
const name = originalText || label.querySelector("span").textContent;
164167
overlay.style.backgroundImage = `url("${samplesPath.replace(
165-
"fooocus_v2",
166-
name.toLowerCase().replaceAll(" ", "_")
168+
"fooocus_v2",
169+
name.toLowerCase().replaceAll(" ", "_")
167170
).replaceAll("\\", "\\\\")}")`;
171+
172+
tooltip.textContent = name;
173+
168174
function onMouseLeave() {
169175
overlayVisible = false;
170176
overlay.style.opacity = "0";
171177
overlay.style.backgroundImage = "";
172178
label.removeEventListener("mouseout", onMouseLeave);
173179
}
174180
});
175-
document.addEventListener('mousemove', function(e) {
176-
if(!overlayVisible) return;
181+
document.addEventListener('mousemove', function (e) {
182+
if (!overlayVisible) return;
177183
overlay.style.left = `${e.clientX}px`;
178184
overlay.style.top = `${e.clientY}px`;
179185
overlay.className = e.clientY > window.innerHeight / 2 ? "lower-half" : "upper-half";

language/en.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@
3838
"* \"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)",
3939
"Setting": "Setting",
4040
"Style": "Style",
41+
"Preset": "Preset",
4142
"Performance": "Performance",
4243
"Speed": "Speed",
4344
"Quality": "Quality",
45+
"Extreme Speed": "Extreme Speed",
46+
"Lightning": "Lightning",
4447
"Aspect Ratios": "Aspect Ratios",
4548
"width \u00d7 height": "width \u00d7 height",
4649
"Image Number": "Image Number",
@@ -50,6 +53,7 @@
5053
"Seed": "Seed",
5154
"Disable seed increment": "Disable seed increment",
5255
"Disable automatic seed increment when image number is > 1.": "Disable automatic seed increment when image number is > 1.",
56+
"Read wildcards in order": "Read wildcards in order",
5357
"\ud83d\udcda History Log": "\uD83D\uDCDA History Log",
5458
"Image Style": "Image Style",
5559
"Fooocus V2": "Fooocus V2",
@@ -367,7 +371,6 @@
367371
"B2": "B2",
368372
"S1": "S1",
369373
"S2": "S2",
370-
"Extreme Speed": "Extreme Speed",
371374
"\uD83D\uDD0E Type here to search styles ...": "\uD83D\uDD0E Type here to search styles ...",
372375
"Type prompt here.": "Type prompt here.",
373376
"Outpaint Expansion Direction:": "Outpaint Expansion Direction:",
@@ -381,5 +384,6 @@
381384
"Metadata Scheme": "Metadata Scheme",
382385
"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.",
383386
"fooocus (json)": "fooocus (json)",
384-
"a1111 (plain text)": "a1111 (plain text)"
387+
"a1111 (plain text)": "a1111 (plain text)",
388+
"Unsupported image type in input": "Unsupported image type in input"
385389
}

0 commit comments

Comments
 (0)