Live data from Hacker News

Stretch iPhone to its limit: 2GiB Stable Diffusion model runs locally on device

liuliu.me

171–180 of 184 posts

Re: Stretch iPhone to its limit: 2GiB Stable Diffusion model runs locally on device

#172
post #133

Earlier quoted context omitted.

Early cars were terrible too, but here we are. The promise is that future versions of the technology will be able to draw anatomically correct people and images. A computer program that can do in mere minutes what takes a person hours. If you've never wanted a picture of something you can describe but aren't able to draw in your life, then there is no use case for you. For anyone else that's interacted with the world…

> Early cars were terrible too, but here we are. Were they? https://en.wikipedia.org/wiki/Benz_Patent-Motorwagen - as fast as a carriage, about the same stink. Carriages clearly had a usecase. Generated images now: take enormous energy to generate. Main current usecase is to gobble up more energy (mass media/entertainment).

They were. They were loud and stinky and were unsuitable for dirt roads, spooking horses, causing the UK to basically ban them. Some were powered by steam or coal but those that were powered by gas had a different problem - there were no gas stations. You had to hand crank them to start. Moving goods and people around was already a solved problem with horses and trains and boats.

Cars then: take enormous energy to move very little, and slowly. Main use case then was as a rich person's toy (entertainment). They'll never replace work horses with them.

It's easy, in hindsight, to see cars as inevitable. But you had to see past the shortcomings of the earliest cars to "get it", much like you have to see past the 3 armed monstrosities that current image generation techniques produce and see the promise of the technology. There were undoubtedly those who saw cars as hype, much like image generation is seen today; I'm sure buggy whip manufacturers saw cars as hype and refused to get on what looked like a hype train to them.

Re: Stretch iPhone to its limit: 2GiB Stable Diffusion model runs locally on device

#173

Earlier quoted context omitted.

Memory compression is a generalization of swap, which is only for dynamic memory; files on disk don't need it because you can just read them off the disk. The problem is that GPUs don't support virtual memory paging, so they can't read files nor decompress nor swap anything unless you write it yourself, which is a lot slower. Also, ML models (probably) can't be compressed because they already are compressed; learning…

> Also, ML models (probably) can't be compressed because they already are compressed; learning and compression are the same thing! I feel like they're kind of two sides of the same coin: learning is about putting more information in the same data, while compression is about putting the same information in less data. I'm wondering if some lossy floating-point compressor (such as zfp) would work.

> I'm wondering if some lossy floating-point compressor (such as zfp) would work.

Well apparently this can work; StableDiffusion comes as 32-bit and 16-bit float versions. I'm kind of surprised they both work, but that's lossy compression.

Re: Stretch iPhone to its limit: 2GiB Stable Diffusion model runs locally on device

#174
post #25
post #22

Aww man, no ipad version? Tsk what did I get this 16gb of ram for?

Given couple of weeks. Still playing to see what's the optimal UI looks like for such large screen. 16GiB should be able to generate several images to select from at once.

Rad, thanks!

Re: Stretch iPhone to its limit: 2GiB Stable Diffusion model runs locally on device

#175
post #128

Earlier quoted context omitted.

Pivot alert I reached 3Gbps over Verizon 5G in San Antonio last year and this year i get about 4Mbps over Verizon 5G in Ohio. It’s so bad I disabled it. I did read an article that iPhone 12 (which is what I have) have some kind of radio issue with 5G. Can anyone in here confirm?

Verizon has been real wonky all over Austin. If there's more than a handful of people in the area, bandwidth just goes to the crapper. I'll go from a couple hundred mbps on a good day with no clouds/wind/holding my phone just perfectly right in the right space, but usually get less than 1mbps on their 5g UW.

Yeah, its really bad. I keep having to disable 5G.

Re: Stretch iPhone to its limit: 2GiB Stable Diffusion model runs locally on device

#176
post #128

Earlier quoted context omitted.

Pivot alert I reached 3Gbps over Verizon 5G in San Antonio last year and this year i get about 4Mbps over Verizon 5G in Ohio. It’s so bad I disabled it. I did read an article that iPhone 12 (which is what I have) have some kind of radio issue with 5G. Can anyone in here confirm?

Verizon has been real wonky all over Austin. If there's more than a handful of people in the area, bandwidth just goes to the crapper. I'll go from a couple hundred mbps on a good day with no clouds/wind/holding my phone just perfectly right in the right space, but usually get less than 1mbps on their 5g UW.

No post body was provided.

Re: Stretch iPhone to its limit: 2GiB Stable Diffusion model runs locally on device

#177
post #15
post #11

This is absolutely incredible. It takes about 45 seconds to generate a whole image on my iPhone SE3 - which is about as fast as my M1 Pro macbook was doing it with the original version!

SE 3rd Gen has 4GiB RAM, therefore the app defaults to 384x384 size. This is about 1/2 computation of your normal run (512x512) and the original version uses PLMS sampler, which defaults to 50 steps, while this one uses the newer DPM++ 2M Karras sampler, that defaults to 30 steps. All in all, your M1 Pro MBP is still 4x of your SE 3rd Gen in raw performance (although my implementation should be faster than PyTorch at…

hey. 9th gen ipad 10.9, i think it has 3GB ram so it will never work on it?

Re: Stretch iPhone to its limit: 2GiB Stable Diffusion model runs locally on device

#178
post #80

Congrats on the release! I gave this and other available applications a try and I don’t understand what people see in ai image generation. A simple prompt generated a person with 3 nostrils, 7 squished fingers, deformities everywhere I look, it just mashes a bunch of photographs together and generates abominations. Pay close attention to generated models and you will find details which are simply wrong. What is the u…

You're missing imagination and the ability to write a good prompt. Come back when you're smarter.

Re: Stretch iPhone to its limit: 2GiB Stable Diffusion model runs locally on device

#179
post #132
post #31

here's a direct app store link, if anyone wants to try the iPhone app immediately: https://apps.apple.com/us/app/draw-things-ai-generation/id64... congratulations to liuliu on the launch!

Crashes on my iPhone SE 2. Gen which was to be expected :-(

[deleted]

Re: Stretch iPhone to its limit: 2GiB Stable Diffusion model runs locally on device

#180
post #29
post #24

Earlier quoted context omitted.

Does it crash upon downloading models, or generating? I haven't tested on all the devices, but 11 Pro seems have 4GiB RAM, and should run with 384x384 resolution (check if that is the selected resolution at top right). There are reports that iOS is not happy with how I computing SHA256 for downloaded model file by loading them all in memory for Xr (3GiB RAM). If this is happening for other devices, I may need to do s…

It _might_ be easier just to use mmio and save any futzing around rewriting the actual code.

Yeah, I thought Data(contentsOf:) already do that, but it appears not (tested, indeed allocated all the memory to load the data). Adding `mapIfSafe` in the reading options solved this.
Post reply on HN