Skip to content

Studio: show image generation time - #16462

Merged
danielhanchen merged 5 commits into
unslothai:mainfrom
Aafimalek:feat/issue-16164-image-timing
Nov 3, 2026
Merged

danielhanchen merged 5 commits into
unslothai:mainfrom
Aafimalek:feat/issue-16164-image-timing

Conversation

@Aafimalek

@Aafimalek Aafimalek commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #16164. Record the elapsed generation time in gallery metadata and show it in the image recipe. The timer ends before saving and may include waiting and processing. When a request produces several images, each record shows the shared time as a batch time rather than claiming it is a per-image measurement.

The local Studio route, external-provider route and OpenAI-compatible route all record the measurement. Existing gallery images without timing metadata continue to work, and the image importer recognizes the new informational fields.

Verification

  • Windows CPU environment: 33 focused image-route tests passed; 152 OpenAI image-route and gallery tests passed with the existing ordering-sensitive test_save_many_writes_what_a_save_loop_writes excluded.
  • Six focused tests cover measured local generation, edit, external provider, OpenAI-compatible batches, PNG metadata and old records.
  • 39 frontend metadata/gallery tests, TypeScript typecheck, production build, and 36 Playwright CI-registration tests passed.
  • Chrome exercised the real Images page and confirmed batch timing is displayed while an older image has no timing row.
  • Repository Python formatter, Ruff and diff whitespace checks passed.

The broader initial backend run had 286 passes and 27 failures. Its new metadata-import failure was fixed; other failures included unavailable PyTorch and an image-order test that also failed on the unchanged upstream checkout. The initial contributor checks did not include live GPU image generation or external-provider calls.

Current-head validation

  • Head dc3fff70c4 against merge base 69f489dc6: four behavioral base-fail/head-pass checks and 302 unchanged passes. Six existing cancellation/unload test failures occur on both arms.
  • Current-head switchboard and fresh confirmation: NO_REGRESSION. Final counts: 66 SAME, 5 DOM_ONLY_DIFF, 3 FLAKY, 1 VISUAL_DIFF. The only reproduced visual change is the Recipe Time row.
  • Real tiny-pipeline GPU checks ran on Colab L4 and T4-HM; paired seeded image hashes match. These are correctness checks, not performance benchmarks.
  • Scoped Linux and macOS CI pass. Windows passes 312 checks and fails the existing save-many ordering test; the gallery implementation on that path is byte-identical to the merge base.

Before and after

Two independent Studio installs at merge base 69f489dc6 and PR head dc3fff70c4 show the same persisted PNG recipe. The Time row reads 2.3 s (batch of 2) on the PR; an older image without timing omits the row on both builds. This deterministic 2.25-second fixture demonstrates metadata serialization and display, not GPU performance.

Before: no Time row. After: 2.3 s (batch of 2).

@danielhanchen

danielhanchen commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Review record for #16462, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#713.

Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found.

Round 1: reviewed mirror baa60706e2 (this PR's bda38e64d)

chatgpt-codex-connector[bot] (on the mirror)

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: baa60706e2

No triage reaction was recorded on the mirror

Verdict

The round converged at mirror baa60706e2 (this PR's bda38e64d).

This is the review as it stood at that commit. Anything pushed to this PR afterwards was not part of it.

danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 3, 2026
danielhanchen added a commit to Etherll/unsloth that referenced this pull request Nov 3, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] shows how long it took to generate or edit each image

2 participants