[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/vt/ - Virtual Youtubers

Search:


View post   

>> No.42043236 [View]
File: 330 KB, 1245x746, file.png [View same] [iqdb] [saucenao] [google]
42043236

We're already past bump limit so I'll sperg out a bit, entertain me /vtai/. I still can't believe this fucking script works...

https://gist.github.com/vt-idiot/f77a4265ea277d7fe2f5aad054ddae2d
If you want to try it out. Follow the instructions in the comment at the bottom https://gist.github.com/vt-idiot/f77a4265ea277d7fe2f5aad054ddae2d?permalink_comment_id=4450236#gistcomment-4450236

It will compress all PNGs in whatever folder you're currently in to JPG and preserve the metadata. Non-ANSI/Latin characters in the prompt? Doesn't matter, still werks. NovelAI image? Still werks. If it's a NovelAI image, it will reformat the multiple PNG tEXT tags they use into the exact syntax webui uses** so it can all fit in one JPG EXIF "Comment" tag.
**kind of falls apart if it was an "Enhance" upscale, but you already knew that, since dragging the same image back into NovelAI and clicking "Generate" would've given you something entirely different anyways.

1. You need PowerShell 7 or you have to remove " -Parallel" from line 25, which will make it CONSIDERABLY slower
2. You need to run "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned" in PowerShell to use .ps1 scripts if you never have before. This will allow you to run local scripts, and will ONLY allow remote scripts to run if they're signed, like from Microsoft or something.
3. Not for the faint of heart, but it does work, it works well, and it's actually fucking fast - which it has no right to be considering how it works. and I use "works" lightly
4. There are potentially file name collision issues, but it's such an infinitesimally rare chance, and only with Parallel processing enabled. Your images would have to: a. have had non-ANSI characters or {curly braces} or [brackets] in the prompt, b. used the same seed, c. end up with identical filenames once all the non-ANSI characters were stripped from the filename. so, something like "なほね s-12345.png" and "おやすみ!s-12345.png" would destroy each other IF they were processed simultaneously. or "{towa} s-12345.png" and "{{towa}} s-12345.png". The chance is much lower for something like "towa s-12345.png" and "{towa} s-12345.png" because of the order they're processed in.
There is NO chance of collision when you're NOT using "-Parallel", and the chances are even smaller with only webui images, because of the number prefixes.


So if you have 30+GB of proompted PNG's saved, COPY some into a test folder, install ImageMagick, copy "exiftool.exe" into its installation folder, and give it a shot.

...I should really learn to program.

Navigation
View posts[+24][+48][+96]