|
10 | 10 | Modestly updated by https://github.com/toutjavascript |
11 | 11 | https://www.toutjavascript.com |
12 | 12 |
|
13 | | -File Version 2024-01-24/A1 |
| 13 | +File Version 2024-02-19/A1 |
14 | 14 | --> |
15 | 15 |
|
16 | 16 | <html lang="us"> |
|
41 | 41 | <div id="app"></div> |
42 | 42 | <script type="text/babel"> |
43 | 43 |
|
| 44 | + var LOGVIEWER_RELEASE="1.5.3" |
| 45 | + |
| 46 | + $("span#logviewer-release").html("Release "+LOGVIEWER_RELEASE) |
| 47 | + |
44 | 48 | window.customElements.define('multi-select', MultiselectWebcomponent); |
45 | 49 |
|
46 | 50 | var configs=[ |
|
144 | 148 | img.styles=[]; |
145 | 149 | if (img.Styles!="[]") { |
146 | 150 | 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(", "); |
148 | 152 | } |
149 | 153 |
|
150 | 154 | for (let j=0; j<img.styles.length; j++) { |
|
1239 | 1243 | const data = []; |
1240 | 1244 | const parser = new DOMParser(); |
1241 | 1245 | 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']"); |
1243 | 1247 | for (let i = 0; i < images.length; i++) { |
1244 | 1248 | const paragraphs = images[i].querySelectorAll("p"); |
1245 | 1249 | const divs = images[i].querySelectorAll("div"); |
|
1277 | 1281 | } |
1278 | 1282 | } |
1279 | 1283 | } |
1280 | | - data.push({ |
1281 | | - src, |
1282 | | - ...settings, |
1283 | | - }); |
| 1284 | + if (settings["Prompt"]) { |
| 1285 | + data.push({ |
| 1286 | + src, |
| 1287 | + ...settings, |
| 1288 | + }); |
| 1289 | + } |
1284 | 1290 | } |
1285 | 1291 | // console.log(data); |
1286 | 1292 |
|
|
1317 | 1323 | "Refiner Model": [], |
1318 | 1324 | "Refiner Switch": [], |
1319 | 1325 | "Use Fooocus V2 (Prompt Expansion)": [], |
1320 | | - Prompt: [], |
| 1326 | + Prompt: "", |
1321 | 1327 | "Performance": [], |
1322 | 1328 | "Negative Prompt": [], |
1323 | 1329 | LoRAs: [], |
| 1330 | + Styles: [] |
1324 | 1331 | }, |
1325 | 1332 | timeStr: data[i].src.split("_")[1].replaceAll("-", ":"), |
1326 | 1333 | currentPageData: [], |
1327 | 1334 | startIndex: i, |
1328 | 1335 | endIndex: i, |
1329 | 1336 | }); |
1330 | 1337 | // 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]) |
1332 | 1339 | Object.keys(data[i]).forEach((key) => { |
1333 | 1340 | /* console.log("i="+i+" key:" +key) */ |
1334 | 1341 | if (key.startsWith("crudLoras")) { /* After V2.1.854 log format */ |
|
1411 | 1418 | currBatch.batchSettings[prompt] |
1412 | 1419 | ); |
1413 | 1420 | 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 | + } |
1426 | 1435 | } |
1427 | 1436 | }); |
1428 | 1437 | }); |
|
2133 | 2142 | let data=parseLog(text); |
2134 | 2143 | let images=data.data; |
2135 | 2144 | for (let i = 0; i < images.length; i++) { |
2136 | | - let img=images[i]; |
| 2145 | + let img=images[i]; |
2137 | 2146 | 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"]); |
2152 | 2152 | } |
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 | + } |
2154 | 2164 | } |
2155 | 2165 |
|
2156 | 2166 | }); |
|
2610 | 2620 | </style> |
2611 | 2621 |
|
2612 | 2622 |
|
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> |
2614 | 2624 |
|
2615 | 2625 | <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> |
2616 | 2626 |
|
|
0 commit comments