Commit 3c519148 authored by finetuneanon's avatar finetuneanon Committed by GitHub

Update benchmark method

parent 2d042d64
......@@ -277,12 +277,11 @@ class StableDiffusionModel(nn.Module):
settings.width = w
settings.height = h
settings.n_samples = n
self.sample(settings)
now = time.perf_counter()
self.sample(settings)
self.sample(settings)
dur = time.perf_counter() - now
results.append((w, h, n, dur/2.0))
print(f"{w}x{h} with {n} images ({settings.steps} steps {settings.sampler}) took: {dur:.4f}s ({1./(dur/settings.steps):.4f}it/s, {(dur/settings.steps)*28:.4f}s for 28 steps)")
print("results")
for w,h,n,dur in results:
print(f"{w}x{h} with {n} images ({settings.steps} steps {settings.sampler}) took: {dur:.4f}s ({1./(dur/settings.steps):.4f}it/s, {(dur/settings.steps)*28:.4f}s for 28 steps)")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment