{{/* maintenance_row is one maintenance-table action: title, hint, the POST target with optional confirm dialog / job-status kick / extra hidden fields, and the button verb. The missing-images row stays bespoke for the inline view link in its hint. */}} {{define "maintenance_row"}} {{.Title}} - {{.Desc}}
{{range $k, $v := .Fields}} {{end}}
{{end}} {{define "settings.html"}} {{template "layout_head" .}} {{template "layout_mid" .}} {{$csrf := index . "CSRFToken"}} {{$cfg := index . "Config"}} {{$galleries := index . "Galleries"}} {{$active := index . "ActiveGallery"}} {{$monloaderPending := index . "MonloaderPending"}} {{$monloaderPaired := index . "MonloaderPaired"}} {{$monloaderPeerURL := index . "MonloaderPeerURL"}}

Settings

General

Files

{{template "partials/range_field.html" dict "Name" "max_file_size_mb" "Label" "Max file size (MB)" "Min" 1 "Max" 5120 "Value" $cfg.Gallery.MaxFileSizeMB "Ticks" (list 512 1024 2048 3072 4096 5120) "Hint" "Files larger than this are skipped on upload and during sync."}}
Web uploads land here. Blank means the gallery root.

UI

{{template "partials/range_field.html" dict "Name" "page_size" "Label" "Page size" "Min" 1 "Max" 100 "Value" $cfg.UI.PageSize "Ticks" (list 20 40 60 80 100)}}

Galleries

{{range $galleries}} {{end}}

Monloader

URLs

Internal URL monbooru uses to reach monloader. Blank = auto-detected from the pairing.

Browser URL for the footer "connected to monloader" link; blank = same as api url.

Pairing

{{template "partials/monloader_pairing.html" (dict "Pending" $monloaderPending "Paired" $monloaderPaired "PeerURL" $monloaderPeerURL "CSRFToken" $csrf)}}

Auto-Tagger

{{template "partials/tagger_mode_badge.html" (dict "UseCUDA" $cfg.Tagger.UseCUDA)}}
{{$taggers := index . "Taggers"}} {{$rows := index . "TaggerRows"}} {{$supported := index . "SupportedCount"}} {{$unsupported := index . "UnsupportedCount"}}

Workers / GPU

Requires a CUDA-capable image and a GPU passed into the container.

{{template "partials/range_field.html" dict "Name" "parallel" "Label" "Parallel workers" "Min" 1 "Max" 16 "Value" $cfg.Tagger.Parallel "Ticks" (list 1 2 4 8 12 16) "Hint" "Images tagged in parallel."}} {{template "partials/range_field.html" dict "Name" "idle_release_after_minutes" "Label" "Tagger RAM/VRAM idle release (minutes)" "Min" 0 "Max" 60 "Value" $cfg.Tagger.IdleReleaseAfterMinutes "Ticks" (list 0 15 30 45 60) "Hint" "Use 0 to free it just after inference."}}

Taggers list

{{if $rows}}
{{range $i, $r := $rows}} {{if and (gt $supported 0) (gt $unsupported 0) (eq $i $supported)}} {{end}} {{end}}
TaggerInstructionsStatusThresholdsGalleriesEnableDelete
unsupported (not in catalog)
{{$r.Name}} {{if $r.Description}}
{{$r.Description}}
{{end}}
{{if $r.Supported}} {{end}} {{if not $r.Installed}}not installed {{else if not $r.Available}}unavailable {{else if $r.Enabled}}enabled {{else}}disabled{{end}} {{if and $r.Installed $r.Enabled}} {{$r.ThresholdSummary}} {{else}} - {{end}} {{if and $r.Installed $r.Enabled}} {{$r.GallerySummary}} {{else}} - {{end}} {{if $r.Installed}} {{if $r.Enabled}} {{else if $r.Available}} {{end}} {{end}} {{if and $r.Installed (not $r.Enabled)}} {{end}}
{{else}}

No tagger subfolders found in {{$cfg.Paths.ModelPath}}.

{{end}}
{{range $rows}}{{if .Installed}}

{{.Name}} - thresholds

Loading...

{{.Name}} - galleries

Loading...
{{end}}{{end}}

-

Run one of the commands below on a host with internet access, then reload the Settings page.

Direct host install (run inside {{$cfg.Paths.ModelPath}})

Docker (monbooru container)

Relations

Find-pairs default distance

{{template "partials/range_field.html" dict "Name" "default_distance" "Label" "Hamming distance" "Min" 0 "Max" 12 "Value" $cfg.Relations.DefaultDistance "Ticks" (list 0 2 4 6 8 10 12)}}

Default session order

Authentication

{{template "partials/auth_password_section.html" (dict "AuthEnabled" $cfg.Auth.EnablePassword "CSRFToken" $csrf)}}

API Tokens

Bearer tokens for the REST API. The secret is shown once, at creation.

{{template "partials/auth_tokens.html" (dict "Tokens" $cfg.Auth.Tokens "CSRFToken" $csrf)}}

Maintenance

{{template "maintenance_row" dict "CSRF" $csrf "Title" "Orphaned thumbnails" "Desc" "remove thumbnail files with no matching image" "URL" "/settings/maintenance/prune-orphaned-thumbnails" "Verb" "Remove"}} {{template "maintenance_row" dict "CSRF" $csrf "Title" "Rebuild thumbnails" "Desc" "regenerate thumbnail files for every image" "URL" "/settings/maintenance/rebuild-thumbnails" "Verb" "Rebuild" "JobKick" true "Confirm" "Rebuild thumbnails for every image in this gallery?" "ConfirmDanger" "Long-running job; blocks other jobs until it finishes." "ConfirmOK" "Rebuild"}} {{template "maintenance_row" dict "CSRF" $csrf "Title" "Compute perceptual hashes" "Desc" "backfill phash for every image that doesn't have one yet" "URL" "/settings/maintenance/compute-phashes" "Verb" "Compute" "JobKick" true "Confirm" "Compute perceptual hashes for every image still missing one?" "ConfirmOK" "Compute"}} {{template "maintenance_row" dict "CSRF" $csrf "Title" "Rebuild pair queue" "Desc" "wipe potential relation pairs and rescan from scratch" "URL" "/relations/find-pairs" "Verb" "Rebuild" "Danger" true "JobKick" true "Confirm" "Wipe the existing pair queue and rescan from scratch?" "ConfirmDanger" "Skipped pairs and any queue work in progress are dropped." "ConfirmOK" "Rebuild" "Fields" (dict "replace" "true" "confirm" "REBUILD")}} {{template "maintenance_row" dict "CSRF" $csrf "Title" "Tag counts" "Desc" "recompute usage counts" "URL" "/settings/maintenance/recalc-tags" "Verb" "Recalculate"}} {{template "maintenance_row" dict "CSRF" $csrf "Title" "Re-extract metadata" "Desc" "re-parse metadata for every image" "URL" "/settings/maintenance/re-extract-metadata" "Verb" "Re-extract" "Confirm" "Re-parse metadata for every image in this gallery?" "ConfirmDanger" "Long-running job; blocks other jobs until it finishes." "ConfirmOK" "Re-extract"}} {{template "maintenance_row" dict "CSRF" $csrf "Title" "Vacuum database" "Desc" "compact the SQLite file after mass deletions" "URL" "/settings/maintenance/vacuum-db" "Verb" "Vacuum" "Confirm" "Compact the SQLite database now?" "ConfirmDanger" "Holds a database lock for the duration of the VACUUM; other jobs and queries will wait." "ConfirmOK" "Vacuum"}} {{template "maintenance_row" dict "CSRF" $csrf "Title" "Free memory" "Desc" "shrink SQLite caches, return the Go heap, and release the auto-tagger from RAM/VRAM." "URL" "/settings/maintenance/free-memory" "Verb" "Free"}}
Missing images - remove DB entries whose files are gone (view)
Category conflicts - list tags whose name occupies more than one category
{{$sched := $cfg.Schedule}} {{$schedSt := index . "ScheduleStatus"}}

Schedule

Runs the selected maintenance actions once per day at the configured time, on every configured gallery in sequence. Skipped silently if another job is already running at fire time.

{{if $schedSt.LastRun.IsZero}}Last run: never.{{else}}Last run: {{$schedSt.LastRun.Format "2006-01-02 15:04:05"}} ({{$schedSt.LastInfo}}, {{schedDuration $schedSt.LastDur}}).{{end}} {{if $schedSt.NextRun.IsZero}}No next run scheduled (every action is off).{{else}}Next run: {{$schedSt.NextRun.Format "2006-01-02 15:04:05"}}.{{end}}

{{$stats := index . "Stats"}}

Stats

Process memory

{{if $stats.Mem.Available}} {{if or $stats.Mem.Anon $stats.Mem.File}} {{if $stats.Mem.DB}} {{end}} {{else}} {{end}} {{else}} {{end}}
Memory used (PSS){{humanBytes $stats.Mem.Total}}
Private (anonymous){{humanBytes $stats.Mem.Anon}}
Go runtime (reserved){{humanBytes $stats.Mem.Sys}}
Go heap (live objects){{humanBytes $stats.Mem.HeapAlloc}}
Native heap (SQLite, CGO){{humanBytes $stats.Mem.Native}}
Shared (file-backed){{humanBytes $stats.Mem.File}}
DB pages (memory-mapped){{humanBytes $stats.Mem.DB}}
Code & shared libs{{humanBytes $stats.Mem.OtherFile}}
Go runtime (reserved){{humanBytes $stats.Mem.Sys}}
Go heap (live objects){{humanBytes $stats.Mem.HeapAlloc}}
Go runtime (reserved){{humanBytes $stats.Mem.Sys}}
Go heap (live objects){{humanBytes $stats.Mem.HeapAlloc}}
Goroutines{{$stats.Mem.Goroutines}}
{{$tg := $stats.Tagger}}

Auto-tagger

{{if $tg.Loaded}} {{if $tg.WorkerPSS}} {{end}} {{else}} {{end}}
Mode{{if $tg.UseCUDA}}CUDA{{else}}CPU{{end}}
Status {{if $tg.InUse}}running {{else}}idle {{schedDuration $tg.IdleFor}} {{if $tg.IdleReleaseAfter}} {{$remain := minusDuration $tg.IdleReleaseAfter $tg.IdleFor}} {{if gt (int64Duration $remain) 0}}(releases in {{schedDuration $remain}}){{else}}(release pending){{end}} {{end}} {{end}}
Models{{range $i, $n := $tg.Sessions}}{{if $i}}, {{end}}{{$n}}{{end}}
Worker PID{{$tg.WorkerPID}}
Worker memory (PSS){{humanBytes $tg.WorkerPSS}}
Worker native (ONNX + CGO){{humanBytes $tg.WorkerAnon}}
Worker code & libs{{humanBytes $tg.WorkerFile}}
Statusnot loaded

Database size per gallery

{{range $stats.Galleries}} {{end}}
GalleryDB pathSize
{{.Name}} {{.DBPath}} {{humanBytes .DBSize}}

Filesystem free space

{{if $stats.Mounts}}
{{range $stats.Mounts}} {{end}}
MountUsedFreeTotalUsed %
{{range $i, $l := .Labels}}{{if $i}}, {{end}}{{$l}}{{end}} {{humanBytes .UsedSize}} {{humanBytes .FreeSize}} {{humanBytes .TotalSize}} {{.UsedPct}}%
{{end}} {{range $stats.FSWarnings}}

{{.}}

{{end}}
{{template "layout_end" .}} {{end}}