mit-han-lab / nunchaku

SVDQuant: Absorbing Outliers by Low-Rank Components for 4-Bit Diffusion Models
https://hanlab.mit.edu/projects/svdquant
Apache License 2.0
260 stars 13 forks source link

width, height MAX 1024px? #9

Closed knishika62 closed 2 days ago

knishika62 commented 2 days ago

FLUX.1 dev and schnell support 2MP(max 1408 x 1408). However, if you enter a value greater than 1024 in run_gradio.py, an error will occur (1024x768 worked without problems).

width = 1040, height = 1024 width = 832, height = 1216

100%|████████████████████████████████████████████████████████████| 25/25 [00:05<00:00, 4.85steps/s] 0%| | 0/25 [00:00<?, ?steps/s]python: /home/knishika/AI2/work/nunchaku/src/pytorch_compat.h:8: void pytorch_compat::TORCH_CHECK(bool, const string&): Assertion `cond' failed. Aborted (core dumped)

lmxyy commented 2 days ago

Could you try 1536x1536 or 1280x1280?

knishika62 commented 2 days ago

1280x1280 is CUDA OOM (dev and schnell both).

lmxyy commented 2 days ago

I see. How much gpu memory do you have?

knishika62 commented 2 days ago

RTX 4090 (24GB)

knishika62 commented 2 days ago

OOM can't be helped, but if you do this(width = 1040, height = 1024 / width = 832, height = 1216) before that, the above error will occur.

lmxyy commented 2 days ago

I see. Currently, our engine only supports images with pixel counts that are multiples of 65,536. We will fix this in our next release. You can try width 960, and height 1024.

lmxyy commented 2 days ago

BTW, you can also use our 4-bit text encoder to address the issues of OOM on your desktop. Just add the option --use-qencoder. You may need to install deepcompressor to enable that for now.

git clone https://github.com/mit-han-lab/deepcompressor
cd deepcompressor
pip install poetry
poetry install

We will remove the dependency in the next release.

knishika62 commented 2 days ago

I see. Currently, our engine only supports images with pixel counts that are multiples of 65,536. We will fix this in our next release. You can try width 960, and height 1024.

understood. and 960x1024 OK! thank you.