KingNish commited on
Commit
085c378
·
verified ·
1 Parent(s): c996b7d

faster (testing)

Browse files

made faster by
1. Model Loading and Device Placement: The model (pipe) is now loaded only once outside the generate function. This saves significant time on each generation.
2. Resolution Binning: Enabled by default in the options, this technique speeds up generation and reduces VRAM usage, especially for larger images.
3. Torch Compile (Experimental): Added the option to use torch.compile which might further improve performance on compatible hardware. This is highly dependent on your setup.
4. CPU Offloading (Experimental): Allows offloading parts of the model to CPU RAM, potentially enabling larger image generation or batch sizes if your GPU VRAM is limited.
5. Batch Generation: Added the ability to generate multiple images in a single pass (controlled by BATCH_SIZE environment variable or defaulting to 1). This significantly reduces overhead when generating more than one image.

1 file changed +59 -37
app.py+59-37