Compressing Images with Stable Diffusion
stavros.io
stavros.io
2. Any image generated with stable diffusion, could be distributed as prompt + seed leading to 99% compression
3. Image -> downsample –> super-resolution model -> render -- this must already exist as a compression model? The only limitation is that super-res models probably can't run on phones yet... but some day soon they'll be good enough.
4. All deep learning is fundamentally a compression system (reduce a lot of input data to a set of finite features and weights). But it might also be a very good lossy compression system because it can identify what's worth keeping high res and what's worth aggressively downsampling.
5. Interestingly, we seem to be compute limited more than bandwidth limited nowadays so it might take a while for an economically useful DL-compression product to emerge.
Definitely exist in video compression, not so sure about still image (but most of still image compression advancements lately are just side effect of video compression).
I'd be really interested to see this work extended with something that transmits (say) a 64x64 pixel copy of the original image and uses it as source material for Stable Diffusion to work on.
Depending on the parameters it might be a legitimately viable image compression algorithm, at least for some types of images.
I've been curious, isn't img2img basically just more SD passes? Ie you generate something with 5 passes, then img2img just runs the other 95 over that to "complete" the image.
Basically, as far as I understand it (which is not much), txt2img generates a very rough blob from a prompt, then img2img does additional passes over that to refine it to something that has much higher quality. Is this incorrect?
For example I generated [0] as my base image, I passed it into a dithering filter to make it look more "retro" and got [1] (was going for retro PC98 visual novel style backgrounds), and then [3] are all new results generated from it (I added stuff like "village" or "trees" etc in the new prompt and also made the resolution widescreen). You can tweak parameters like the prompt, the depth (ddim), the "strength" of the original image, and the "scale" (not sure what it is but it does change things around). Then you can play with that and even iterate on more images.
[0] https://upload.i.ng/file/goaltendersgrievousSumter/seed_6436...
[1] https://upload.i.ng/file/overstatementrearwardsplighting/dit...
The commentary gave me a good chuckle, but I was actually pretty impressed with some of the results. I wonder if using stock images is playing to the strength of the model, because they may have actually been part of training.
(Videos should similarly lossy-compress down to a plot synopsis and the key cast/crew. Throw in the script too for more accuracy but biggger file.)
Wow. Sounds like we’ve got a new standard image format on the the way. With a continuous “truthy” scale rating.
Which will basically create realistic 3d streams of dynamic environments and people (so they can be viewed stereoscopically and from different perspectives).
The enhanced AI-based compression should make it more practical to stream in the moving 3d data with fewer delays and latency and more realism than something like a traditional game engine.
Unless no one wants to go to real places anymore because imaginary ones are nicer.
But think about virtual reality with realistic faces and eye contact.
Or a movie where you can view a scene from any perspective you want at any time. Even one of the protagonists. When you are trying to realistically transmit and recreate many entire dynamic 3d scenes, that is where AI can help a lot with scanning and compression/decompression.
Ages ago, for some raytracing stuff, a buddy used l-systems to generate forests, gardens, etc. Each plant was generated from a seed. A very compact reproducible, representation.
https://en.wikipedia.org/wiki/L-system
https://en.wikipedia.org/wiki/The_Algorithmic_Beauty_of_Plan...
What we know about our brains (whether it's a simulated brain or not) tells us that effectively our perception is a simulation of our own. Because for example as you look around, your eyes only get high resolution data in the center, and that can only represent a fraction of the relevant immediate environment. And none of the senses or motor activations are quite real time, there is always some type of lag. The brain takes the data samples and uses them to fine tune a generative prediction system that constructs the dynamic and holistic 3d scene and your position in it using the computational power of your own network of neurons.
To me, dreams provide a certain level of proof that we can do this type of simulation, and something similar is happening while we are awake, but with environmental data sampling and other cognitive processes feeding in.
The idea behind the stick was that you'd have a decoder next to your TV that would contain all the movies ever made encoded in a special format, and if you wanted to watch a particular one, you just needed a specific key that told the decoder how to decompress it.
It didn't really work, as you'd imagine.
Much like the key described in your article, it may be possible to get a very accurate result from an AI via a very long and specific prompt. But that long prompt is then where the "magic" compression goes away.
Otherwise you might have the same problem of this: https://github.com/EmbarkStudios/texture-synthesis#notes
> When using multiple threads for generation, the output image is not guaranteed to be deterministic with the same inputs. To have 100% determinism, you must use a thread count of one, which can by done via
> CLI - texture-synthesis --threads 1
> API - SessionBuilder::max_thread_count(1)
I've also played a lot with slight variations on the same prompt and it's really fascinating seeing how similar the images are outside of the specific detail changed.
I would say this diffusion model is very... stable.
Store stable diffusion model in the π file system (https://github.com/philipl/pifs)
"Almost zero overhead in terms of data storage"
https://ieeexplore.ieee.org/document/918789
https://link.springer.com/chapter/10.1007/978-0-387-69216-6_...
I think there are already AI-based codecs for reducing bandwidth of video calls with faces.
Also, "a couple of women"? Is it part of the joke or the right one is really a woman?