Batch Batch upscaling - /wsr/ (#1530191) [Archived: 933 hours ago]

Anonymous
6/15/2025, 6:45:34 PM No.1530191
ae4716541c3a1ab9c0e412092c2fb80deb9b37d2
ae4716541c3a1ab9c0e412092c2fb80deb9b37d2
md5: b3f207eaef31133b83ccd453819c3d36🔍
I need to batch upscale hundreds of 'photo albums', each one is just a set of chronologically named images of different file types per folder. I have to do it on my system, however, a program such as Upscayl only lets me upscale one folder at a time, and each one takes a few minutes depending on size, so doing every one by hand would take too much time.
(No ffmpeg pls)
Anonymous
6/16/2025, 4:00:57 AM No.1530255
>No ffmpeg pls
b-but, it is able to do exactly what you want

what CLI encoder can I use then? I could download it, test it, and write a script for you
Replies: >>1530269
Anonymous
6/16/2025, 5:35:04 AM No.1530269
Screenshot 2025-06-16 052438
Screenshot 2025-06-16 052438
md5: 8965733158e5e48c9f95249ab3e69a64🔍
>>1530255
I barely know what you are talking about but Upscayl has picrel algorithms and so far I've been using 'Digital Art', I think it's CLI is in ...\Upscayl\resources\bin but idk how to use it, their github told me to open it via cmd with "...\Upscayl\resources\bin/upscayl-bin.exe", if you can't find a way I guess I'll learn to use ffmpeg =(

(I won't be home in a while so sorry if i reply very late)
Replies: >>1530283
Anonymous
6/16/2025, 9:35:34 AM No.1530283
Untitled
Untitled
md5: 13e0792fc9cb5a10b9adacccb13e2382🔍
>>1530269
>I barely know what you are talking
Ah ok, lemme slow down and back up

>I think it's CLI is in ...\Upscayl\resources\bin but idk how to use it
I can show you the basics, this might take multiple posts

in the picture you can see on my desktop, I have two folders, and at the bottom half of the screen you can see the contents of said folder

when I open command prompt, you see
`C:\Users\kura_bot\Desktop>`
this means my current location or "current directory" is my "..\Desktop"

'dir /b' is a command to list the contents of the current directory, as you can see, it shows the folders
'dir /b FolderTwo' shows the contents of FolderTwo,
'cd FolderTwo' changes my directory to FolderTwo, as a result the prompt now shows `C:\Users\kura_bot\Desktop\FolderTwo>`
the subsequent 'dir /b' shows the contents of FolderTwo since that is my current location now
Anonymous
6/16/2025, 9:57:46 AM No.1530284
video_thumb.jpg
video_thumb.jpg
md5: f1886cfaaf7ed499914e2e371f4fcf06🔍
this is important because the basic way to get ffmpeg or the CLI version of Upscayl (upscayl-bin) to work is for you to be in the same folder as as it, otherwise you will get an error that says something like
"'upscayl-bin.exe' is not recognized as an internal or external command,
operable program or batch file."

an easy way to do this is go to where the `.exe` is located with your mouse like normal, click the navigation bar, type 'cmd' and hit enter, this should open a command prompt in the proper location, from there you can use the CLI program

now that you have its location or "path" (current directory + name '.exe')you can put it in a script file to do batch processing, rather than by hand
Anonymous
6/16/2025, 10:30:26 AM No.1530285
generate list_thumb.jpg
generate list_thumb.jpg
md5: 140fd6d634a505f539c0b9acf83b8a41🔍
the scripting part is where things get complicated real fast, there are different approaches to solve this problem, and it changes depending on how you organized the files, so you might want to search around to see what other people do if I don't explain it well.

The way I would solve this is, generating a list of files, then using a batch script to run a command on each item in the list, since 'upscayl-bin.exe' says input only accepts webp, jpg, and png, I'll search for those three, in my example 'images' is a directory that has 3 sub folders (set1, set2, set3) each of those has image files

`dir /b /s *.jpg *.png *.webp`
will search the current directory, and sub directories for all files ending with those extensions
``>> list.txt`` saves the output of the previous command, into a file named list.txt
Replies: >>1530287
Anonymous
6/16/2025, 11:09:27 AM No.1530287
script_thumb.jpg
script_thumb.jpg
md5: fb4c53bd78e7bfbf6c8ee60221bf6236🔍
>>1530285
finally, you take the list, put it in the same folder as `'upscayl-bin.exe'`

Create a new text file, rename the extension to `.bat` and open it in a text editor
The basic code is
``` for /f "tokens=*" %%i in (list.txt) do ECHO upscayl-bin -i "%%i" -o "%%~dpiUpscaled_%%~nxi" ```
- if you're going to use the batch script from a file you need the %% instead of just %
the rest of the code doesn't really need to be explained in detail, you can get details here
https://ss64.com/nt/for.html
https://ss64.com/nt/syntax-args.html

how to use it, this will "echo" or print out the commands, if they look accurate then you delete `ECHO` from the bat file, save it, and run it again, in your case I added `-m "..\models"` because the default location was not working for me, and `-n digital-art-4x` because you said you were using the digital art model/algorithm, you're looking at

``` for /f "tokens=*" %%i in (list.txt) do ECHO upscayl-bin -i "%%i" -o "%%~dpiUpscaled_%%~nxi" -m "..\models" -n digital-art-4x ```

`echo off` is optional, it just makes things easier to read
Replies: >>1530304
Anonymous
6/16/2025, 5:16:14 PM No.1530304
Screenshot 2025-06-16 170640
Screenshot 2025-06-16 170640
md5: 09afb5f994f8a98aac81101d5740aed6🔍
>>1530287
It does something, ECHO+echo off/no echo off it looks like it just prints out the command with the file paths, but without it it does the same just with picrel, and it takes ~1sec per pic, however then it just stops(closes in case I run the .bat file)

usually upscayl works with my AMD GPU and doesn't use my AMD CPU
Replies: >>1530327
Anonymous
6/16/2025, 7:22:35 PM No.1530327
>>1530304
>however then it just stops(closes in case I run the .bat file)
if you double click the .bat file, it'll close when it finishes or hits an error, so I usually open command prompt first, call it from there, and it'll stay open, if it errors you can read the dialogue to see what the issue is

These posts were my first time using upscayl, so if the error isn't with the script but the program itself, I may not be able to help
Replies: >>1530332
Anonymous
6/16/2025, 7:48:20 PM No.1530332
>>1530327
lets try the FFmpeg route then, I have it installed b/c RVC, SD, and now this, how do I use it?
Replies: >>1530337
Anonymous
6/16/2025, 8:08:14 PM No.1530337
>>1530332
wait but, I am not sure what the error is still. I thought you were going to post it, make a copy of the list.txt, and cut it down to like 5 lines, and see if it still works, we are looking to recreate the error message

the basic use of ffmpeg is nearly the same thing
instead of
`upscayl-bin -i <input image name> -o <output image name> [options]`
it becomes
`ffmpeg -i <input image name> [options] <output image name>`

your script would become
``` for /f "tokens=*" %%i in (list.txt) do ECHO ffmpeg -i "%%i" -vf scale=iw*2:ih*2 "%%~dpiUpscaled_%%~nxi" ```
Changing the scaling algorithm is possible but none of them are AI based
https://trac.ffmpeg.org/wiki/Scaling#Specifyingscalingalgorithm
Replies: >>1530392
Anonymous
6/17/2025, 6:58:10 AM No.1530392
>>1530337
it says '%%i' was unexpected, but if I just change it to %i it only prints out the file names,
I'm also noticing that the list.txt file has unrecognized characters, long dashes, weird fonts, with '?'s that shouldn't even be in the folder name.
I'll try to separate everything by file type and then use upscayl normally, then return everything to original folders, I'll bump the thread until I get it working, but I have 8556+ images so it might take me a whole day xd