Add basic support for Z-Image Turbo txt2img#346
Add basic support for Z-Image Turbo txt2img#346monstruosoft wants to merge 3 commits intorupeshs:mainfrom
Conversation
This commit adds support for Z-Image Turbo using a 4-bit quantized model for reduced RAM usage, the model is available as an option in LCM mode.
This commit makes some extra changes in order for Z-Image Turbo txt2img mode to actually work in FastSD CPU.
|
Seems like it needs more inference steps (around 9?) |
|
I've got some decent results with as low as 4 steps, but yes, 8 to 10 is the recommended number of steps. |
|
Other than sdnq,diffusers what all other packages updated for this to work? did you disable openvino? |
|
The diffusers and sdnq packages have to be installed from source since the ZImagePipeline is not yet in the official release of diffusers: Other than that, I updated the peft, transformers and optimum-intel packages to avoid conflicts. Updating torch and torchvision may or may not be necessary but I updated those anyway. These are the versions of those packages that I have currently installed: These are all the packages I updated, didn't touch the openvino package. |
Fix issue caused by latest commit
|
Sorry, I was so carried away with Z-Image that I didn't notice that I broke generation with other models. Latest commit should fix it. I apologize for causing any issues. |
|
@monstruosoft It seems slow, what is the observed latency for 3 to 4 steps 512 x 512 image? |
|
I wanted to try it offline but it takes almost 10 minutes to generate a 512x512 image on my machine, but my machine is over a decade old, I guess it might still be usable on more recent hardware, even using CPU only. |
This PR adds basic support for Z-Image Turbo txt2img mode by making use of the Z-Image-Turbo-SDNQ-uint4-svd-r32 quantized version of the model. RAM usage is ~9 GB when using this SDNQ quantized model, other SDNQ versions of the model might work as well but I have only tried this one.
In order to run Z-Image Turbo, it's necessary to install the sdnq python package and upgrade several packages, including upgrading diffusers to the latest source version. I didn't update the requirements.txt file in case this PR waits for the Z-Image support to make it to the official release of the diffusers library.