I generate on a 4GB GTX 1650, SD1.5 in fp32 with model offload. One 512x768 image takes about 150 seconds. That number is useless on its own β it tells me nothing about what to change. So I timed the loop in pieces.
Splitting the 150 seconds into model load, sampling steps, and PNG encode
The first version is a stopwatch and a cProfile dump, wrapped around the three phases I care about. It fits in a screen:
import cProfile , pstats , time , io from PIL import Image
def timed ( pipe , prompt , seed , out ): t = {} t [ " load " ] = time . perf_counter () pipe . enable_model_cpu_offload () t [ " load " ] = time . perf_counter () - t [ " load " ]
t [ " sample " ] = time . perf_counter () img = pipe ( prompt = prompt , width = 512 , height = 768 , generator = torch . Generator (). manual_seed ( seed )). images [ 0 ] t [ " sample " ] = time . perf_counter () - t [ " sample " ]
t [ " encode " ] = time . perf_counter () img . save ( out , format = " PNG " ) t [ " encode " ] = time .β¦