Hacker News new | ask | show | jobs
by neonate 1289 days ago
https://github.com/apple/ml-stable-diffusion
1 comments

Oh gosh that's an intimidating installation process. I'll be much more interested when I can just `brew install` a binary.
A bit different take is DiffusionBee, if you're curious to try it out in a GUI form.

https://diffusionbee.com

I’ve used this a fair amount but am not sure it’s much better place to begin than automatic1111, especially for the HN crowd.
automatic1111 does have an M1 workaround in the wiki, but it is incorrect

it's correct enough that if you know your way around a CLI, git, and package management you can figure it out

It sucks to have to figure it out, any person who figures it out should submit a PR on the very outdated Apple Silicon readme.
you cant send a PR on a wiki right?

also wonder if anyone did a blogpost yet

On the one hand, I appreciate the attempt to bring this stuff into the realm of "double click to run" boneheads like me, but on the other hand, I really despise Electron apps when they're multi-platform, where such use is somewhat understandable if still despicable. For a Mac-only app to use Electron… Why do they hate us so?
I'm baffled by continued hate on Electron. The option isn't between Electron and a lean OS-native application, but between Electron and nothing.

I can build an Electron app in under a day with a pretty UI. It would take me several months to get anything sensible that is OS native. And I'm not going to sit down and learn the alternative.

So please just say "thank you" to the developers that are sharing free things with you.

I would argue that shipping bad software is worse than shipping no software at all, yes. And it's impossible not to create bad software when you start with "it runs in a web browser, but it's not a web page." I say this as a web developer with over fifteen years of professional experience.

Worst of all is the shamelessness, though. Don't Electron developers feel ashamed when they ship their products? Or have their brains been so muddled by this "JavaScript everywhere" mentality that they don't realize it's bad? Will future generations even know what a native application is anymore?

This program suggests quitting other applications while it runs. Maybe that wouldn't be so necessary if it wasn't using a framework which needs like 2GB of memory before it can draw a window.

I note that my OP hasn't been downvoted into oblivion as most of my critical HN posts are. I think there's at least a significant silent minority who agree with me on this one.

Developers just like any other inventive field have to balance time and work towards a good product.

Just because the app is written using a chromium framework does not necessarily mean that it's written poorly, VS code is a great example of a fast performance application written in electron.

I don't know where you're getting 2 GB of required memory but if you spin up an electron app it's rare that it requires more than 100 if it's not doing anything.

If you knew anything about these types of stable diffusion interfaces you know that they basically have to load the entire model into memory so that's likely where the multiple gigabytes is coming from.

A lot of us got into development work because we want to create new things, you sound more like the person who spends 99% of their time endlessly optimizing the game engine without actually remembering to build a compelling game experience.

You're getting downvoted because your arrogant tone makes you sound like an insufferable bore.

While I agree the posters comment felt entitled, it should be possible to pick up and make a SwiftUI version of the app fairly quickly.

I assume the developer went for electron due to familiarity, but it would be a pretty good exercise for someone to port it to SwiftUI and native Swift for the front end.

I would do it myself but sadly am bound by other clauses.

It reminds me "Teach Yourself C++ in 21 days". You just need to quickly learn Swift (which you will use exactly nowhere after this task).

It's astonishing how ungrateful people are. Even writing documentation for the software is quite a time-consuming action - writing the software itself is much more time-consuming.

So you are looking at some free software, that gives you the ability to play with StableDiffusion in 2 clicks, has a wide range of features and settings, surely required a ton of time to implement, and you arrogantly saying “pff, an Electron app...”

does it use the optimised model for Apple chips?
Not yet, likely, but the project is very active. I could see it coming quite soon.
I just tested that app and it was taking about 1s/it using the "Double quality, double time" version. Spat out quite nice images at 25 iterations. Way better than stuff I had tried before which looked worse after a minute than this generates in 25 seconds.
Let's give it a few days and someone will have something semi-automatic ready
> Oh gosh that's an intimidating installation process

I'm not seeing any installation instructions on either link - what am I missing?

All I had to do was:

- create a virtual environment (Python 3.8.15 worked best)

- upgrade pip

- pip install wheel

- pip install -r requirements.txt

- and then, python setup.py install

- Had to update my XCode to use the generated mlpackage files :/

- Expand drawer with instructions and follow them to download model and convert it to Core ML format

- Run their CLI command as mentioned

> Had to update my XCode to use the generated mlpackage files :/

I keep running into this, message is

  RuntimeError: Error compiling model: "Error reading protobuf spec. validator error: The model supplied is of version 7, intended for a newer version of Xcode. This version of Xcode supports model version 6 or earlier.".
I upgraded XCode, tried re-installing the command line tools with various invocations of `sudo rm -rf /Library/Developer/CommandLineTools ; xcode-select --install` etc but still get the above message

(thanks in advance, in case you see this and reply)

edit: I see from https://github.com/apple/ml-stable-diffusion/issues/7 that somebody upgraded to macos 13.0.1 and that fixed the issue for them. I've put off upgrading to Ventura so far and don't want to upgrade just to mess around with stable diffusion on m1, if it can be avoided.

I'm past the edit window, but: I'm a dope, I didn't see the quite clear "macos 13 or newer" requirement.
Where did you get those instructions from? Is creating a virtual environment necessary if I'm fine with it running on my real system?

I assume the environment part is what the "conda" commands on the GitHub repo readme are doing, but finding "conda" to install seems to be its own process. It's not on MacPorts, pip seems to only install a Python package instead of an executable, and getting a package from some other site feels sketchy.

What is it with ML and Python, anyway? Why is this amazing new technology being shrouded in an ecosystem and language which… well, I guess if I can't say anything nice…

Conda's actually a pretty well respected python distribution package manager from Anaconda.com (see e.g. https://en.wikipedia.org/wiki/Anaconda_(Python_distribution)). Anaconda has a lot of the standard scientific python computing packages in addition to a virtual environment and package manager or you could use Miniconda version for just the conda package manager + virtualenv.

I think whether you need a virtualenv depends on your system python version and compatibility of any of the dependencies, but it's also pretty nice to be able to spin up or blow away envs without bloating your main python directory or worrying that you're overwriting dependencies for a different project.

> finding conda to install seems to be its own process

    brew install miniconda
brew comes from:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Don't take my word for it, visit https://brew.sh.
I’m still stubbornly using MacPorts. If it ain’t broke…

But given that the entire world of technical documentation assumes all technically-inclined people using Macs are using Homebrew, I’ll probably have to give up and switch over at some point. But not yet.

They are basically conventions for Python but the actual instructions I just found are unexpanded in the README on the GitHub repo. You have to run one of the commands which downloads the model and converts it for you to Core ML. If you've never used Hugging Face, you'll need to create an account to get a token and then use their CLI to login with the token to be able to download the model. Then you can run prompts from CLI with the commands they give.
+1
Where are you seeing the installation process?
I could be wrong but I think part of the issue is this needs some large files for the trained dataset?