Buckets:

Pranav2748's picture
download
raw
1.01 kB
Quantized Text Encoders
=======================
Nunchaku provides a quantized T5 encoder for FLUX.1 to reduce GPU memory usage.
.. literalinclude:: ../../../examples/flux.1-dev-qencoder.py
:language: python
:caption: Running FLUX.1-dev with Quantized T5 (`examples/flux.1-dev-qencoder.py <https://github.com/nunchaku-tech/nunchaku/blob/main/examples/flux.1-dev-qencoder.py>`__)
:linenos:
:emphasize-lines: 11, 14
The key changes from `Basic Usage <./basic_usage>`_ are:
**Loading Quantized T5 Encoder** (line 11):
Use :class:`~nunchaku.models.text_encoders.t5_encoder.NunchakuT5EncoderModel` to load the quantized encoder.
This reduces GPU memory usage while maintaining quality. Supports local or Hugging Face remote paths.
**Pipeline Integration** (line 14):
Pass the quantized encoder to the pipeline via the ``text_encoder_2`` parameter,
replacing the default T5 encoder.
.. note::
The quantized T5 encoder currently only supports CUDA backend. Turing GPUs will be supported later.

Xet Storage Details

Size:
1.01 kB
·
Xet hash:
ae463d8b9e7d44ff91e0817bcf9cd1b298fec52e34da002f18f07278ffd4b4a7

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.