This commit is contained in:
mrq 2022-10-04 21:25:47 +00:00
parent 8eeb0a87c4
commit fa82334f4e
3 changed files with 73 additions and 56 deletions

View File

@ -1,5 +1,11 @@
# Textual Inversion Guide w/ E621 Content
An up-to-date repo with all the necessary files can be found here: https://git.coom.tech/mrq/stable-diffusion-utils
**!**WARNING**!** **!**CAUTION**!** ***DO NOT POST THE REPO'S URL ON 4CHAN*** **!**CAUTION**!** **!**WARNING**!**
`coom.tech` is an automatic 30-day ban if posted. I am not responsible if you share that URL. Share the [rentry](https://rentry.org/sd-e621-textual-inversion/) instead.
## Assumptions
This guide assumes the following basics:

View File

@ -0,0 +1,5 @@
{
"dependencies": {
"node-fetch": "^2.6.7"
}
}

View File

@ -18,11 +18,14 @@ for ( let i in csv ) {
// for starters, you can also add "anthro", "male", "female", as they're very common tags
let filters = [
"female"
]
];
for ( let i in files ) (async () => {
let parse = async () => {
for ( let i in files ) {
let file = files[i];
let md5 = file.match(/^([a-f0-9]{32})/)[1];
let md5 = file.match(/^([a-f0-9]{32})/);
if ( !md5 ) continue;
md5 = md5[1];
let ext = file.split(".").pop()
console.log(i, files.length, md5, ext);
@ -31,7 +34,7 @@ for ( let i in files ) (async () => {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36'
}
} );
let json = JSON.parse(await res.text());
let json = JSON.parse(await r.text());
json = json.posts[0];
if ( !json ) continue;
tags = [];
@ -80,4 +83,7 @@ for ( let i in files ) (async () => {
await new Promise( (resolve) => {
setTimeout(resolve, 500)
} )
})();
}
}
parse();