feat(example-images): add NSFW level setting endpoint

Add new POST endpoint `/api/lm/example-images/set-nsfw-level` to allow updating NSFW classification for individual example images. The endpoint supports both regular and custom images, validates required parameters, and updates the corresponding model metadata. This enables users to manually adjust NSFW ratings for better content filtering.
This commit is contained in:
Will Miao
2025-12-09 20:37:09 +08:00
parent 3fc72d6bc1
commit a6e23a7630
15 changed files with 486 additions and 165 deletions

View File

@@ -11,11 +11,7 @@ export class CheckpointContextMenu extends BaseContextMenu {
this.modelType = 'checkpoint';
this.resetAndReload = resetAndReload;
// Initialize NSFW Level Selector events only if not already initialized
if (this.nsfwSelector && !this.nsfwSelector.dataset.initialized) {
this.initNSFWSelector();
this.nsfwSelector.dataset.initialized = 'true';
}
this.initNSFWSelector();
}
// Implementation needed by the mixin
@@ -65,4 +61,4 @@ export class CheckpointContextMenu extends BaseContextMenu {
}
// Mix in shared methods
Object.assign(CheckpointContextMenu.prototype, ModelContextMenuMixin);
Object.assign(CheckpointContextMenu.prototype, ModelContextMenuMixin);