Загрузка...

Environment Optimization Parameters for Image Generation on Consumer-Grade Graphics Cards #ai #image

When using the Z-Image-Turbo model on consumer-grade graphics cards,
such as NVIDIA GPUs with 16GB of VRAM to generate images.
Especially when the resolution is increased to the high resolution required for production,
the efficiency is often not as high as described in the manual.
Generating a single 1024*1536 image takes 18-40 minutes in actual tests.
At this point, we need to balance certain parameters to improve efficiency.

First, global backend optimization, modify PyTorch/CUDA underlying configuration options.
torch.backends.cudnn.benchmark = True
Automatically tests multiple convolution algorithms on the first run and caches the fastest one.
torch.backends.cuda.matmul.allow_tf32 = True
torch.backends.cudnn.allow_tf32 = True
But will slightly reduce numerical precision to gain some speed, but usually has minimal impact on image generation.

Second, memory format optimization
pipe.transformer.to(memory_format=torch.channels_last)
pipe.vae.to(memory_format=torch.channels_last)
Improves memory access efficiency and execution speed, but note that
it must be set before compile(), otherwise it may not be effective.

This way we can get a reasonable environment setup before core optimization,
better serving the core optimization that follows.
Next, we'll discuss core optimization parameters.

Видео Environment Optimization Parameters for Image Generation on Consumer-Grade Graphics Cards #ai #image канала Chardaway pirry
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять