Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

timer-neo

yeah this extension puts a stopwatch right under your generate button that times out if you dont do anything for like 3 minutes ! honestly this only exists because i want to see how long i spend being sidetracked + be more accurate and LOCK IN !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! only for txt2img tab yes

Installation

Extensions → Install from URL in Forge, paste https://github.com/amiiari/timer-neo, install, then fully restart Forge. (Or git clone it into your extensions/ folder.)

Behavior (the spec)

  • Measures actual work time: one cumulative total that survives page reloads and Forge restarts. Reset it manually when a work block is done.
  • Ticks while you work. Mouse/keyboard/scroll activity in the tab keeps it alive. After 3 minutes (configurable in Settings → Work Timer) with no input and no UI generation running, it auto-pauses (IDLE, amber badge).
  • IDLE is cleared only by clicking Generate in the UI (txt2img or img2img) or the Resume button — moving the mouse does not resume it.
  • API generations don't count. Other programs generating through this Forge instance never start, keep alive, or resume the timer. Detection rides on the interrupt-button visibility that only the UI's own submit path toggles.
  • A running UI generation counts as working: long batches keep the timer ticking even hands-off; the idle countdown starts after the job finishes.
  • Manual pause is sticky (red pulsing PAUSED badge): generation does not resume it; only the Resume button does.
  • Reset never loses data: it archives the finished block (with its end time) into the log, then zeroes the display.
  • Click the digits to edit the time (5 = 5 minutes, 5:30, 1:02:03), Enter to set, Esc to cancel. Downward corrections also flow into today's tally; upward edits leave it alone (restoring an accidentally-reset block must not double the day's record). The overwritten value is archived to the log as an edit row.
  • If time can't be saved, the timer says so: a pulsing ⚠ NOT SAVING badge appears when the backend is unreachable; unsent time is kept in the browser and retried until it lands (or the tab is closed).
  • Log accordion below the buttons: today's tally (live), per-day totals, and archived blocks. Raw data is work_log.csv next to this file; live state is state.json.
  • Display is H:MM:SS, styled with Gradio theme variables so it matches your Forge theme.

Implementation notes

  • The browser sends worked-time deltas to POST /work-timer/tick every 15 s (and via sendBeacon on tab close), so reloads and multiple tabs can't clobber the stored total. State writes are atomic (temp file + os.replace).
  • Tick bookkeeping uses performance.now() (monotonic): OS clock corrections can't create negative or oversized deltas. Per-tick deltas are capped (5 s normally, 120 s while generating) so system sleep and background-tab throttling don't get billed as work.
  • Day rollover happens server-side at save time; each finished day's total is appended to the CSV automatically.
  • If state.json is ever unreadable, it is preserved as a timestamped state.json.<datetime>.corrupt file (never overwritten) so the numbers can be recovered by hand.

Caveats

  • Back up work_log.csv / state.json before deleting or re-installing this extension (or the Forge package) — your time history lives in this folder and dies with it.
  • The endpoints have no auth (like most extension APIs); fine for localhost, but know that with --listen/--share anyone who can reach the port can read or reset the timer.
  • If you reload the page while a batch is running hands-off, the timer can't see that job until you interact again (the interrupt buttons it watches reset on page load) — it may go IDLE after the timeout.
  • A save whose response is lost (backend killed mid-request) can double-count up to one 15 s cycle on retry; accepted for a local tool.

About

Work-time stopwatch extension for SD WebUI Forge Neo — tracks your real hours under the Generate button, idle-aware, API-blind

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages