What this is about
You have a gaming PC and a free image model. A picture takes seven seconds. Can you make it faster, and what should you try first? This article follows our own path from 7.3 seconds to 1.7 on one AMD Radeon RX 7900 XTX, with the dead ends included.
Why it matters
Seconds per picture decide how many ideas you can try. At 7 seconds you can try about 500 prompts in an hour. At under 2 seconds you can try several times as many. And as you will see, the biggest win came from places beginners do not look.
How we did it: one change at a time
Our rule: every test arm changes one thing on top of the current best. Our first attempt stacked many flags in a row, which hid that one of them was a loss. Each arm below ran four pictures, and we report the steady time from runs 1 to 3. Run 0 includes loading the model.
What helped
| Change | Steady time per picture |
|---|---|
| start, with 2 GB kept free | 7.3 s |
| keep only 0.5 GB free | 6.8 s |
| int8 weights | 6.5 s |
keep models resident (--highvram), tested from the 6.8 s setup |
5.8 s |
| four steps at 768 pixels | 1.7 s |
Read the rows as separate wins, not one ladder: the resident-models test started from the 6.8 second setup, not from the int8 one. The first move, a lower memory reserve, helped because the model had been unloading and reloading parts for every prompt. The win was less shuffling, not faster math. If the memory story is new to you, read Why making pictures needs so much memory.
The int8 step stores the big weights in one byte instead of two. A small script made the 6.3 GB file from the 12.3 GB one in 19 seconds on the CPU. We checked the picture side by side: same composition, only small pixel shifts. A profile showed the gain lives in one layer shape that the math library handled badly in bf16.
Updating ComfyUI from version 0.34 to 0.43 changed little by itself, 7.0 to 6.8 seconds. The same seed gave a 29.4 dB match between versions, with the same composition.
What hurt or did nothing
| Change | Result |
|---|---|
compile the model (TorchCompileModel) |
13.2 s, twice as slow |
--fast flag |
8 percent slower |
| an AMD experimental attention flag | the server aborted on run 2 |
| a convolution tuning mode | 1.19 steps per second and a 200 second tune |
| compile plus int8 | no gain |
Try one at a time and keep what works on your machine. A flag that helps on one card can hurt on another. For example --fast hurt on our AMD card, because its autotune does nothing while ComfyUI keeps two libraries off, so only the extra cost remains.
Fewer steps and a smaller picture
The last big drop was steps and size, as in Steps: why fewer drawing steps can be enough. The price was fine texture.
The hidden wait
Our own client asked the server "are you done?" once every 2 seconds. That meant up to 2 seconds were added to every picture, in every timing we had ever taken. At 50 milliseconds, a nine-step 1024 picture went from 8.0 to 7.1 seconds with no change to the model. If you time pictures with a script, check how often it polls.
When to stop
We asked whether a faster program, a custom kernel, could get us to 1 or 2 seconds. A quick calculation said no. At 1024 pixels one step needs about 55 trillion small calculations. We measured 0.65 seconds per step, which is 85 trillion per second and 69 percent of the card's peak for that kind of math. Nine steps at the very best speed would still be about 2 seconds plus overhead. So we stopped writing kernels and turned the dials that were left. The arithmetic took minutes and saved us weeks. The full story is in A Z-Image picture in 1.7 seconds.
A checklist for your own PC
- Time a picture warm, after at least one run, and write the number down.
- Check what the memory reserve is, and lower it if models are reloading.
- Try a smaller weight format such as int8 on the biggest part.
- Cut the steps if your model is a turbo model.
- Shrink the size and see what you lose.
- Look for waits in your own tools.
- Change one thing at a time.
What did not change the picture
A fair worry is that speed tricks quietly spoil the result. For int8, we looked at the pictures side by side and found the same composition and tiny pixel shifts, with both equally sharp. For the version update, the match was 29.4 dB between versions, same composition. For the four-step setting, the loss was fine texture, and we said so. Every speed step in this list was checked against a picture, because a faster wrong picture is not a win.
Words you may meet
- Warm and cold: the model already loaded or not.
- Polling: asking again and again whether a job is done.
- int8: weights stored in one byte each.
- Kernel: a small program that runs on the graphics card.
- Flag: a switch you set when you start a program.
Try it
- Time your own picture setup before and after one change.
- See the results of fast local pictures at work on doar.bio.
- Our CPU sampler and memory profiler are at amarbaro.com/projects/corewait and amarbaro.com/projects/heaptide.
What we do not claim
These numbers are for one card with one model. A different card, model or version will give different results.

Commentaires
Pas encore de commentaires.
Se connecter pour commenter.