Skip to content

Commit 12223c8

Browse files
release 1.5.3
1 parent a1054e2 commit 12223c8

File tree

2 files changed

+51
-38
lines changed

2 files changed

+51
-38
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ The idea and initial work is inspired by @sngazm at https://github.com/lllyasvie
7575

7676

7777
## Update log
78+
1.5.3 Fix issue on generated image with input image
79+
- Close issue https://github.com/toutjavascript/Fooocus-Log-Viewer/issues/16
80+
7881
1.5.2 Fix issue opened and solved by friendly user
7982
- Close issue https://github.com/toutjavascript/Fooocus-Log-Viewer/issues/13
8083

viewer.html

Lines changed: 48 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Modestly updated by https://github.com/toutjavascript
1111
https://www.toutjavascript.com
1212
13-
File Version 2024-01-24/A1
13+
File Version 2024-02-19/A1
1414
-->
1515

1616
<html lang="us">
@@ -41,6 +41,10 @@
4141
<div id="app"></div>
4242
<script type="text/babel">
4343

44+
var LOGVIEWER_RELEASE="1.5.3"
45+
46+
$("span#logviewer-release").html("Release "+LOGVIEWER_RELEASE)
47+
4448
window.customElements.define('multi-select', MultiselectWebcomponent);
4549

4650
var configs=[
@@ -144,7 +148,7 @@
144148
img.styles=[];
145149
if (img.Styles!="[]") {
146150
let reg=new RegExp("(')", "g");
147-
img.styles=img.Styles.replace("[","").replace(reg,"").replace("]","").split(", ");
151+
if (img.Styles) img.styles=img.Styles.replace("[","").replace(reg,"").replace("]","").split(", ");
148152
}
149153

150154
for (let j=0; j<img.styles.length; j++) {
@@ -1239,7 +1243,7 @@
12391243
const data = [];
12401244
const parser = new DOMParser();
12411245
const doc = parser.parseFromString(html, "text/html");
1242-
const images = doc.querySelectorAll("div[id$='_png']");
1246+
const images = doc.querySelectorAll("div[id$='_png'],div[id$='_jpg'],div[id$='_webp']");
12431247
for (let i = 0; i < images.length; i++) {
12441248
const paragraphs = images[i].querySelectorAll("p");
12451249
const divs = images[i].querySelectorAll("div");
@@ -1277,10 +1281,12 @@
12771281
}
12781282
}
12791283
}
1280-
data.push({
1281-
src,
1282-
...settings,
1283-
});
1284+
if (settings["Prompt"]) {
1285+
data.push({
1286+
src,
1287+
...settings,
1288+
});
1289+
}
12841290
}
12851291
// console.log(data);
12861292

@@ -1317,18 +1323,19 @@
13171323
"Refiner Model": [],
13181324
"Refiner Switch": [],
13191325
"Use Fooocus V2 (Prompt Expansion)": [],
1320-
Prompt: [],
1326+
Prompt: "",
13211327
"Performance": [],
13221328
"Negative Prompt": [],
13231329
LoRAs: [],
1330+
Styles: []
13241331
},
13251332
timeStr: data[i].src.split("_")[1].replaceAll("-", ":"),
13261333
currentPageData: [],
13271334
startIndex: i,
13281335
endIndex: i,
13291336
});
13301337
// filter out the property starting with "LoRA"
1331-
console.log("data["+i+"]"); console.log(data[i])
1338+
//console.log("data["+i+"]"); console.log(data[i])
13321339
Object.keys(data[i]).forEach((key) => {
13331340
/* console.log("i="+i+" key:" +key) */
13341341
if (key.startsWith("crudLoras")) { /* After V2.1.854 log format */
@@ -1411,18 +1418,20 @@
14111418
currBatch.batchSettings[prompt]
14121419
);
14131420
diff.forEach((part) => {
1414-
if (part.added) {
1415-
currBatch.batchSettingDiffs[prompt].push(
1416-
<span className="text-green-500">{part.value}</span>
1417-
);
1418-
} else if (part.removed) {
1419-
currBatch.batchSettingDiffs[prompt].push(
1420-
<s className="text-red-500">{part.value}</s>
1421-
);
1422-
} else {
1423-
currBatch.batchSettingDiffs[prompt].push(
1424-
<span>{part.value}</span>
1425-
);
1421+
if (currBatch.batchSettingDiffs[prompt]) {
1422+
if (part.added) {
1423+
currBatch.batchSettingDiffs[prompt].push(
1424+
<span className="text-green-500">{part.value}</span>
1425+
);
1426+
} else if (part.removed) {
1427+
currBatch.batchSettingDiffs[prompt].push(
1428+
<s className="text-red-500">{part.value}</s>
1429+
);
1430+
} else {
1431+
currBatch.batchSettingDiffs[prompt].push(
1432+
<span>{part.value}</span>
1433+
);
1434+
}
14261435
}
14271436
});
14281437
});
@@ -2133,24 +2142,25 @@
21332142
let data=parseLog(text);
21342143
let images=data.data;
21352144
for (let i = 0; i < images.length; i++) {
2136-
let img=images[i];
2145+
let img=images[i];
21372146
img.dt=dt;
2138-
allImages.push(img);
2139-
if (allModels.includes(img["Base Model"])==false) {
2140-
allModels.push(img["Base Model"]);
2141-
}
2142-
2143-
img.styles=[];
2144-
if (img.Styles!="[]") {
2145-
let reg=new RegExp("(')", "g");
2146-
img.styles=img.Styles.replace("[","").replace(reg,"").replace("]","").split(", ");
2147-
}
2148-
2149-
for (let j=0; j<img.styles.length; j++) {
2150-
if (allStyles.includes(img.styles[j])==false) {
2151-
allStyles.push(img.styles[j]);
2147+
/* Check if the image is generated with a prompt and not with input image */
2148+
if (data.Prompt) {
2149+
allImages.push(img);
2150+
if (allModels.includes(img["Base Model"])==false) {
2151+
allModels.push(img["Base Model"]);
21522152
}
2153-
}
2153+
img.styles=[];
2154+
if (img.Styles!="[]") {
2155+
let reg=new RegExp("(')", "g");
2156+
img.styles=img.Styles.replace("[","").replace(reg,"").replace("]","").split(", ");
2157+
}
2158+
for (let j=0; j<img.styles.length; j++) {
2159+
if (allStyles.includes(img.styles[j])==false) {
2160+
allStyles.push(img.styles[j]);
2161+
}
2162+
}
2163+
}
21542164
}
21552165

21562166
});
@@ -2610,7 +2620,7 @@
26102620
</style>
26112621

26122622

2613-
<p class=" p-5 "><a href="https://github.com/toutjavascript/Fooocus-Log-Viewer/" target="_blank" class="underline text-slate-200 hover:text-slate-50 dark:hover:text-slate-300">Bug report/ideas/discussions on <svg viewBox="0 0 16 16" class="w-5 h-5 inline" fill="currentColor" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg> github.com/toutjavascript/Fooocus-Log-Viewer</a></p>
2623+
<p class=" p-5 "><span id="logviewer-release" class="mx-5"></span> <a href="https://github.com/toutjavascript/Fooocus-Log-Viewer/" target="_blank" class="underline text-slate-200 hover:text-slate-50 dark:hover:text-slate-300">Bug report/ideas/discussions on <svg viewBox="0 0 16 16" class="w-5 h-5 inline" fill="currentColor" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg> github.com/toutjavascript/Fooocus-Log-Viewer</a></p>
26142624

26152625
<div class="m-2 p-2 mx-5 alert alert alert-light"><u><b><a href="https://github.com/toutjavascript/FoooXus-Fooocus-Extender/" target="_blank" class="">Manage your Styles, Models and Loras with my new FoooXus, Fooocus Extender tool <br><svg viewBox="0 0 16 16" class="w-5 h-5 inline" fill="currentColor" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg> github.com/toutjavascript/FoooXus-Fooocus-Extender</a></u></b></div>
26162626

0 commit comments

Comments
 (0)