|
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-06/A1 |
14 | 14 | --> |
15 | 15 |
|
16 | 16 | <html lang="us"> |
|
1097 | 1097 | ) : ( |
1098 | 1098 | <> |
1099 | 1099 | {key == "Styles" ? ( |
1100 | | - <div class="flex"> |
| 1100 | + <div class="flex"> |
1101 | 1101 | {value.replace(/'/g, "").replace("[","").replace("]","").split(", ").map((style, i) => ( |
| 1102 | + style.trim() !== "" && ( |
1102 | 1103 | <div class="flex-initial text-center mx-1 styleContainer"> |
1103 | | - <img src={ ("/file=sdxl_styles/samples/"+style.replace(/ /g,"_")+".jpg") } class="styleImage"/> |
1104 | | - <span class="styleTitle">{style}</span> |
| 1104 | + <img src={ ("/file=sdxl_styles/samples/"+style.toLowerCase().replace(/ /g,"_")+".jpg") } class="styleImage"/> |
| 1105 | + <span class="styleTitle">{style}</span> |
1105 | 1106 | </div> |
1106 | | - ))} |
1107 | | - </div> |
1108 | | - ) : |
1109 | | - ( |
| 1107 | + ) |
| 1108 | + ))} |
| 1109 | + </div> |
| 1110 | + ) : |
| 1111 | + ( |
1110 | 1112 | value |
1111 | | - )} |
| 1113 | + )} |
1112 | 1114 | </> |
1113 | 1115 | )} |
1114 | 1116 | </span> |
|
1281 | 1283 | const getBatchData = (data) => { |
1282 | 1284 | const batchData = []; |
1283 | 1285 | const isAsc = data.length < 2 || data[0].src < data[1].src; |
1284 | | - |
| 1286 | + console.log("getBatchData: data=") |
| 1287 | + console.log(data) |
1285 | 1288 | for (let i = 0; i < data.length; i++) { |
1286 | 1289 | if (i === 0 || !isSameBatch(data[i], data[i - 1])) { |
1287 | 1290 | batchData.push({ |
|
1316 | 1319 | endIndex: i, |
1317 | 1320 | }); |
1318 | 1321 | // filter out the property starting with "LoRA" |
| 1322 | + console.log("data["+i+"]"); console.log(data[i]) |
1319 | 1323 | Object.keys(data[i]).forEach((key) => { |
1320 | 1324 | /* console.log("i="+i+" key:" +key) */ |
1321 | | - if (key.startsWith("LoRA ")) { /* After V2.1.854 log format */ |
| 1325 | + if (key.startsWith("crudLoras")) { /* After V2.1.854 log format */ |
1322 | 1326 | try { |
1323 | | - console.log("LORA new "+data[i][key]+" / "+data[i][value]); |
1324 | | - batchData[batchData.length - 1].batchSettings.LoRAs.push({ |
1325 | | - name: data[i][key].split(':')[0].trim(), |
1326 | | - weight: data[i][key].split(':')[1].trim() |
1327 | | - }); |
1328 | | - } catch(e) {} |
| 1327 | + for (let j=0; j<data[i][key].length; j++) { |
| 1328 | + const lora=data[i][key][j].split(":"); |
| 1329 | + console.log("LORA new "+lora[0]+" / "+lora[1]); |
| 1330 | + batchData[batchData.length - 1].batchSettings.LoRAs.push({ |
| 1331 | + name: lora[0].trim(), |
| 1332 | + weight: lora[1].trim() |
| 1333 | + }); |
| 1334 | + } |
| 1335 | + } catch(e) { |
| 1336 | + console.log("error get lora "+e) |
| 1337 | + } |
1329 | 1338 | } |
1330 | | - |
1331 | 1339 | }); |
1332 | 1340 | } else { |
1333 | 1341 | if (batchData.length > 0) { |
|
0 commit comments