Live data from Hacker News

Stable Diffusion PR optimizes VRAM, generate 576x1280 images with 6 GB VRAM

github.com

21–30 of 151 posts

Re: Stable Diffusion PR optimizes VRAM, generate 576x1280 images with 6 GB VRAM

#21

Unfortunately the author of this PR decided to include garbage like this [1] in it, so this PR is pretty useless. [1] https://github.com/basujindal/stable-diffusion/pull/103/file...

How is that garbage? That license is part of the original SD repository, the creator Emad even talks about it in his initial post, about the OpenRAIL M License [0]:

> i) The model is being released under a Creative ML OpenRAIL-M license [https://huggingface.co/spaces/CompVis/stable-diffusion-licen...]. This is a permissive license that allows for commercial and non-commercial usage. This license is focused on ethical and legal use of the model as your responsibility and must accompany any distribution of the model. It must also be made available to end users of the model in any service on it.

[0] https://stability.ai/blog/stable-diffusion-public-release

Re: Stable Diffusion PR optimizes VRAM, generate 576x1280 images with 6 GB VRAM

#22

Earlier quoted context omitted.

I am able to generate a maximum resolution of 512x768 on my 11GB 1080Ti. This seems to use almost 100% of the available RAM.

That's weird. I cap out at 512x512 on my 16GB Ampere card. Even stepping down precision doesn't help. I wonder what's different. I use it directly from Python.

Perhaps a different kind of chipset that isn’t optimized yet? Just a guess based on other graphics processes.

Re: Stable Diffusion PR optimizes VRAM, generate 576x1280 images with 6 GB VRAM

#23
post #18

For everyone about to comment on the garbage in the commit: It looks like the committer made their changes in the top commit, then merged the updated CompViz StableDiffusion change set on top of it for some reason. That's where the license change, rick astley image, etc come from. And yes, StableDiffusion from the original repo will rick roll you if you try to generate something that triggers its NSFW filter. Here's…

But what is the correct git command to ignore all that?

There's no git command to ignore it, the main repo should merge their changes and then the other person can make a PR on the updated changes.

Re: Stable Diffusion PR optimizes VRAM, generate 576x1280 images with 6 GB VRAM

#25
post #19
post #7

Almost impossible to pinpoint what changed thanks to thousands of lines of completely irrelevant changes and shitty commit messages. It seems the only changeset that might be relevant out of +2,273 -1,531 is the +11 -7 from https://github.com/basujindal/stable-diffusion/pull/103/comm... ? Does it even work?

As a learning opportunity for people like me, what does a good PR look like for a large change?

Branching in git is very cheap, so the typical path a large change takes to the main branch is by a series of smaller, incremental PRs. This keeps your work close to the main branch as much as possible.

Re: Stable Diffusion PR optimizes VRAM, generate 576x1280 images with 6 GB VRAM

#26
post #19
post #7

Almost impossible to pinpoint what changed thanks to thousands of lines of completely irrelevant changes and shitty commit messages. It seems the only changeset that might be relevant out of +2,273 -1,531 is the +11 -7 from https://github.com/basujindal/stable-diffusion/pull/103/comm... ? Does it even work?

As a learning opportunity for people like me, what does a good PR look like for a large change?

I would say large contributions from non-members generally work rather terribly in open source. If you absolutely have to,

- Communicate ahead of time; don't surprise maintainers with sweeping architectural changes or huge features no one wants or would like to review;

- Try to break up changes into logical units that can be understood and reviewed independently;

- Write useful and detailed commit messages (some bad examples: "Update attention.py", "various clean-ups, code now beautified");

- Don't sneak in anything unrelated to the PR; don't sneak anything unrelated into a commit;

- Absolutely don't use a code formatter to format the entire code base if the repo wasn't already using one. You can suggest that separately. And changes like that are best done by a trusted member.

Re: Stable Diffusion PR optimizes VRAM, generate 576x1280 images with 6 GB VRAM

#27

For everyone about to comment on the garbage in the commit: It looks like the committer made their changes in the top commit, then merged the updated CompViz StableDiffusion change set on top of it for some reason. That's where the license change, rick astley image, etc come from. And yes, StableDiffusion from the original repo will rick roll you if you try to generate something that triggers its NSFW filter. Here's…

> And yes, StableDiffusion from the original repo will rick roll you if you try to generate something that triggers its NSFW filter.

It goes without saying that the authors of a piece of software have the right to make the software do whatever they want, but that shouldn't stop us from recognizing that AI engineers are starting to act like megalomaniac overseers who consider it part of their mission to steer humanity onto the "right" path.

Who exactly do these people think they are?

Imagine this behavior from a web browser. "The URL of the file you were trying to download triggered my NSFW classifier, so I'm going to replace the file with this funny image."

This isn't funny, it's creepy.

Re: Stable Diffusion PR optimizes VRAM, generate 576x1280 images with 6 GB VRAM

#28
post #19
post #7

Almost impossible to pinpoint what changed thanks to thousands of lines of completely irrelevant changes and shitty commit messages. It seems the only changeset that might be relevant out of +2,273 -1,531 is the +11 -7 from https://github.com/basujindal/stable-diffusion/pull/103/comm... ? Does it even work?

As a learning opportunity for people like me, what does a good PR look like for a large change?

in this case a lot of the large change is actually "upstream".

We Have Neon, who is making a PR.

We have Upstream, SD source.

We have basu, repo maintainer.

Neon pulled in upstream changes, and are trying to merge those into basu's repo AND then on top of that, apply neon edits to the code.

Ways to make this cleaner:

- Basu pulls in upstream changes, Neon just puts theirs on top. (Slow, you have to wait for Basu)

- Neon makes two PRs, one to pull in upstream changes, another for his edits on top of those changes. (More work, and coordination, but each PR is "one unit of work")

- Better commit messages: https://github.com/basujindal/stable-diffusion/pull/103#comm... <- notice the repeated and non-descript commit messages? That makes it hard for non-experts to cherry pick out the bits that are really relevant. (Fastest)

Re: Stable Diffusion PR optimizes VRAM, generate 576x1280 images with 6 GB VRAM

#29
post #7

Almost impossible to pinpoint what changed thanks to thousands of lines of completely irrelevant changes and shitty commit messages. It seems the only changeset that might be relevant out of +2,273 -1,531 is the +11 -7 from https://github.com/basujindal/stable-diffusion/pull/103/comm... ? Does it even work?

> Does it even work?

It has an effect, but nothing like what's claimed in the submission title. On a 1070Ti (8GB), I managed to go up from 512576 to 576640.

Re: Stable Diffusion PR optimizes VRAM, generate 576x1280 images with 6 GB VRAM

#30
post #18

For everyone about to comment on the garbage in the commit: It looks like the committer made their changes in the top commit, then merged the updated CompViz StableDiffusion change set on top of it for some reason. That's where the license change, rick astley image, etc come from. And yes, StableDiffusion from the original repo will rick roll you if you try to generate something that triggers its NSFW filter. Here's…

But what is the correct git command to ignore all that?

Do a git-cherry-pick.
Post reply on HN