Sign In

How to make other file types usable (pdfs, gifs, webps, avifs, jpegs)

How to make other file types usable (pdfs, gifs, webps, avifs, jpegs)

Intro
This article is simply how you can use more unusual data points into your dataset. For most tools to train stable diffusion files the only accepted formats are png and jpg. Sometimes though the dataset you want to use may have another file type in the mix especially if you pulled your images straight off google.
Basics
First off in order to see what file type you are using to begin with you need to enable extensions in your file explorer. To do this just open up your file explorer, in the top bar should be something that says view click that and in the dropdown should be a view file extension box. For my particular computer my view has 2 dropdowns and my file extension is in the second drop down.

Quick Fixes
To identify which file types are different you can type in any alterations of the extension into your file search bar (pdfs, gifs, webps, avifs, jpeg's). For some file types simply renaming it will make it a usable data point. You can rename a jpeg into a jpg (jpeg -> jpg) and that will fix it and when its a webp you can make it a png (webp -> png). For the other formats though simply renaming it is not enough to get it working.
Tools
For a good chunk of your issues you can solve them with Gimp, https://www.gimp.org/. For things like avifs and gif's all you need to do is open the file up in gimp. Once the file is open gif's will show up as each individual frame which you can extract separately. You should see an eye icon near every frame that tells you what's visible extract (not save) the frames you want by turning individual frames on and off. For avifs they will open in gimp as a normal picture just extract them immediately and make sure when you do it has a proper file extension (jpg or png) this will properly reformat to a desired training point.

PDF

PDFs to PNGs pretty simply can be done on a variety of sites online without software. https://combinepdf.com/ can transfer your pdf to a jpg for free. Just for most sites of the same style operate it why in incognito mode and delete cookies by clicking the lock in the search bar.
LARGE PDF
This problem had me stuck for awhile, How do I get a large PDF to work? Well for PDFs bigger than 1gb the online resources won't help at all, but thankfully there is a easy to use tool that can do the job. I learned on accident recently that Gimp the art program I mentioned earlier can also work on PDFs. This cuts out all complicated steps such as online sites to shrink the size or learning to code in ghostscripts. Simply open it up in Gimp and treat the whole process the same as a Gif.
Afterword
If you have any further questions be sure to message me in comments or on the discord especially if I missed a file type you would like to figure out how to use. Below is all the links again for if you need them.
Gimp (avif and gif to png or jpg)
https://www.gimp.org/
combine pdf (pdf to jpg)
https://combinepdf.com/
CivitaAi discord

https://discord.gg/UwX5wKwm6c

3

Comments